Payout Initiate
Initiate a payout using a structured POST request.
Same merchant_key and merchant_secret For Both Payin and Payout
Endpoint
POST: /StartPayout/initiate_payout
Request Parameters
| Field | Description |
|---|---|
| name | Beneficiary full name |
| amount | Payout amount |
| merchant_key | Your assigned merchant key |
| bank_account | Beneficiary bank account number |
| bank_ifsc | Bank IFSC code |
| bank_name | Beneficiary bank name |
| order_id | Unique merchant order ID/reference |
| hash | Secure HMAC SHA-256 hash |
Hash Generation
To secure the request, generate a hash using these steps:
-
Sort the parameters by key (alphabetically).
Example order:
amount,bank_account,bank_ifsc,bank_name,merchant_key,name,order_id, -
Concatenate the values of the sorted parameters, separated by a pipe
|. -
Generate the hash using HMAC SHA-256 with your
merchant_secretas the key.
Example Hash Generation
-
Message to be hashed:
amount|bank_account|bank_ifsc|bank_name|merchant_key|name|order_id -
Hashing function (PHP):
$formData = [
'order_id' => $orderId,
'amount' => $amount,
'merchant_key' => $merchant_key,
'name' => $name,
'bank_account' => $bankaccount,
'bank_ifsc' => $bankifsc,
'bank_name' => $bankname
];
// Hash generation
ksort($formData);
$hashString = implode('|', array_values($formData));
$hash = hash_hmac('sha256', $hashString, $merchant_secret, false);
$formData['hash'] = $hash;
// Send payout request
$ch = curl_init($payment_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $formData);
$response = curl_exec($ch);
curl_close($ch);
// Response Handling
$responseData = json_decode($response, true);
Request Example (JSON)
{
"data": {
"name": "Ajay Verma",
"amount": "100.00",
"bank_account": "1234567890",
"bank_ifsc": "HDFC0001234",
"bank_name": "HDFC Bank",
"merchant_key": "MerKey123",
"order_id": "ORD123456",
"hash": "GENERATED_SHA256_HASH"
},
}
Callback Response
{
'reference_id' => "PAYOUT1234567890",
'status' =>"'Success'",
'amount' => "100.00",
'utr' => "UTR987654321",
'account' => "1234567890",
'ifsc' => "HDFC0001234",
'merchant_order' => "ORD123456"
}
Error Responses:
-
Missing required fields:
ERR100 -
Invalid Merchant Key:
ERR001 -
Hash Mismatch:
ERR002 -
Insufficient balance:
ERR005