Preloader

Initiate Payment

Initiates a new payment transaction with the same merchant API token used for Visa Gold card issuing.

Endpoint: POST {{base_url}}/payment/create
Authentication: Use the Bearer access token returned by the Access Token endpoint.
Card Payment: The returned payment_url opens the hosted checkout. When Master / Visa Card is enabled in the merchant gateway settings, customers can pay by card on that checkout and the successful Stripe payment is credited to the merchant balance.
Parameter Type Details
amount decimal Your Amount , Must be rounded at 2 precision.
currency string Currency Code, Must be in Upper Case (Alpha-3 code)
return_url: string Enter your return or success URL
cancel_url: string (optional) Enter your cancel or failed URL
custom: string (optional) Transaction id which can be used your project transaction
                    
                        Request Example (guzzle)
                        

<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', '{{base_url}}/payment/create', [
'json' => [
  'amount' => '100.00',
  'currency' => 'USD',
  'return_url' => 'www.example.com/success',
  'cancel_url' => 'www.example.com/cancel',
  'custom' => '123456789ABCD',
 ],
'headers' => [
  'Authorization' => 'Bearer {{access_token}}',
  'accept' => 'application/json',
  'content-type' => 'application/json',
 ],
]);
echo $response->getBody();
                    
                        
**Response: SUCCESS (200 OK)**
{
 "message": {
 "code": 200,
 "success": [
  "CREATED"
 ]
},
"data": {
 "token": "2zMRmT3KeYT2BWMAyGhqEfuw4tOYOfGXKeyKqehZ8mF1E35hMwE69gPpyo3e",
 "payment_url": "www.example.com/pay/sandbox/v1/user/authentication/form/2zMRmT3KeYT2BWMAyGhqEfuw4tOYOfGXKeyKqehZ8mF1E35hMwE69gPpyo3e",
 "payment_methods": [
  "wallet",
  "moncash",
  "moncash_gold",
  "master_visa_card"
 ]
},
"type": "success"
}
                    
                        
**Response: ERROR (403 FAILED)**
{
 "message": {
 "code": 403,
 "error": [
  "Requested with invalid token!"
 ]
},
"data": [],
"type": "error"
}