Create Customs Declare


This interface is to submit customs declaration for orders paid by WeChat Pay or Alipay

[!TIP|style:flat] 1.Each order can only have one piece of non-split data and multiple pieces of split order data. If the sub_order_no (merchant sub-order number) in the split order data is the same, it will be regarded as the same piece of data.

2.If you need to modify the customs declaration,please pass MODIFY for action_type, and you can only modify the merchant record number, record name, customs code and amount, users certificate information.If it is split order data, please pass sub_order_no to modify the date.

If a transaction has been requested to be submitted to the customs, but the electronic port has lost the order, you can use the re-push interface. When re-push the order, please keep the customs declaration number consistent with the original request.

API URL:https://mapi.yabandpay.com/Payments

Method:POST

POST data type:Json

Parameter Type Description Required
user String the UID of super admin account or cashier account Required
sign String signature Required
method String v3.QueryOrder Required
time Long timestamp Required
  • Parameter
Parameter Type Description Required
trade_id String the trade_id from YabandPay Required
customs String customs name Required
mch_customs_no String customs record number Required
duty Int Customs duty, unit (cents), will not be submitted to custom Required
action_type String Customs declaration type, ADD added, MODIFY modified, default ADD added Required
sub_order_no String Merchant sub-order number Optional (required when splitting the order)
order_fee Int Amount in settlement currency, Unit (point), cannot exceed the original order amount,order_fee=transport_fee+product_fee Optional (required when splitting the order)
transport_fee Int Logistics costs in settlement currency, Unit (point) Optional (required when splitting the order)
product_fee Int product price in settlement currency,Unit (point) Optional (required when splitting the order)
cert_type String ID type, please pass the fixed value of IDCARD, temporarily only supports mainland ID cards Optional
cert_id String ID number, the user's mainland ID number, the ID number ending with the letter X, please capitalize the letter X Optional
name String consumer name Optional

The customs fields are as follows:

Wechat Pay fields

字段 描述
GUANGZHOU_ZS Guangzhou (General Administration Edition)
GUANGZHOU_HP_GJ Guangzhou Huangpu National Inspection
GUANGZHOU_NS_GJ Guangzhou Nansha National Inspection
HANGZHOU_ZS Hangzhou (General Administration Edition)
NINGBO Ningbo
ZHENGZHOU_BS Zhengzhou (bonded logistics center)
CHONGQING Chongqing
SHANGHAI_ZS Shanghai (General Administration Edition)
SHENZHEN Shenzhen
ZHENGZHOU_ZH_ZS Zhengzhou Comprehensive Insurance (General Administration Edition)
TIANJIN Tianjin

TIANJIN (When you need to push orders to Tianjin Customs, you need to configure both Tianjin Customs filing information and Tianjin National Inspection filing information in the merchant management background; when calling the customs declaration interface, you only need to push Tianjin Customs, that is, request the customs declaration interface once.)

Alipay fields

字段 描述
ZONGSHU 中国海关总署
ZHENGZHOU 郑州
NINGBO 宁波
SHANGHAI_CBT 上海

Signature:

Lexicographical sequence and URL key-value format new string

"customs=NINGBO&mch_customs_no=8888888888&method=v3.CustomDeclareOrder&time=1560499094&trade_id=dd11d082-810d-c8b7-3669-b784c466759b&user=016683"

Use stringA and secret_key to get stringSign

Get Signature:

"0c4f56b21229ec6212c83d936154954a71bbd5c8b5d2c94a231928e9903632dd"

Example Request:

{
    "user": "016683",
    "sign": "0c4f56b21229ec6212c83d936154954a71bbd5c8b5d2c94a231928e9903632dd",
    "method": "v3.CustomDeclareOrder",
    "time": 1560499094,
    "data": {
        "trade_id": "dd11d082-810d-c8b7-3669-b784c466759b",
        "customs": "NINGBO",
        "mch_customs_no": "8888888888"
    }
}

Example Response:

{
    "status": true,
    "code": "200",
    "data": {
        "appid": "",
        "return_code":"SUCCESS",
        "result_code":"SUCCESS",
        "mchid": "3302462090",
        "out_trade_no": "4434a6e235e81cde4aee954c0031ad96",
        "state": "SUCCESS",
        "sub_order_id": "e0721a7f957e8e55dfbb5c7bcb4441d6",
        "sub_order_no": "1234567890",
        "transaction_id": "2024061922001467961423939655",
        "verify_department": "OTHERS",
        "verify_department_trade_id": "2024061922001467961423939655",
        "cert_check_result": "SAME", 
        "transId": "20240619161756813048",
        "customs_declarations_id": "e0721a7f957e8e55dfbb5c7bcb4441d6"
    },
    "message": ""
}

The states description is as follows:

States Description
UNDECLARED Undeclared, this means that the declaration has been submitted, waiting for customs processing, no need to submit again.
SUBMITTED The declaration has been submitted. The order has been sent to the customs, the merchant has re-declared, and the customs has a modification interface, then the status of the record will be this.
PROCESSING Reporting
SUCCESS Successful application
FAIL Declaration failed
EXCEPT Customs interface exception

results matching ""

    No results matching ""