Pay-In · Pakistan
About 2 min
Request
Pay-in API for collecting payments from customers in Pakistan (country code pk).
- Amounts are whole PKR (no decimals), 50 – 50,000 per transaction.
- See Regional Payment Guide — Pakistan for
methodcodes and extra fields.
Request URL
Domain: Prefer unified host
openapi.toppayment.com(path unchanged); legacy country domain (e.g.global-pk-openapi.toppayment.com) remains available.
| Environment | URL |
|---|---|
| Sandbox | https://openapi.toppayment.com/sandbox/pk/pay/prePay |
| Production | https://openapi.toppayment.com/pk/pay/prePay |
Request header
| Field | Required | Type | Description |
|---|---|---|---|
| Content-Type | M | String | Fixed value: application/json |
Request body
| Field | Required | Type | Description |
|---|---|---|---|
| mchNo | M | String(32) | Merchant number |
| orderNum | M | String(64) | Merchant order number |
| amount | M | Number | Amount in whole PKR (50–50000) |
| productDetail | M | String(100) | Product description |
| method | M | String(16) | Pay-in method — see Pakistan guide |
| timestamp | M | String(13) | Timestamp (milliseconds) |
| customerName | M | String(64) | Customer name |
| customerEmail | M | String(64) | Customer email |
| customerPhone | M | String(32) | Customer phone |
| documentNo | C | String(100) | 13-digit CNIC; required when method=EASYPAISA |
| downNotifyUrl | M | String(255) | Async notification URL |
| redirectUrl | O | String(512) | Redirect URL after payment (cashier) |
| sign | M | String | Signature — see Signature |
Request example
Content-type: application/json
{
"mchNo": "{{mchNo}}",
"orderNum": "PK1234561",
"amount": 500,
"productDetail": "Test product",
"method": "EASYPAISA",
"timestamp": "1749451858772",
"customerName": "Ali Khan",
"customerEmail": "[email protected]",
"customerPhone": "03001234567",
"documentNo": "3520212345671",
"downNotifyUrl": "https://example.com/notify",
"redirectUrl": "https://example.com/return",
"sign": "Generate per signature rules and replace"
}
Response Fields
See Pakistan payment guide for method meanings.
| Field | Required | Type | Description |
|---|---|---|---|
| success | M | Boolean | Success flag |
| code | M | String | 9999 = success |
| msg | O | String | Message |
| timeStamp | M | Number | Server time (ms) |
| data | M | Object | Payload |
| orderNum | M | String | Merchant order number |
| platOrderNum | M | String | Platform order number |
| amount | M | Number | Amount (integer PKR) |
| fee | M | Number | Fee |
| method | M | String | Payment method — Pakistan payment guide |
| productDetail | M | String | Product detail |
| customerName | M | String | Customer name |
| customerEmail | M | String | Customer email |
| customerPhone | M | String | Customer phone |
| validTime | M | Number | Expiry timestamp (ms) |
| cashierUrl | M | String | Cashier 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
| Field | Required | Type | Description |
|---|---|---|---|
| Content-Type | M | String | Fixed value: application/json |
Notification Body
| Field | Required | Type | Description |
|---|---|---|---|
| platOrderNum | M | String | Platform order number |
| version | M | String | Version, fixed to v1 |
| orderNum | M | String | Merchant order number, same as orderNum at order placement |
| amount | M | Number | Amount in whole PKR |
| fee | M | Number | Fee |
| customerName | M | String | Customer name |
| customerEmail | M | String | Customer email |
| customerPhone | M | String | Customer phone |
| status | M | String | Transaction status See Transaction Status Codes |
| sign | M | String | Callback 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"
}
