Skip to main content

Nagad

Payment method's logo nagad.svg
Payment method's typeE-wallet
CountryBangladesh
CurrencyBDT
RefundNo
Changed amountNo
Available operationsPurchase · Payout
Available payment typesP2C
Available purchase integrationsPurchase — Checkout · Purchase — H2H

Purchase​

Nagad purchases are available through Amanpay Checkout and Host-to-Host (H2H) integration.

Purchase — Checkout​

CHECKOUT

To initiate a purchase with the Nagad payment method using Amanpay Checkout, add the following parameters to your request.

Request parameters​

ParameterTypeRequiredDescription
merchantIdintegerRequiredYour unique merchant ID that you got from Amanpay when integrating.
paymentIdstringRequiredPayment ID unique within your system.
amountnumberRequiredPurchase amount in major currency units, e.g., pass 10.52 for 10 dollars 52 cents or 11.00 for 11 dollars.
currencystringRequiredCode of the purchase 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.
paymentMethodstringRequiredPayment method's code. Pass nagad in this parameter to preselect this payment method for your customer on the checkout page. If not passed, the customer will have to choose the payment method themselves on the checkout page.
nagadNumberstringOptionalCustomer's mobile phone number associated with their Nagad e-wallet. If not passed in the request, the customer will have to enter their mobile phone number themselves on the checkout page. Pass this parameter together with the paymentMethod parameter.
returnUrlstringOptionalURL to redirect the customer to after they've completed a payment.

You can also add any optional parameters described in the Create a purchase request section.

Request example
{
"merchantId": 1758378,
"paymentId": "payment_812",
"amount": 250.00,
"currency": "BDT",
"customerId": "customer174",
"customerEmail": "mark_cooper@example.com",
"paymentMethod": "nagad"
}
Success response
{
"transactionId": "1003592",
"paymentID": "ORDER_100001_117_100",
"status": "PENDING",
"amount": 2000,
"currency": "BDT",
"redirectUrl": "https://page.amanpay.io/checkout/example-session-id",
"paymentType": "purchase"
}
Error response

{
"result_code": "DUPLICATE_PAYMENT_ID",
"result_message": "Payment ID already exists"
}

For the full list of possible responses, see Responses codes and messages.


Purchase — H2H​

H2H

Nagad purchases are available through Host-to-Host integration.

Channel 1 — Nagad payment link

The Nagad wallet payment URL will be provided in the callback and in the payment status response.

Channel information​

TypeP2C
IntegrationH2H
ChannelNagad payment link

Request parameters​

To initiate a purchase with the Nagad payment method via H2H integration, add the following parameters to your request.

ParameterTypeRequiredDescription
merchantIdintegerRequiredYour unique merchant ID that you got from Amanpay when integrating.
paymentIdstringRequiredPayment ID unique within your system.
amountnumberRequiredPurchase amount in major currency units.
currencystringRequiredCode of the purchase currency in the ISO-4217 alpha-3 format.
customerIdstringOptionalCustomer's ID unique within your system. If not passed, the value from the customerEmail parameter is used.
customerEmailstringRequiredCustomer's email.
paymentMethodstringRequiredPayment method's code. Pass nagad.
nagadNumberstringOptionalCustomer's mobile phone number associated with their Nagad e-wallet.
returnUrlstringOptionalURL to redirect the customer to after they've completed a payment.
Request example
{
"merchantId": 1758378,
"paymentId": "payment_812",
"amount": 2000.00,
"currency": "BDT",
"customerId": "customer174",
"customerEmail": "mark_cooper@example.com",
"paymentMethod": "nagad"
}
Success response
{
"transactionId": "1002858",
"paymentID": "ORDER_100001_316_852",
"status": "PENDING",
"amount": 2000,
"currency": "BDT",
"paymentType": "purchase"
}
Error response
{
"result_code": "DUPLICATE_PAYMENT_ID",
"result_message": "Payment ID already exists"
}

For the full list of possible responses, see Responses codes and messages.

Callback with Nagad payment data​

H2H only

The following table contains the callback parameters.

ParameterTypeRequiredDescription
transactionIdintegerRequiredPayment ID within the Amanpay payment platform.
operationIdintegerOptionalOperation ID within the Amanpay payment platform.
additionalDataobjectRequiredContains additional payment-related parameters required by the payment platform, such as payment link.
statusobjectRequiredPurchase status. Possible values: PENDING — additional data is required to continue the purchase flow.
Callback example
{
"additional_data": {
"PaymentData": "https://payment.mynagad.com:30000/check-out/MDgxNDE3MDcyNzU2NS42ODYwMDUxMTMyNjUzOTkuQVBCOVlBNkZETjMuZmI4MWNkMjUzMDU4OGIxYTUyMmQ="
},
"operationId": 653725,
"transactionId": 102073,
"status": "PENDING"
}

Payout​

To initiate a payout with the Nagad payment method, add the following parameters to your request.

Request parameters​

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.
paymentMethodstringRequiredPayment method's code. Pass nagad in this parameter.
recipientTypestringRequiredCustomer's account type. Pass mobile_wallet in this parameter.
recipientMobileNumberstringRequiredCustomer's mobile phone number associated with their Nagad e-wallet.

Request example

POST/payments/payouts/initiate
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": 500.00,
"currency": "BDT",
"customerId": "customer174",
"customerEmail": "mark_cooper@example.com",
"customerName": "Mark Cooper",
"paymentMethod": "nagad",
"recipientType": "mobile_wallet",
"recipientMobileNumber": "285937571757185"
}'

Success response

{
"transactionId": "1003685",
"paymentID": "payment_812",
"status": "PENDING",
"amount": 500,
"currency": "BDT",
"paymentType": "payout"
}

Error response

{
"result_code": "DUPLICATE_PAYMENT_ID",
"result_message": "Payment ID already exists"
}

For the full list of possible responses, see Responses codes and messages.