Modify Customs Declaration Info
Update Time:2025.02.20This API allows merchants to modify additional order information.
|
API intro
Request Url: https://apihk.mch.weixin.qq.com/global/v3/customs/orders
Request method: PATCH
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.
Request Parameters
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Institution APPID | appid | String(32) | Yes | body Specifies Official Account ID assigned by WeChat |
Merchant ID | mchid | String(32) | Yes | body Specifies Merchant ID assigned by WeChat Payment |
Merchant order No. | out_trade_no | String(32) | Yes | body internal order No. of the merchant system. Should be within 32 characters and can only contain numbers, uppercase and lowercase letters, and _-|*@. It is unique for a merchant ID. |
WeChat order No. | transaction_id | String(32) | Yes | body Order No. returned by WeChat Pay |
Customs | customs | String(32) | Yes | body Customs for declaration. For the enumerated values, refer to Parameter Specifications |
Merchant's customs registration No. | merchant_customs_no | String(32) | Yes | body Customs registration No. of the merchant |
Tariff | duty | int | No | body Tariff (in 0.01 CNY). It is not required and will not be submitted to the customs. |
Merchant sub-order No. | sub_order_no | String(32) | No | body Merchant sub-order No. It is required if there is a split order. |
Sub-order amount | order_fee | int | No | body Sub-order amount (in 0.01 CNY). Cannot exceed the original order amount. order\_fee=transport_fee+product_fee (payable amount = logistics fee + product price). It is required if there is a split order |
Logistics fee | transport_fee | int | No | body Logistics fee (in 0.01 CNY). It is required if there is a split order. |
Product price | product_fee | int | No | body Product price (in 0.01 CNY). It is required if there is a split order. |
Example:
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 |
Declaration status | state | string(32) | Yes | Declaration result status code |
Merchant order No. | out_trade_no | string(32) | Yes | internal order No. of the merchant system. Should be within 32 characters and can only contain numbers, uppercase and lowercase letters, and _-|*@. It is unique for a merchant ID. |
WeChat order No. | transaction_id | string(32) | Yes | Order No. returned by WeChat Pay |
Merchant sub-order No. | sub_order_no | string(32) | No | Merchant sub-order No., which is returned for a split order. |
WeChat sub-order No. | sub_order_id | string(32) | No | WeChat sub-order No., which is returned for a split order. |
Last update time | modify_time | string(32) | No | Last update time, which is obtained from the WeChat server. |
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 |
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 | Customs declaration record does not exist. | The customs declaration record does not exist. Please apply again or contact WeChat Pay Assistant to find out the reason. |
Declaration is in process for the payment order. You cannot modify the declaration information. | support modifying the information of a payment order that is in the process of declaration. You can modify the payment order information using the modification API after the declaration is completed. | |
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. | |
Order amount does not match. | The order amount for declaration must be same as the payment amount. Check whether the order amount for declaration is correct. | |
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 | Currency is not set. | Currency is required for split declaration. Check whether fee_type is empty. |
Transaction currency is different from merchant's settlement currency. | Check whether the currency parameter (fee_type) is empty | |
Parameter error | Invalid parameter. The parameter may be incorrect or is missing. Check whether the API parameters have been summited as required. | |
Incorrect order amount | The order amount is different from the payment order amount. Make a check and declare again. | |
Incorrect transaction order information | The transaction order information is incorrect. Make a check and declare again. | |
Merchant's split declaration amount is incorrect. | The merchant's split order amount is greater than the amount of the original payment order. Make a check and declare again. | |
Transaction currency is different from merchant's settlement currency. | Declare again, or contact WeChat Pay Assistant to find out the reason | |
Missing parameters in split declaration. | Parameters fee_type, order_fee, transport_fee, and product_fee are required for split order. | |
SYSTEMERROR | System error | Declare again, or contact WeChat Pay Assistant to find out the reason. |