Skip to main content

Pay-In · Thailand

TOPPAY TeamAbout 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.

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

method values are listed in Regional Payment Guide — Thailand.

Request Header

FieldRequiredTypeDescription
Content-TypeMStringHTTP content type specification
Fixed value: application/json
Required for proper request parsing

Request Body

FieldRequiredTypeDescription
mchNoMString(32)Merchant number
Unique merchant identifier assigned by the platform
orderNumMString(64)Merchant order number
Unique transaction identifier
amountMNumber(32,8)Transaction amount
productDetailMString(100)Product detail
methodMString(16)Thailand method: qrPay or BankTransfer
payerBankCodeMString(32)Payer bank code
payerAccountNoMString(64)Payer account number
timestampMString(13)Timestamp in milliseconds
customerNameMString(64)Customer name
customerEmailMString(64)Customer email
customerPhoneMString(32)Customer phone
expiryPeriodONumber(1-9999)Expiry in minutes
downNotifyUrlMString(255)Async callback URL
redirectUrlOString(512)Redirect URL
signMStringSignature, 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

FieldRequiredTypeDescription
Content-TypeMStringHTTP response content type specification
Fixed value: application/json

Response Body Parameters

FieldRequiredTypeDescription
successMBooleanRequest success status
codeMString9999: success; other values: failure
msgOStringMessage
timeStampMNumberServer response time in milliseconds
dataMObjectTransaction data
orderNumMStringMerchant order number
platOrderNumMStringPlatform order number
amountMNumberAmount
feeMNumberFee
methodMStringPayment method (Thailand) — see Regional Payment Guide — Thailand
productDetailMStringProduct detail
customerNameMStringCustomer name
customerEmailMStringCustomer email
customerPhoneMStringCustomer phone
validTimeMNumberExpiry timestamp (ms)
cashierUrlMStringCashier URL
payDataMStringPay data
payDataTypeMStringPay 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)

FieldRequiredTypeDescription
Content-TypeMStringapplication/json

Notification Body

FieldRequiredTypeDescription
platOrderNumMStringPlatform order number
versionMStringAPI version, e.g. v1
orderNumMStringMerchant order number
amountMNumberAmount
feeMNumberFee
customerNameMStringCustomer name
customerEmailMStringCustomer email
customerPhoneMStringCustomer phone
statusMStringStatus — see Transaction Status Codes
signMStringCallback 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"
}