Skip to main content

Pay-In · Pakistan

TOPPAY TeamAbout 2 min

Request

Pay-in API for collecting payments from customers in Pakistan (country code pk).

Request URL

Domain: Prefer unified host openapi.toppayment.com (path unchanged); legacy country domain (e.g. global-pk-openapi.toppayment.com) remains available.

EnvironmentURL
Sandboxhttps://openapi.toppayment.com/sandbox/pk/pay/prePay
Productionhttps://openapi.toppayment.com/pk/pay/prePay

Request header

FieldRequiredTypeDescription
Content-TypeMStringFixed value: application/json

Request body

FieldRequiredTypeDescription
mchNoMString(32)Merchant number
orderNumMString(64)Merchant order number
amountMNumberAmount in whole PKR (50–50000)
productDetailMString(100)Product description
methodMString(16)Pay-in method — see Pakistan guide
timestampMString(13)Timestamp (milliseconds)
customerNameMString(64)Customer name
customerEmailMString(64)Customer email
customerPhoneMString(32)Customer phone
documentNoCString(100)13-digit CNIC; required when method=EASYPAISA
downNotifyUrlMString(255)Async notification URL
redirectUrlOString(512)Redirect URL after payment (cashier)
signMStringSignature — see Signature

Request example

Content-type: application/json

Response Fields

See Pakistan payment guide for method meanings.

FieldRequiredTypeDescription
successMBooleanSuccess flag
codeMString9999 = success
msgOStringMessage
timeStampMNumberServer time (ms)
dataMObjectPayload
orderNumMStringMerchant order number
platOrderNumMStringPlatform order number
amountMNumberAmount (integer PKR)
feeMNumberFee
methodMStringPayment method — Pakistan payment guide
productDetailMStringProduct detail
customerNameMStringCustomer name
customerEmailMStringCustomer email
customerPhoneMStringCustomer phone
validTimeMNumberExpiry timestamp (ms)
cashierUrlMStringCashier URL

Response Example

{
  "success": true,
  "code": "9999",
  "msg": null,
  "timeStamp": 1767840272829,
  "data": {
    "orderNum": "PK1234561",
    "platOrderNum": "PRE2009093829059153920",
    "amount": 500,
    "fee": 10,
    "method": "EASYPAISA",
    "productDetail": "Test product",
    "customerName": "Ali Khan",
    "customerEmail": "[email protected]",
    "customerPhone": "03001234567",
    "validTime": 1767926672819,
    "cashierUrl": "https://example.cashier/pay"
  }
}

Notification

Pakistan uses the default callback. version is fixed to v1.

HTTP Request

FieldRequiredTypeDescription
Content-TypeMStringFixed value: application/json

Notification Body

FieldRequiredTypeDescription
platOrderNumMStringPlatform order number
versionMStringVersion, fixed to v1
orderNumMStringMerchant order number, same as orderNum at order placement
amountMNumberAmount in whole PKR
feeMNumberFee
customerNameMStringCustomer name
customerEmailMStringCustomer email
customerPhoneMStringCustomer phone
statusMStringTransaction status
See Transaction Status Codes
signMStringCallback signature — see Signature

Response

Verify the signature, then return the plain string SUCCESS only.

SUCCESS

Notification Example

{
    "platOrderNum": "PRE2009165141186183168",
    "version": "v1",
    "orderNum": "PK1234561",
    "amount": 500,
    "fee": 10,
    "customerName": "Ali Khan",
    "customerEmail": "[email protected]",
    "customerPhone": "03001234567",
    "status": "SUCCESS",
    "sign": "Verify per signature rules"
}