<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://checkout.sandbox.bka.sh/v1.2.0-beta/checkout/token/grant',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "app_key":"5nej5keguopj928ekcj3dne8p",
    "app_secret":"1honf6u1c56mqcivtc9ffl960slp4v2756jle5925nbooa46ch62"
}',
  CURLOPT_HTTPHEADER => array(
    'username: testdemo',
    'password: test%#de23@msdao',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);
echo $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);

curl_close($curl);
echo $response;
