Latest update time:2021.08.18 Release notes
The interface provides the query function of all WeChat Pay orders. Merchants can actively query the order status through the order query interface to complete the business logic of next step.
Circumstances when the query interface needs to be called:
• An exception is found with the merchant background, network, or server, and the merchant system does not receive the payment notification finally.
• After the deduction interface is called, a system error or unknown transaction status is returned.
Request Url:https://apihk.mch.weixin.qq.com/v3/global/papay/transactions/{transaction_id}
Request method:GET
API rules: https://wechatpay-api.gitbook.io/wechatpay-api-v3
Applicable object:Common modeInstitutional mode
path parameter is a path parameter.
query parameter needs to be passed in the request URL.
body parameter needs to be passed in the request JSON.
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Sub-merchant ID | sub_mchid | string[1,32] | Yes | query Sub-merchant ID allocated by WeChat Pay Note: Only forInstitutional mode Example:10000097 |
WeChat Pay order No. | transaction_id | string[1,32] | Yes | path WeChat Pay order No. Example:10000097 |
https://apihk.mch.weixin.qq.com/v3/global/papay/transactions/1217752501201407033233368018
Request Url:https://apihk.mch.weixin.qq.com/v3/global/papay/transactions/out-trade-no/{out_trade_no}
Request method:GET
API rules: https://wechatpay-api.gitbook.io/wechatpay-api-v3
Applicable object:Common modeInstitutional mode
path parameter is a path parameter.
query parameter needs to be passed in the request URL.
body parameter needs to be passed in the request JSON.
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Sub-merchant ID | sub_mchid | string[1,32] | Yes | body Sub-merchant ID allocated by WeChat Pay Note: Only forInstitutional mode Example:10000097 |
Merchant order No. | out_trade_no | string[1,32] | Yes | path Order No. inside the merchant system, which consists of 32 characters and can contain letters; to change the authorization code, you must replace the merchant order No. with a new one. For other information, please refer to Merchant order No. Example:1217752501201407033233368018 |
https://apihk.mch.weixin.qq.com/v3/global/papay/out-trade-no/1217752501201407033233368018
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Merchant ID | mchid | string[1,32] | Yes | Merchant ID allocated by WeChat Pay Note: Only forCommon mode Example:10000091 |
App ID | appid | string[1,32] | Yes | Appid bound to the merchant ID Note: Only forCommon mode Example:wxcbda96de0b165486 |
Merchant ID of the service provider | sp_mchid | string[1,32] | Yes | The institution's merchant ID allocated by WeChat Pay Note: Only forInstitutional mode Example:10000098 |
Sub-merchant ID | sub_mchid | string[1,32] | Yes | Sub-merchant ID allocated by WeChat Pay Note: Only forInstitutional mode Example:10000097 |
App ID of the service provider | sp_appid | string[1,32] | Yes | Appid bound to the service provider’s Official Account Note: Only forInstitutional mode Example:wxcbda96de0b165486 |
App ID of the sub-merchant | sub_appid | string[1,32] | No | Mini program appid of the sub-merchant who initiates the signing Note: Only forInstitutional mode Example:wxcbda96de0b165484 |
Merchant order No. | out_trade_no | string[1,32] | Yes | Returned merchant order No. Example:1217752501201407033233368018 |
WeChat Pay order No. | transaction_id | string[1,32] | Yes | WeChat Pay order No. Example:1217752501201407033233368018 |
Merchant data | attach | string[1,127] | No | Additional data, returned in the query API and payment notification without any changes; this field is used for the custom order data carried by the merchant Example:Custom data |
Transaction type | trade_type | string[1,16] | Yes | Deduction payment Example:AUTH |
Paying bank | bank_type | string[1,32] | No | Returned after successful payment. Bank type is a bank ID of string type. For the list of specific values, please refer to bank type CMC and other bank card types in the Chinese mainland WPHK: payment by Hong Kong Wallet WPHK_BPA: advance money by Hong Kong Wallet Example:WPHK |
Payment completion time | success_time | string[1,64] | No | Payment completion time, in the rfc3339 format, e.g., 2018-06-08T10:34:56+08:00 indicates 10:34:56 a.m. on June 8, 2018 of Beijing time Example:2018-06-08T10:34:56+08:00 |
Transaction state | trade_state | string[1,32] | Yes | SUCCESS — Payment success REFUND — Transfer to refund NOTPAY — Not paid CLOSED — Closed PAYERROR — Payment failed USERPAYING — payment in progress Example:SUCCESS |
Transaction state description | trade_state_desc | string[1,256] | Yes | Description of the current order status and guidance for the next operation Example:Payment failed. Please order again to make payment |
Merchant category code (MCC] | merchant_category_code | string[1,16] | Yes | Merchant category code Example:1011 |
+Payer | payer | object | No | Returned after successful payment. Payer information, which is detailed below |
+Order amount | amount | object | No | Returned after successful payment. Order amount information, which is detailed below |
+ Scene information | scene_info | object | No | Returned after successful payment. Scene information object, which is detailed below |
+Promotion function | promotion_detail | object | No | Returned after successful payment. Promotion function information, which is detailed below |
"promotion_detail": [{
"promotion_id": "109519",
"name": "单品惠-6",
"scope": "SINGLE",
"type": "DISCOUNT",
"amount": 1,
"currency": "HKD",
"activity_id": "931386",
"wechatpay_contribute_amount": 1,
"merchant_contribute_amount": 0,
"other_contribute_amount": 0,
"goods_detail": [{
"goods_id": "iphone6s_16G",
"goods_remark": "商品备注",
"quantity": 1,
"price": 528800
}]
}]
Customer Service Tel
Business Development
9:00-18:00
Monday-Friday GMT+8
Technical Support
WeChat Pay Global
ICP证