# 7. Generate payout request

`POST https://api.royalpe.site/payout/merchant/api/generate-payout`

Create one merchant payout request.

## Required headers

```http title="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](https://docs.royalpe.site/authentication#payout-setup).

## Request body

```json title="JSON"
{
  "amount": 1500,
  "accountNumber": "123456789012",
  "accountHolderName": "Ravi Kumar",
  "ifscCode": "SBIN0001234",
  "orderId": "ORD-10001",
  "remarks": "Vendor settlement",
  "callbackUrl": "https://merchant.example.com/payout-webhook"
}
```

| Field | Type | Required | Validation / description |
|---|---|---|---|
| `amount` | number | Yes | Rupees, minimum 1000, at most 2 decimals |
| `accountNumber` | string or number | Yes | 9–18 digits. Send a string to keep leading zeroes. |
| `accountHolderName` | string | Yes | 2–100 characters; letters, spaces and dots |
| `ifscCode` | string | Yes | Valid 11-character IFSC |
| `orderId` | string | Yes | Merchant order/reference ID. Same `orderId` and same details return the same payout; different details answer `409`. |
| `remarks` | string | No | Maximum 200 characters |
| `callbackUrl` | string | No | HTTPS payout webhook URL. See [9. Payout webhook](https://docs.royalpe.site/payout/webhook). |

## cURL example

Use your authorised merchant Origin and your credentials.

```bash title="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)

```json title="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](https://docs.royalpe.site/payout/webhook) and from [8. Track payout status](https://docs.royalpe.site/payout/payout-status).

## Common errors

```json title="Error"
{ "status": false, "message": "Insufficient balance for this payout" }
```

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

---

Source: https://docs.royalpe.site/payout/generate-payout · All docs: https://docs.royalpe.site/llms-full.txt · Updated 2026-11-30
