RRoyal Pay API docs
Menu

7. Generate payout request

POSThttps://api.royalpe.site/payout/merchant/api/generate-payout

Create one merchant payout request.

Required headers #

Headers
accessKey: YOUR_ACCESS_KEY
secretKey: YOUR_SECRET_KEY
Content-Type: application/json
Origin: https://merchant.example.com

The authorised merchant Origin is mandatory for this endpoint, and the request must come from a whitelisted server IP. Both are set by Royal Pay for your account: see 2. Authentication and setup.

Request body #

JSON
{
  "amount": 1500,
  "accountNumber": "123456789012",
  "accountHolderName": "Ravi Kumar",
  "ifscCode": "SBIN0001234",
  "orderId": "ORD-10001",
  "remarks": "Vendor settlement",
  "callbackUrl": "https://merchant.example.com/payout-webhook"
}
FieldTypeRequiredValidation / description
amountnumberYesRupees, minimum 1000, at most 2 decimals
accountNumberstring or numberYes9–18 digits. Send a string to keep leading zeroes.
accountHolderNamestringYes2–100 characters; letters, spaces and dots
ifscCodestringYesValid 11-character IFSC
orderIdstringYesMerchant order/reference ID. Same orderId and same details return the same payout; different details answer 409.
remarksstringNoMaximum 200 characters
callbackUrlstringNoHTTPS payout webhook URL. See 9. Payout webhook.

cURL example #

Use your authorised merchant Origin and your credentials.

cURL
curl --request POST 'https://api.royalpe.site/payout/merchant/api/generate-payout' \
  --header 'Content-Type: application/json' \
  --header 'accessKey: YOUR_ACCESS_KEY' \
  --header 'secretKey: YOUR_SECRET_KEY' \
  --header 'Origin: https://merchant.example.com' \
  --data-raw '{
    "amount": 1500,
    "accountNumber": "123456789012",
    "accountHolderName": "Ravi Kumar",
    "ifscCode": "SBIN0001234",
    "orderId": "ORD-10001",
    "remarks": "Vendor settlement",
    "callbackUrl": "https://merchant.example.com/payout-webhook"
  }'

Success response (HTTP 201) #

201
{
  "status": true,
  "message": "Payout request generated successfully",
  "data": {
    "orderId": "ORD-10001",
    "transactionId": "PO-1a2b3c4d5e6f7a8b",
    "amount": 1500,
    "status": "processing"
  }
}

The amount is reserved from your available balance at once. Royal Pay's team makes the bank transfer and records the outcome: you get it by webhook and from 8. Track payout status.

Common errors #

Error
{ "status": false, "message": "Insufficient balance for this payout" }
HTTP codeMessage / condition
400Missing or invalid origin header.
400orderId is required
400Insufficient balance for this payout
400No payout approver assigned to this merchant
400Minimum payout amount is 1000, Invalid amount, Invalid beneficiary details, Invalid remarks, A valid HTTPS URL is required
401Access key and secret key are required
401Invalid access key or secret key
403Access from IP <ip> is not allowed.
403Access from Origin <hostname> (<ip>) is not allowed.
409Order ID already used with different details
500Something went wrong