Query Customs Declaration
Update Time:2025.02.20Merchants query additional order information submitted and declaration status by order No.
API intro
Request Url: https://apihk.mch.weixin.qq.com/global/v3/customs/orders
Request method: GET
Applicable object: Common 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.
Parameter Settings
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Institution APPID | appid | String(32) | Yes | query Specifies Official Account ID assigned |
Merchant ID | mchid | String(32) | Yes | query pecifies Merchant ID assigned by |
Order type | order_type | String(16) | Yes | query Select one of the four order types: out_trade_no - Merchant order No. |
Order No. | order_no | String(32) | Yes | query Specify an order No. depending on the selected order type. |
Customs | customs | String(32) | Yes | query Customs for declaration. For the enumerated values, refer to Parameter Specifications |
Offset | offset | int | No | query CA non-negative integer, which indicates the start position of requested resources, starting from 0. Optional. It is 0 by default. |
Maximum number of returned records | limit | int | No | query A positive integer, which indicates the maximum number of resource records that can be returned for this request. Optional. The suggested default value is 20. |
Return Data
Normal return
Name | Variable Name | Type | Required | Description | |||
---|---|---|---|---|---|---|---|
Institution APPID | appid | string(32) | Yes | Official Account ID assigned by WeChat | |||
Merchant ID | mchid | string(32) | Yes | Merchant ID assigned by WeChat Pay | |||
WeChat order No. | transaction_id | string(32) | Yes | Order No. returned by WeChat Pay | |||
Verification institution | verify_department | string(16) | Yes | Verification institution code | |||
Transaction ID from verification institution | verify_department_trade_id | string(64) | Yes | Transaction ID from the verification institution (such as UnionPay) for the merchant to register at the customs | |||
Offset | offset | int | Yes | The offset from which the resource records are returned for the request | |||
Maximum number of returned records | limit | int | Yes | The maximum number of returned records for the request | |||
Total number of query results | total_count | int | Yes | Total number of query results | |||
Customs declaration data packet | data | Array | Yes | Total number of query results | |||
|
Abnormal return
Name | Variable Name | Type | Required | Description | |||
---|---|---|---|---|---|---|---|
Return Status | return_code | String(32) | Yes | Error code. See the error code list for the enumerated values. | |||
Returned message | message | String(256) | Yes | Returned message. If not empty, it presents the cause of the error. | |||
Detailed error description | detail | Object | No | It is returned when code is PARAM_ERROR. Details will be described below | |||
|
Example:
Error Codes
Error Codes | Description | Solution |
---|---|---|
INVALID_REQUEST | No customs declaration for this order. | No declaration is made for this order. Make a declaration before a query. |
The specified record does not exist. Select a different query criterion. | The record to be queried does not exist. Make a query again by a different query criterion. | |
Customs information is not configured. | The customs declaration API is only accessible after the customs information has been configured for the merchant. Please configure the customs information by referring to the customs registration guidelines above. | |
NOAUTH | The merchant has not registered with the current customs | The merchant has not registered with the current customs. Try again after the registration is completed. |
Self-Clearance is not enabled. | Check whether the Self-Clearance tool has been enabled for the merchant ("WeChat Pay Merchants Platform" > "Product Center" > "Apply for Self-Clearance"). | |
PARAM_ERROR | Parameter error | Invalid parameter. The parameter may be incorrect or is missing. Check whether the API parameters have been summited as required. |
SYSTEMERROR | System error | Declare again, or contact WeChat Pay Assistant to find out the reason. |