API REFERENCE
Query a customs declaration
Merchants query submitted customs declaration information using the order number.
| Parameter | Type | Description | Required |
|---|---|---|---|
| user | String | UID of the cashier or super administrator account | Required |
| sign | String | Signature | Required |
| method | String | v3.CustomDeclareQuery | Required |
| time | Long | Timestamp | Required |
- Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| trade_id | String | YabandPay transaction ID | Required |
| customs | String | Customs name | Required |
Signature example:
Sorted parameters concatenated into a URL-style query string
"customs=NINGBO&method=v3.CustomDeclareQuery&time=1560499094&trade_id=dd11d082-810d-c8b7-3669-b784c466759b&user=YOUR_CASHIER_UID"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.CustomDeclareQuery",
"time": 1560753647,
"data": {
"trade_id": "847b175e-f8f4-d362-d078-52092b412b1c",
"customs": "NINGBO"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"data": [
{
"customs": "NINGBO",
"duty": "",
"fee_type": "EUR",
"mch_customs_no": "31222699S7",
"modify_time": "2024-06-19T08:21:18Z",
"order_fee": "10",
"product_fee": "10",
"state": "SUCCESS",
"sub_order_id": "e0721a7f957e8e55dfbb5c7bcb4441d6",
"sub_order_no": "1234567890",
"transport_fee": "0",
"cert_check_result": "SAME"
},
{
"customs": "NINGBO",
"duty": "",
"fee_type": "EUR",
"mch_customs_no": "31222699S7",
"modify_time": "2024-06-19T08:20:53Z",
"order_fee": "10",
"product_fee": "10",
"state": "SUCCESS",
"sub_order_id": "05cbd13d104bb4ea542cc66550d16ac8",
"sub_order_no": "123456789",
"transport_fee": "0",
"cert_check_result": "SAME"
}
]
},
"message": ""
}
State statuses:
| Status | Description |
|---|---|
| UNDECLARED | Undeclared (the declaration has been submitted and is awaiting customs processing; no resubmission is needed) |
| SUBMITTED | Declaration submitted (this status is recorded when the order has been sent to customs, the merchant submits a new declaration, and customs provides a modification API) |
| PROCESSING | Declaration in progress |
| SUCCESS | Declaration successful |
| FAIL | Declaration failed |
| EXCEPT | Customs API error |
