Repush Customs Declaration

Update Time:2025.01.07

If additional order information has been submitted to the customs but is lost in the electronic port, the customs declaration re-push API can be used to push the information to the customs again (the additional order information must be in the SUCCESS or EXCEPT state). For re-push, out_trade_no (merchant order No. upon payment) or transaction_id (WeChat Pay order No.) must be included. For a split order, sub_order_no (merchant sub-order No.) or sub_order_id (WeChat sub-order No.) must be included.


1. API Intro

Applicable object: Common mode Institutional mode

API rules:https://apihk.mch.weixin.qq.com/v3/global/customs/redeclare

Request method:POST

 

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.

2. Request Parameters

Name

Variable Name

Type

Required

Description

Institution APPID

appid

string[1,32]

Yes

Body Specifies Official Account ID assigned
by WeChat
Example: wxd678efh567hg6787

Merchant ID

mchid

string[1,32]

Yes

Body Specifies Merchant ID assigned by
WeChat Payment
Example: 1230000109

Merchant order No.

out_trade_no

string[1,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.
Example: 20150806125346

WeChat order No.

transaction_id

string[1,32]

Yes

Body Order No. returned by WeChat Pay
Example: 1000320306201511078440737890

Customs

customs

string[1,32]

Yes

Body Customs for declaration. For the enumerated values, refer to Parameter Specifications
Example: SHANGHAI_ZS

Merchant's customs registration No.

merchant_customs_no

string[1,32]

Yes

Body Customs registration No. of the merchant
Example: 123456

Merchant sub-order No.

sub_order_no

string[1,32]

No

Body Merchant sub-order No. It is required if there is a split order.
Example: 20150806125346

WeChat sub-order No.

sub_order_id

string[1,32]

No

Body For a non-split order, this field can be left blank. Otherwise, pass either sub_order_no or sub_order_id.
Example: 1000320306201511078440737891

Request Example:

JSON

1{
2  "appid": "wxd678efh567hg6787",
3   "mchid": "1230000109",
4   "out_trade_no": "20150806125346",
5   "transaction_id": "1000320306201511078440737890",
6   "sub_order_no": "20150806125346",
7   "sub_order_id": "1000320306201511078440737891",
8   "customs": "SHANGHAI_ZS",
9   "customs": "SHANGHAI_ZS",
10   "merchant_customs_no": "123456"
11}

3. Response Parameters

Response for successful request:

Name

Variable Name

Type

Required

Description

Institution APPID

appid

string[1,32]

Yes

Official Account ID assigned by WeChat
Example: wxd678efh567hg6787

Merchant ID

mchid

string[1,32]

Yes

Merchant ID assigned by WeChat Pay
Example: 1230000109

Declaration status

state

string[1,32]

Yes

Declaration result status code
PROCESSING:Declaration in process
UNDECLARED:Undeclared
SUBMITTED:Modified but not declared
SUCCESS:Declaration succeeded
FAIL:Declaration failed
EXCEPT:Exceptional customs API
Example: PROCESSING

Merchant order No.

out_trade_no

string[1,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.
Example: 20150806125346

WeChat order No.

transaction_id

string[1,32]

Yes

Order No. returned by WeChat Pay
Example: 1000320306201511078440737890

Merchant sub-order No.

sub_order_no

string[1,32]

No

Merchant sub-order No. It is required if there is a split order.
Example: 20150806125346

WeChat sub-order No.

sub_order_id

string[1,32]

No

WeChat sub-order No.
Example: 1000320306201511078440737891

Last update time

modify_time

string[1,32]

Yes

Last update time, which is obtained from the WeChat server.
Example: 2015-09-01T10:00:00+08:00

Description of declaration results

explanation

string[1,32]

No

Description of declaration results. The failure reason will be displayed in case of failure or exception.
Example: The payment order already exists and is in a non-refund status.0

Response for failed request:

Name

Variable Name

Type

Required

Description

Returned status code

code

string[1,32]

Yes

Error code. See the error code list for the enumerated values.

Returned information

message

string[1,256]

Yes

Returned message. It indicates the reason for the error if not empty.

Detailed error description

detail

object

No

It is returned when code is PARAM_ERROR. Details will be described below.

Detailed error description

Response Example:

SUCCESS

1{
2	"appid": "wxd678efh567hg6787",
3	 "mchid": "1230000109",
4	 "state": "SUBMITTED",
5	 "out_trade_no": "20150806125346",
6	 "transaction_id": "1000320306201511078440737890",
7	 "sub_order_no": "20150806125346",
8	 "sub_order_id": "20150806125346",
9	 "modify_time": "2015-09-01T10:00:00+08:00",
10	 "explanation": "The payment order already exists and is in a non-refund status.0"
11  }

ERROR

1{
2	"code": "INVALID_REQUEST",
3	"message": "Parameter format verification error",
4	"detail": {
5		"field": "#/properties/payer",
6		"value": "1346177081915535577",
7		"issue": "与ALLOF schema不符",
8		"location": "body"
9	}
10}

 

4. Error Codes

Error Message

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.

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.

 

 

About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2025 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global

Contact Us

Customer Service Tel

+86 571 95017

9:00-18:00 Monday-Friday GMT+8

Business Development

wxpayglobal@tencent.com

Developer Support

wepayTS@tencent.com

Wechat Pay Global

About Tenpay
Powered By Tencent & Tenpay Copyright© 2005-2025 Tenpay All Rights Reserved.