Initiates a new payment transaction.
{{base_url}}/payment/create
| Parameter | Type | Details |
|---|---|---|
| amount | decimal | Your Amount, must be rounded to 2 decimal places. |
| currency | string | Currency code, must be in UPPER CASE (ISO Alpha-3 format) |
| return_url | string (URL) | Your return/success URL after payment completion |
| cancel_url | string (URL) | Your cancel/failure redirect URL |
| customer_name | string | Name of the customer making the payment |
| customer_mobile | string (10 digits) | Mobile number of the customer |
| customer_email | string (email) | Email address of the customer |
| order_id | string | Unique Order ID from your system |
| vpa | string (optional) | Customer’s UPI ID (optional if using QR) |
| custom | string (optional) | Your internal transaction ID or reference |
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' => 'https://example.com/success',
'cancel_url' => 'https://example.com/cancel',
'customer_name' => 'Ravi Kumar',
'customer_mobile' => '9876543210',
'customer_email' => 'ravi@example.com',
'order_id' => 'ORDER12345',
'vpa' => 'ravi@upi',
'custom' => 'INTERNAL_TXN_001',
],
'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",
},
"type": "success"
}
**Response: ERROR (403 FAILED)**
{
"message": {
"code": 403,
"error": [
"Requested with invalid token!"
]
},
"data": [],
"type": "error"
}