Payouts
Amanpay lets you send payouts directly to your customers' bank accounts or e-wallets. Create a payout through the Amanpay API, provide the recipient details, and track the payment until the final status is received.
Send a POST request to the Amanpay API with the payout and recipient details.
Amanpay returns a response with the transaction details and the current payout status.
Check the payout status or receive a callback to determine the final result.
Payout Flow
Request
Use the following endpoint to create a payout:
| Parameter | Value |
|---|---|
| URL | https://gateway.amanpay.io |
| API endpoint | /payments/payouts/initiate |
| HTTP request method | POST |
| Request body format | JSON |
| Header | Value | Required | Description |
|---|---|---|---|
Content-Type | application/json | Required | HTTP header indicating the media type of the resource sent in the request body. |
Authorization | calculated | Required | For more information about request signature generation, see the Signature section. |
The following parameters can be used in payout requests sent to the Amanpay payment platform.
| Parameter | Type | Required | Description |
|---|---|---|---|
merchantId | integer | Required | Your unique merchant ID that you received from Amanpay during integration. |
paymentId | string | Required | Payment ID unique within your system. |
amount | number | Required | Payout amount in major currency units, e.g. 10.52 for 10 dollars 52 cents or 11.00 for 11 dollars. |
currency | string | Required | Code of the payout currency in the ISO-4217 alpha-3 format. |
customerId | string | Conditional | Customer's ID unique within your system. If not passed in the request, the value from the customerEmail parameter is used.Either customerEmail or customerId must be provided. |
customerEmail | string | Conditional | Customer's email. Either customerEmail or customerId must be provided. |
customerName | string | Required | Customer's full name. |
customerKYCLevel | string | Optional | Verification level of the customer within your system. Possible values: verified, basic. |
paymentMethod | string | Required | Payment method's code. Possible values: bkash, nagad, jazzcash, easypaisa, banktransfer. |
recipientType | string | Required | Customer's account type. Possible values: bank_account, mobile_wallet. |
recipientMobileNumber | string | Conditional | Customer's mobile phone number associated with their e-wallet, such as JazzCash, Easypaisa, bKash, or Nagad. Required when recipientType is mobile_wallet. |
recipientBankAccNumber | string | Conditional | Customer's bank account number. Required when recipientType is bank_account. |
bankCode | string | Conditional | Customer's bank code. Required when paymentMethod is banktransfer. See the Bank codes section. |
notifyUrl | string | Optional | URL for receiving callbacks for a specific payment. |
{
"merchantId": 1758378,
"paymentId": "payment_812",
"amount": 250,
"currency": "PKR",
"customerId": "customer174",
"customerEmail": "mark_cooper@example.com",
"customerName": "Mark Cooper",
"paymentMethod": "easypaisa",
"recipientType": "mobile_wallet",
"recipientMobileNumber": "03XXXXXXXXX"
}
For easypaisa and jazzcash, provide the recipient's mobile number in the following format: 03XXXXXXXXX (11 digits).
For bkash and nagad, provide the recipient's mobile number in the following format: 01XXXXXXXXX (11 digits).
{
"merchantId": 8213,
"paymentId": "ORDER_100001_{{$randomInt}}_{{$randomInt}}",
"amount": 1.00,
"currency": "PKR",
"customerId": "customer174",
"customerEmail": "mark_cooper@example.com",
"customerName": "Mark Cooper",
"paymentMethod": "banktransfer",
"recipientType": "bank_account",
"bankCode": "MEEZAN",
"recipientBankAccNumber": "PXXXXXXXXXXXXXXXXXXXX"
}
Upon receiving your request, Amanpay sends a response to your system. To learn more about responses, see the Responses & Callbacks section.
Response
| Header | Value | Required | Description |
|---|---|---|---|
Content-Type | application/json | Required | HTTP header indicating the media type of the resource sent in the request body. |
Authorization | calculated | Required | For more details about request signature generation, see the About the signature section. |
| Field | Type | Required | Description |
|---|---|---|---|
transactionId | string | Required | Unique transaction identifier assigned by Amanpay. |
paymentID | string | Required | Unique payment identifier provided in the payout request. |
status | string | Required | Current status of the payout. All possible statuses are described in Responses & Callbacks. |
amount | number | Required | Payout amount in major currency units. |
currency | string | Required | ISO-4217 alpha-3 currency code. |
paymentType | string | Required | Type of payment operation. For payouts, the value is payout. |
result_code | string | Conditional | Error code identifying the reason for the failed request. Returned only in case of an error. |
result_message | string | Conditional | Description of the error. Returned only in case of an error. |
Here is an example of a successful payout response:
{
"transactionId": "62861",
"paymentID": "payment_812",
"status": "PENDING",
"amount": 250,
"currency": "PKR",
"paymentType": "payout"
}
If the request cannot be processed, the response contains result_code and result_message describing the error.
{
"result_code": "DUPLICATE_PAYMENT_ID",
"result_message": "Payment ID already exists"
}
The final status of the payout is available through the payment status endpoint and callbacks. See Responses & Callbacks for more information.