Skip to main content

Create a payout request

To initiate a payout in the Amanpay payment platform, send it a request as described in this section.

URLhttps://gateway.amanpay.io
API endpoint/payments/payouts/initiate
HTTP request methodPOST
Request body formatJSON
HeaderValueDescription
Content-Typeapplication/jsonHTTP header indicating the media type of the resource sent in the request body.
AuthorizationcalculatedSignature string. For the information on how to generate the signature, see Signature generation and verification.


Parameters of a payout request:

The following table contains the parameters that can be used in payout requests you send to the Amanpay payment platform.

The parameters are divided into the following types depending on whether they are required in requests:

  • Required—the parameter is always required in payout requests
  • Optional—the parameter is optional
  • Conditionally required—the parameter may be required in payout requests under certain conditions. The conditions are given in the parameter description
ParameterTypeRequiredDescription
merchantIdintegerRequiredYour unique merchant ID that you got from Amanpay when integrating.
paymentIdstringRequiredPayment ID unique within your system.
amountnumberRequiredPayout amount in major currency units, e.g., pass 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.
customerIdstringOptionalCustomer's ID unique within your system. If not passed in the request, the value from the customerEmail parameter is used.
customerEmailstringRequiredCustomer's email.
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.
recipientTypestringRequiredCustomer's account type. Possible values: bank_account, mobile_wallet.
recipientMobileNumberstringConditionally requiredCustomer's mobile phone number associated with their e-wallet (e.g. JazzCash, Easypaisa, bKash, Nagad). The parameter is required in the request if the value of the recipientType parameter is mobile_wallet.
notifyUrlstringOptionalURL for receiving callbacks for a specific payment. By adding this parameter to your request, you'll receive a callback for the payment to the URL you specify in this parameter.


Here is an example of a payout request to the Amanpay payment platform. The example contains only basic set of parameters. The parameters that have to be used in payout requests for a specific payment method are described in the corresponding payment method's section (for the payment methods supported in Amanpay, see Payment methods).

curl -X POST "https://gateway.amanpay.io/payments/payouts/initiate" \
-H "Content-Type: application/json" \
-H "Authorization: b78d07bc3e51899182339bfb39c85ab8629085c80f9b2312444669a3bdd78cc0522a1bcca50ede6be3a90fcf489100304cde09e14fa51a175a5fed0e36f6c26b" \
-d '{
"merchantId": 1758378,
"paymentId": "payment_812",
"amount": 250.51,
"currency": "BDT",
"customerId": "customer174",
"customerEmail": "mark_cooper@example.com",
"customerName": "Mark Cooper",
"paymentMethod": "bkash",
"recipientType": "mobile_wallet",
"recipientMobileNumber": "185927571757184"
}'


Upon receiving your request, Amanpay sends a response to your system. To learn more information about responses, see the Response section.

Here is an example of the data from a response to a payout request.

{
"transactionId": "62861",
"paymentID": "payment_812",
"status": "PENDING",
"amount": 250.51,
"currency": "BDT",
"paymentType": "payout"
}

The final status of the payout is sent to your system in a separate callback. For the information about callbacks, see the Callback section.