Skip to main content

EasyPaisa

Accept payments

Receive payments from customers using their EasyPaisa wallet.

Send payouts

Send funds directly to a recipient's EasyPaisa wallet.

Integration

Available through Checkout and H2H integrations.

TypeE-wallet
CountryPakistan
CurrencyPKR
RefundNo
Changed amount

P2C - No
P2P - Yes

Operations

Purchase · Payout

Payment typesP2C · P2P
Purchase integrations

Checkout · H2H

EasyPaisa is a digital wallet and mobile financial service available in Pakistan. Amanpay supports EasyPaisa for both customer payments and payouts.

For purchases, customers can pay using their EasyPaisa wallet through Checkout or H2H integration.

For payouts, funds are sent directly to the recipient's EasyPaisa wallet using their mobile number.


Purchase​

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

Request endpoint​
ParameterValue
URLhttps://gateway.amanpay.io
API endpoint/payments/purchases/initiate
HTTP request methodPOST
Request body formatJSON

Purchase · Checkout​

CHECKOUT

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

Request parameters​
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.
ParameterTypeRequiredDescription
merchantIdintegerRequiredYour unique merchant ID that you got from Amanpay when integrating.
paymentIdstringRequiredPayment ID unique within your system.
amountnumberRequiredThe amount is specified in major units and may include decimal places, for example, 500.50.
currencystringRequiredCode of the purchase 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.
customerIpstringOptionalCustomer's IP address.
paymentMethodstringOptionalPayment method's code. Pass easypaisa 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.
easypaisaNumberstringOptionalCustomer's mobile phone number associated with their EasyPaisa 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.
Request example
{
"merchantId": 123,
"paymentId": "payment_812",
"amount": 250.00,
"currency": "PKR",
"customerId": "customer174",
"customerEmail": "mark_cooper@example.com"
}
Success response
{
"transactionId": "1003592",
"paymentID": "payment_812",
"status": "PENDING",
"amount": 250,
"currency": "PKR",
"redirectUrl": "https://page.amanpay.io/checkout/8d797e24-b1bd-11f1-9cc1-caa1979cef0f",
"paymentType": "purchase"
}
Error response

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

For the full list of possible responses, see Responses & Callbacks.


Purchase · H2H​

H2H

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

Request parameters​

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

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.
ParameterTypeRequiredDescription
merchantIdintegerRequiredYour unique merchant ID that you got from Amanpay when integrating.
paymentIdstringRequiredPayment ID unique within your system.
amountnumberRequiredThe amount is specified in major units and may include decimal places, for example, 500.50.
currencystringRequiredCode of the purchase 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.
customerIpstringOptionalCustomer's IP address. Э
paymentMethodstringRequiredPayment method's code. Pass Easypaisa.
easypaisaNumberstringOptionalCustomer's mobile phone number associated with their Easypaisa e-wallet.
returnUrlstringOptionalURL to redirect the customer to after they've completed a payment.
notifyUrlstringOptionalURL for receiving callbacks for a specific payment.
Request example
{
"merchantId": 123,
"paymentId": "payment_812",
"amount": 2000.00,
"currency": "BDT",
"customerId": "customer174",
"customerEmail": "mark_cooper@example.com",
"paymentMethod": "easypaisa",
"EasypaisaNumber": "03123456789"
}
Success response
{
"transactionId": "1002858",
"paymentID": "payment_812",
"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 & Callbacks.

Channel 1 · Easypaisa App Confirmation​

Type

P2C

Integration

H2H

Channel

Easypaisa App Confirmation

note

Provide the customer's EasyPaisa mobile number in the request. The customer will receive a payment notification in their EasyPaisa app and can confirm the payment directly in the app. No additional action is required from the merchant.

Channel 2 · Easypaisa App Confirmation + OTP​

Type

P2C

Integration

H2H

Channel

Easypaisa App Confirmation + OTP

H2H only

The following table contains the callback parameters.

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.
ParameterTypeRequiredDescription
transactionIdintegerRequiredPayment ID within the AmanPay payment platform.
operationIdintegerOptionalOperation ID within the AmanPay payment platform.
additional_fieldsstring[]RequiredList of additional fields that the merchant must provide to complete the purchase.
additional_fields.OtpstringRequiredCustomer's payment details required to complete the purchase.
statusstringRequiredPurchase status. SPECIFICATION means that additional payment details are required to continue the purchase flow.
Callback example
{
"additional_fields": [
"Otp"
],
"operationId": 1292703,
"transactionId": 1108169,
"status": "SPECIFICATION"
}

Upon receiving such a callback, you should provide Amanpay with the data it needs by sending it a request as follows:

ParameterValue
URLhttps://gateway.amanpay.io
API endpoint/payments/purchases/specify/{operationId}
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 details about request signature generation, see the About the signature section.
ParameterTypeRequiredDescription
transactionIdintegerRequiredUnique transaction ID assigned to the payment.
merchantIdintegerRequiredYour unique merchant ID provided by Amanpay during integration.
additionalFieldsobjectRequiredAdditional data required for the payment.
additionalFields.OtpstringRequiredCustomer-provided OTP
Specify request example
{
"transactionId": 62861,
"merchantId": 1758378,
"additionalFields": {
"Otp": "1234"
}
}
Specify success response
{
"result_code": "OK"
}

Channel 3 · EasyPaisa P2P​

Type

P2P

Integration

H2H

Channel

P2P Deposits

H2H only

The following table contains the callback parameters.

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.
ParameterTypeRequiredDescription
transactionIdintegerRequiredPayment ID within the Amanpay payment platform.
operationIdintegerOptionalOperation ID within the Amanpay payment platform.
additionalDataobjectRequiredContains payment details required to complete the purchase.
additionalData.receiverNamestringRequiredName of the recipient to whom the customer must transfer the funds.
additionalData.receiverAccountstringRequiredEasyPaisa wallet number to which the customer must transfer the funds.
additionalData.additionalFieldsstringRequiredAdditional field required to complete the purchase. Returns TrxId.
statusstringRequiredSPECIFICATION means additional payment details are required to continue the purchase flow.
Callback example
{
"additionalData": {
"receiverName": "Zaibun Nisa",
"receiverAccount": "03123456789",
"additionalFields": "TrxId"
},
"operationId": 1787315,
"transactionId": 1423544,
"status": "SPECIFICATION"
}
Check status example with payment details
{
"transactionId": "1423544",
"paymentID": "ORDER_100001_459_917",
"status": "SPECIFICATION",
"amount": 2500,
"currency": "PKR",
"paymentType": "purchase",
"additionalData": {
"receiverName": "Zaibun Nisa",
"receiverAccount": "03123456789",
"additionalFields": "TrxId",
"operationId": 104018
}
}

Upon receiving this callback, display the payment details to the customer. After the customer completes the transfer and provides the transaction ID (TrxId), submit it to Amanpay using the following request.

ParameterValue
URLhttps://gateway.amanpay.io
API endpoint/payments/purchases/specify/{operationId}
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 details about request signature generation, see the About the signature section.
ParameterTypeRequiredDescription
transactionIdintegerRequiredPayment ID within the Amanpay payment platform.
merchantIdintegerRequiredYour unique merchant ID provided by Amanpay during integration.
additionalFieldsobjectRequiredContains additional data required to complete the purchase.
additionalFields.TrxIdstringRequiredTransaction ID provided by the customer after completing the payment.
Specify request example
{
"transactionId": 102540,
"merchantId": 1758378,
"additionalFields": {
"TrxId": "12345678901"
}
}
Specify success response
{
"result_code": "OK"
}

Payout​

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

ParameterValue
URLhttps://gateway.amanpay.io
API endpoint/payments/payouts/initiate
HTTP request methodPOST
Request body formatJSON
Request parameters​
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.
ParameterTypeRequiredDescription
merchantIdintegerRequiredYour unique merchant ID that you got from Amanpay when integrating.
paymentIdstringRequiredPayment ID unique within your system.
amountnumberRequiredThe amount is specified in major units and may include decimal places, for example, 500.50.
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.
paymentMethodstringRequiredPayment method's code. Pass Easypaisa in this parameter.
recipientTypestringRequiredCustomer's account type. Pass mobile_wallet in this parameter.
recipientMobileNumberstringRequiredCustomer's mobile phone number associated with their Easypaisa e-wallet.
notifyUrlstringOptionalURL for receiving callbacks for a specific payment.
note

For easypaisa, provide the recipient's mobile number in the following format: 03XXXXXXXXX (11 digits)

Request
{
"merchantId": 123,
"paymentId": "payment_812",
"amount": 500,
"currency": "PKR",
"customerId": "customer174",
"customerEmail": "mark_cooper@example.com",
"customerName": "Mark Cooper",
"paymentMethod": "easypaisa",
"recipientType": "mobile_wallet",
"recipientMobileNumber": "03121234567"
}
Success response
{
"transactionId": "1003685",
"paymentID": "payment_812",
"status": "PENDING",
"amount": 500,
"currency": "PKR",
"paymentType": "payout"
}
Error response
{
"result_code": "DUPLICATE_PAYMENT_ID",
"result_message": "Payment ID already exists"
}

For the full list of possible responses, see Responses & Callbacks.