Gateway Order Query
API method
URL |
|
Method |
POST |
Parameter organization format |
application/x-www-form-urlencoded |
Gateway Order Query Request Parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
sign |
String(256) |
YES |
b000e9b6ec3fbda482d96a3d7c75c6956a5864336c3098462525e7229e8e046e490939a3e8b320a6c68eb63795a25b79d8c74f042f0972039bb5fe9b861cefb4 |
Digital signature for verifying the authenticity of digital messages. Please check how to got Signature Algorithm page |
appid |
String(32) |
YES |
mch35000 |
Your Merchant Number. Check on how to find your appid/Merchant No.. The format is mch{Merchant No}. |
nonce_str |
String(32) |
YES |
Random string, must be unique |
|
time_stamp |
String(256) |
YES |
time stamp example: "time_stamp": "20190622131804" |
|
mch_order_no |
String(32) |
YES |
order number on merchant side, must be unique |
|
{
"appid": "mch32625",
"mch_order_no": "33663431",
"nonce_str": "d2b4874c75fca3d7c637bee971ede6ac",
"sign": "6aa39ba2ab6ac60df6223b0604a1fffe62280d33accb6d91a2dceea6648c04b8117d5b33f5f348d21adcc47f1f63faae8fd77b6800e476bf92d5ad45488cdadc",
"time_stamp": "2020041421583131S"
}
Gateway Order Query SUCCESS Response Parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
code |
int |
YES |
0 |
code msg 0 SUCCESS |
lang |
String(256) |
YES |
The display languange.The default language is English if no specification.Value range: * "en":----English * "cn":----Chinese * "th":----Thai |
|
result |
string(16) |
YES |
FAIL |
Value Range: FAIL/SUCCESS/CLOSED/NOTPAY/PAYERROR/PENDING/NOTSURE/USERPAYING/REFUND
|
message |
String(128) |
Detailed description of result |
||
msg |
String(128) |
YES |
system error |
the detailed description of the error |
data |
JSON |
|||
data parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
appid |
String(32) |
YES |
mch35000 |
Your Merchant Number. Check on how to find your appid/Merchant No.. The format is mch{Merchant No}. |
attach |
String(Eng ≤ 2048 characters, Thai/CN ≤ 682 characters) |
YES |
e-wallet local currency total amount, unit is cent. |
|
cash_fee_type |
String |
YES |
THB |
e-wallet local currency, e.g. THB for Thailand e-wallets, CNY for Chinese e-wallets Alipay, WeChat Pay. |
channel |
String(16) |
YES |
alipay |
Actual payment e-wallet channel.Value range: alipay, linepay, airpay, wechat, promptpay, truemoney. |
channel_order_no |
String(32) |
Conditional |
e-wallet order number. Only response with result "SUCCESS" and "REFUND". |
|
fee_type |
String(16) |
YES |
THB |
Currency code for total_fee. refer to with ISO 4217. Value range: THB: Thai Baht use for Thailand. MYR: Malaysia JPY: Japan AED: United Arab Emirates dirham use for UAE. |
pay_mch_order_no |
String(32) |
YES |
4200000553202004150354623931 |
Gateway Pay unique order number |
ksher_order_no |
String(32) |
YES |
merchant Order number, must be unique. |
|
nonce_str |
String(32) |
YES |
Random string. |
|
openid |
String(128) |
NO |
Customer’s id under this merchant’s public account. |
|
payer_name |
String(128) |
NO |
ร.ท. ทดสอบหนึ่งร้อยเจ็ด คอนแทคเซ็นเตอร์สาม |
supported only for PromptPay transactions. The system will display the payer name based on the information received from the originating bank. For transactions where the payer is a foreign customer or for certain Wallet transactions, the payer name may or may not be provided by the originating bank. If the originating bank does not provide the payer name, the system will return "payer_name": "". |
rate |
String(16) |
YES |
Exchange rate of foreign currency to RMB. |
|
result |
String(16) |
YES |
Value Range:FAIL/SUCCESS/NOTPAY/CLOSED/PAYERROR/REFUND
|
|
time_end |
String(20) |
2020-04-15 09:49:19 |
Payment success time |
|
total_fee |
Int |
YES |
total amount of the order and it must be an integer, the unit is cent |
|
{
"code": 0,
"data": {
"appid": "mch32625",
"attach": "",
"cash_fee": 21,
"cash_fee_type": "CNY",
"channel": "wechat",
"channel_order_no": "4200000553202004150354623931",
"fee_type": "THB",
"pay_mch_order_no": "2004150948529843",
"ksher_order_no": "90020200415104909426008",
"mch_order_no": "77713",
"nonce_str": "UHl8XNywZjdMrpsWCNy00gOYbspYzH7Z",
"openid": "o2G4c04tmsU-wsCG7jN_ORL5Vh14",
"rate": "0.222657",
"result": "SUCCESS",
"time_end": "2020-04-15 09:49:19",
"total_fee": 100
},
"lang": "",
"message": "操作成功",
"msg": "操作成功",
"sign": "a19fb42985cbf2ce81e74a1e2aa7fdaf42d33234b3f5d9a3ce9230d1cabc2796abd05c6b00951c6c33f557410d029853bf70d99af32cae858f1484412309f242"
}
or
{
"code": 0,
"msg": "操作成功",
"data": {
"channel": "card",
"openid": "card_test_20817e183994b76025bd7c369d76eb718b619",
"channel_order_no": "chrg_test_20817a7a1c4765a2644bc96c72a7fdfd50bb3",
"cash_fee_type": "THB",
"ksher_order_no": "70020250326113912985299",
"nonce_str": "121f231c887ed8513b6b146ea6fdcbe4",
"time_end": "2025-03-26 10:39:15",
"fee_type": "THB",
"attach": "",
"rate": "1.000000",
"result": "SUCCESS",
"total_fee": 100,
"appid": "mch30057",
"cash_fee": 100,
"mch_order_no": "202503261032",
"pay_mch_order_no": "2503261038485421",
"card_no": "543128*****5031"
},
"sign": "b5a0d8b06beea594fed63b7530e7932f02869b515476813128de07cca890957ea4c9c3d320b2e5c68fd5cd58d69202cc7c5d03b4e36d2918180458d93edc1c6e",
"message": "操作成功"
}
or (PromptPay with payer_name)
{
"code": 0,
"msg": "操作成功",
"data": {
"channel": "promptpay",
"openid": "",
"channel_order_no": "",
"cash_fee_type": "THB",
"ksher_order_no": "70020260904120603981893",
"nonce_str": "CSWI5JiiTIrXYc9BtXEzaehQ2WPQCKlf",
"time_end": "2026-09-04 11:27:16",
"fee_type": "THB",
"attach": "pay_name3",
"rate": "1.000000",
"result": "SUCCESS",
"total_fee": 15000,
"appid": "mch30057",
"cash_fee": 15000,
"mch_order_no": "1788494751",
"pay_mch_order_no": "2609041105514885",
"payer_name": "ร.ท. ทดสอบหนึ่งร้อยเจ็ด คอนแทคเซ็นเตอร์สาม"
},
"sign": "42b0b52e7f4da7c34d895c4dfdf78f4517293f19eafb2f9c70d1873883c9996be3ae4",
"message": "操作成功"
}
Gateway Order Query Fail Response Parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
code |
int |
YES |
0 |
code msg * -1: merchant info error * -2: sign failed to verify * -3: order not exist * -4: order number is not unique * -100: query order failed |
lang |
String(256) |
YES |
The default language is English if no specification. Value range: * "en":----English * "cn":----Chinese * "th":----Thai |
|
message |
String(128) |
Detailed description of result |
||
msg |
String(128) |
YES |
system error |
the detailed description of the error |
{'lang': '', 'code': -3, 'msg': '该订单不存在', 'message': '该订单不存在'}