Pay-In · Thailand
About 2 min
Request
The Pay-In API initiates collection transactions from customers. This page covers Thailand (country code th).
Request URL
Domain: Prefer unified host
openapi.toppayment.com(path unchanged); legacy country domain (e.g.global-th-openapi.toppayment.com) remains available.
| Environment | URL |
|---|---|
| Sandbox | https://openapi.toppayment.com/sandbox/th/pay/prePay |
| Production | https://openapi.toppayment.com/th/pay/prePay |
method values are listed in Regional Payment Guide — Thailand.
Request Header
| Field | Required | Type | Description |
|---|---|---|---|
| Content-Type | M | String | HTTP content type specification Fixed value: application/json Required for proper request parsing |
Request Body
| Field | Required | Type | Description |
|---|---|---|---|
| mchNo | M | String(32) | Merchant number Unique merchant identifier assigned by the platform |
| orderNum | M | String(64) | Merchant order number Unique transaction identifier |
| amount | M | Number(32,8) | Transaction amount |
| productDetail | M | String(100) | Product detail |
| method | M | String(16) | Thailand method: qrPay or BankTransfer |
| payerBankCode | M | String(32) | Payer bank code |
| payerAccountNo | M | String(64) | Payer account number |
| timestamp | M | String(13) | Timestamp in milliseconds |
| customerName | M | String(64) | Customer name |
| customerEmail | M | String(64) | Customer email |
| customerPhone | M | String(32) | Customer phone |
| expiryPeriod | O | Number(1-9999) | Expiry in minutes |
| downNotifyUrl | M | String(255) | Async callback URL |
| redirectUrl | O | String(512) | Redirect URL |
| sign | M | String | Signature, see Signature |
Request Example
{
"mchNo": "{{mchNo}}",
"orderNum": "TH1232451",
"amount": 100,
"productDetail": "Test",
"method": "qrPay",
"payerBankCode": "KBANK",
"payerAccountNo": "0817773255",
"timestamp": "1749451858772",
"customerName": "AMY",
"customerEmail": "[email protected]",
"customerPhone": "0817773255",
"expiryPeriod": 1440,
"downNotifyUrl": "https://123.com",
"redirectUrl": "http://hxxyhyo.mr/gchmnzv",
"sign": "Generate per signature rules and replace"
}
Response
HTTP Response
| Field | Required | Type | Description |
|---|---|---|---|
| Content-Type | M | String | HTTP response content type specification Fixed value: application/json |
Response Body Parameters
| Field | Required | Type | Description |
|---|---|---|---|
| success | M | Boolean | Request success status |
| code | M | String | 9999: success; other values: failure |
| msg | O | String | Message |
| timeStamp | M | Number | Server response time in milliseconds |
| data | M | Object | Transaction data |
| orderNum | M | String | Merchant order number |
| platOrderNum | M | String | Platform order number |
| amount | M | Number | Amount |
| fee | M | Number | Fee |
| method | M | String | Payment method (Thailand) — see Regional Payment Guide — Thailand |
| 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 |
| payData | M | String | Pay data |
| payDataType | M | String | Pay data type, e.g. QR_CODE |
Response Example
{
"success": true,
"code": "9999",
"msg": null,
"timeStamp": 1767840272829,
"data": {
"orderNum": "TH1232451",
"platOrderNum": "PRE2009093829059153920",
"amount": 100,
"fee": 2.00,
"method": "qrPay",
"productDetail": "Test",
"customerName": "AMY",
"customerEmail": "[email protected]",
"customerPhone": "0817773255",
"validTime": 1767926672819,
"cashierUrl": "https://example.cashier/pay",
"payData": "https://example.cashier/pay",
"payDataType": "QR_CODE"
}
}
Notification
HTTP Request (callback)
| Field | Required | Type | Description |
|---|---|---|---|
| Content-Type | M | String | application/json |
Notification Body
| Field | Required | Type | Description |
|---|---|---|---|
| platOrderNum | M | String | Platform order number |
| version | M | String | API version, e.g. v1 |
| orderNum | M | String | Merchant order number |
| amount | M | Number | Amount |
| fee | M | Number | Fee |
| customerName | M | String | Customer name |
| customerEmail | M | String | Customer email |
| customerPhone | M | String | Customer phone |
| status | M | String | Status — see Transaction Status Codes |
| sign | M | String | Callback signature |
Response
SUCCESS
Notification Example
{
"platOrderNum": "PRE2009165141186183168",
"version": "v1",
"orderNum": "TH12324521",
"amount": 100,
"fee": 2,
"customerName": "AMY",
"customerEmail": "[email protected]",
"customerPhone": "0817773255",
"status": "SUCCESS",
"sign": "sample-signature"
}
