Skip to main content

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.

1
Create a payout

Send a POST request to the Amanpay API with the payout and recipient details.

2
Get the payout response

Amanpay returns a response with the transaction details and the current payout status.

3
Track the payout

Check the payout status or receive a callback to determine the final result.

Payout Flow​



Request​

Use the following endpoint to create a payout:

ParameterValue
URLhttps://gateway.amanpay.io
API endpoint/payments/payouts/initiate
HTTP request methodPOST
Request body formatJSON
HeaderValueRequiredDescription
Content-Typeapplication/jsonRequiredHTTP header indicating the media type of the resource sent in the request body.
AuthorizationcalculatedRequiredFor 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.

ParameterTypeRequiredDescription
merchantIdintegerRequiredYour unique merchant ID that you received from Amanpay during integration.
paymentIdstringRequiredPayment ID unique within your system.
amountnumberRequiredPayout amount in major currency units, e.g. 10.52 for 10 dollars 52 cents or 11.00 for 11 dollars.
currencystringRequiredCode of the payout currency in the ISO-4217 alpha-3 format.
customerIdstringConditionalCustomer'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.
customerEmailstringConditionalCustomer's email.
Either customerEmail or customerId must be provided.
customerNamestringRequiredCustomer's full name.
customerKYCLevelstringOptionalVerification level of the customer within your system. Possible values: verified, basic.
paymentMethodstringRequiredPayment method's code. Possible values: bkash, nagad, jazzcash, easypaisa, banktransfer.
recipientTypestringRequiredCustomer's account type. Possible values: bank_account, mobile_wallet.
recipientMobileNumberstringConditionalCustomer's mobile phone number associated with their e-wallet, such as JazzCash, Easypaisa, bKash, or Nagad. Required when recipientType is mobile_wallet.
recipientBankAccNumberstringConditionalCustomer's bank account number. Required when recipientType is bank_account.
bankCodestringConditionalCustomer's bank code. Required when paymentMethod is banktransfer. See the Bank codes section.
notifyUrlstringOptionalURL for receiving callbacks for a specific payment.
Easypaisa request example
{
"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"
}
note

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).

Bank transfer request example
{
"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​

HeaderValueRequiredDescription
Content-Typeapplication/jsonRequiredHTTP header indicating the media type of the resource sent in the request body.
AuthorizationcalculatedRequiredFor more details about request signature generation, see the About the signature section.
FieldTypeRequiredDescription
transactionIdstringRequiredUnique transaction identifier assigned by Amanpay.
paymentIDstringRequiredUnique payment identifier provided in the payout request.
statusstringRequiredCurrent status of the payout. All possible statuses are described in Responses & Callbacks.
amountnumberRequiredPayout amount in major currency units.
currencystringRequiredISO-4217 alpha-3 currency code.
paymentTypestringRequiredType of payment operation. For payouts, the value is payout.
result_codestringConditionalError code identifying the reason for the failed request. Returned only in case of an error.
result_messagestringConditionalDescription of the error. Returned only in case of an error.

Here is an example of a successful payout response:

Response example
{
"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.

Error response
{
"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.