Login expired. Please log in again.

Feedback

0/300

Feedback

Submitted successfully

ok

Feedback

Network exception, please try again later

ok

Customs Declaration API

Latest update time:2020.06.02 Release notes


This API allows merchants to submit additional order information required by the customs.

Tips:

Here is the customs registration information of Tenpay, which is generally provided by the customs. If not, refer to the table below:


Tenpay's customs registration name: Tenpay Payment Technology Co., Ltd.

Tenpay's 10-digit customs registration No.: 4403169D3W


Payment order declaration rules:

1. If there is no split order, declare with the out_trade_no and transaction_id during payment and the CNY amount corresponding to the original payment order (if there is a partial refund, the refund amount shall be deducted).

2. For a split order, declare with sub_order_no transmitted by the declaration API, sub-order_id returned by the API, and the order_fee amount transmitted by the declaration API.

3. Judgment criteria for split order: The order is considered as a split one if the merchant transmits sub_order_no when the payment declaration API is called.


Identity information verification and declaration rules:

1. WeChat Pay can only push the payer information registered on the system to the customs, regardless of whether the identity information verification is consistent or not.

2. WeChat Pay will verify the information again when the merchant calls the modification API to upload new user identity information.


Note: Submit your customs information on the following page before requesting the API. All the customs information you need for declaration shall be submitted be true and valid: http://pay.weixin.qq.com/index.php/extend/customs

API intro

Request Url: https://apihk.mch.weixin.qq.com/global/v3/customs/orders

Request method:POST

API rules:https://wechatpay-api.gitbook.io/wechatpay-api-v3/

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
Example:wxd678efh567hg6787
Merchant ID mchid String(32) Yes body Specifies Merchant ID assigned by
WeChat Payment
Example:1230000109
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.
Example:20150806125346
WeChat order No. transaction_id String(32) Yes body Order No. returned by WeChat Pay
Example:1000320306201511078440737890
Customs customs String(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(32) Yes body Customs registration No. of the merchant
Example:123456
Tariff duty int No body Tariff (in 0.01 CNY). It is not required and will not be submitted to the customs.
Example:88
Merchant sub-order No. sub_order_no String(32) No body Merchant sub-order No. It is required if there is a split order.
Example:20150806125346
Currency type fee_type String(32) No body The currency used for order payment via WeChat Pay. Only CNY is currently supported. It is required if there is a split order.
Example:CNY
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
Example:888
Logistics fee transport_fee int No body Logistics fee (in 0.01 CNY). It is required if there is a split order.
Example:888
Product price product_fee int No body Product price (in 0.01 CNY). It is required if there is a split order.
Example:888

Example:


{
  "appid": "wxd678efh567hg6787",
  "mchid": "1230000109",
  "out_trade_no": "20150806125346",
  "transaction_id": "1000320306201511078440737890",
  "customs": "SHANGHAI_ZS",
  "merchant_customs_no": "123456",
  "duty": 888,
  "sub_order_no": "20150806125346",
  "fee_type": "CNY",
  "order_fee": 888,
  "transport_fee": 888,
  "product_fee": 888
}
                              

								 {
								 JAVA示例代码
								 }
                             

Return Data

Normal return

Name Variable Name Type Required Description
Institution APPID appid string(32) Yes Official Account ID assigned by WeChat
Example:wxd678efh567hg6787
Merchant ID mchid string(32) Yes Merchant ID assigned by WeChat Pay
Example:1230000109
Declaration status state string(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(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(32) Yes Order No. returned by WeChat Pay
Example:1000320306201511078440737890
Merchant sub-order No. sub_order_no string(32) No Merchant sub-order No., which is returned for a split order.
Example:20150806125346
WeChat sub-order No. sub_order_id string(32) No WeChat sub-order No., which is returned for a split order.
Example:20150806125346
Verification institution verify_department string(16) Yes Verification institution code
UNIONPAY:Unionpay
NETSUNION:NetsUnion
OTHERS:Others
Example:UNIONPAY
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
Example:2018112288340107038204310100000

Abnormal return

Name Variable Name Type Required Description
Return Status
Code
return_code String(32) Yes Error code. See the error code list for the enumerated values.
Example:INVALID_REQUEST
Returned message message String(256) Yes Returned message. If not empty, it presents the cause of the error.
Example:Parameter format verification error
+Detailed error description detail Object No It is returned when code is PARAM_ERROR. Details will be described below.
Name Variable Name Type Required Description
Field that indicates the incorrect parameter field string(256) Yes If the incorrect parameter is in the JSON for request body, the JSON Pointer pointing to this parameter is entered. If the incorrect parameter is in the request URL or querystring, the variable
Example:#/properties/payer
Value of the incorrect paramet value string(256) Yes Value of the incorrect parameter
Example:1346177081915535577
Cause of error issue string(256) Yes Cause of error
Example:Inconsistent with XXX
Location of the incorrect parameter location string(256) No body: The incorrect parameter is in the JSON for request body
url:The incorrect parameter is in the request URL.
query:The incorrect parameter is in the querystring of the request.
Example:body

Example:


  {
	"appid": "wxd678efh567hg6787",
	"mchid": "1230000109",
	"state": "PROCESSING",
	"out_trade_no": "20150806125346",
	"transaction_id": "1000320306201511078440737890",
	"sub_order_no": "20150806125346",
	"sub_order_id": "20150806125346",
	"verify_department": "UNIONPAY",
	"verify_department_trade_id": "2018112288340107038204310100000"
  }
                                

Release notes

close
V1.0
2020.06.02
1. Customs Declaration API released online

About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2024 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global