alipay.overseas.acquire.customs.query
Call this interface to query the custom declaration status.
Request
Service address
Environment | HTTPS request URL |
Production environment | |
Test environment |
Request parameters
Parameter | Description |
Basic parameter | |
service String | Interface name
|
partner String(16) | The partner ID that is assigned by Alipay to identify an Alipay account. The partner ID is composed of 16 digits and begins with 2088.
|
_input_charset String | The charset with which the request data are encoded. UTF-8 is supported.
|
sign_type String | Sign type. RSA, RSA2 and MD5 are supported. Use uppercase.
|
sign String | Sign value
|
Business parameter | |
out_request_nos String(329) | The merchant-side declaration request number to be requested, supports batch queries, multiple values are separated by English commas, and there are up to 10 declaration request numbers in one time. The length of each declaration request number ranges from 6 to 32 bits, without spaces before or after, and only the following types of characters are allowed to be passed: numbers, English letters, "_", "-", ":"
|
Response
Synchronous response
Parameter | Description |
Basic parameter | |
is_success String | Indicates whether the request succeeds or not, with a value of T for success and F for failure. Note: a successful request does not mean the business is accepted and processed successfully.
|
sign_type String | Sign type. RSA, RSA2 and MD5 are supported. Use uppercase.
|
sign String | Sign value
|
error String | Error code that is returned when the request is failed, to describe the request failure reason. For more information, see the Error Code section in this document.
|
Business parameter | |
result_code String(32) | Processing result of the request, with a value of SUCCESS to indicate the process is successful, or FAIL to indicate the process is failed.
|
not_found String | This field is returned when the business is processed successfully (result_code=SUCCESS), but unfound declaration request numbers exist. If multiple values are returned, they are separated by English commas.
|
detail_error_codeString(48) | Detailed error code, which describes the reason for not receiving a result_code of SUCCESS. If the response code of result_code is SUCCESS, this parameter is not returned. For more information about the value of detail_error_code, see the Business Error Code section.
|
detail_error_des String(64) | Explanation of the detailed error code. If result_code is SUCCESS, this parameter is not returned.
|
<customs_declare>Multiple declaration form information and xml nodes might exist. | |
out_request_no String(32) | The merchant-side declaration request number, corresponding to a certain declaration request number in the parameters
|
alipay_declare_noString(64) | The Alipay declaration serial number
|
trade_no String(64) | The payments document number pushed to customs by Alipay. For the split declaration request, this document number is not equal to the original transaction number of Alipay.
|
customs_place String(20) | The customs number
|
merchant_customs_code String(20) | The merchant customs recordation number.
|
merchant_customs_name String(256) | The merchant customs recordation name.
|
amount String(20) | The declaration amount in CNY, with the unit of Yuan and up to two digits after the decimal point.
|
is_split String(1) | T: Form-splitting F: Non form-splitting
|
sub_out_biz_no String(32) | The merchant sub order number. The merchant must specify this field when the form is split.
|
status String(10) | The current status of this declaration form. The value can be one of the following items:
|
memo String(256) | Transaction notes
|
last_modified_time String(20) | The last update time of status
|
customs_code String | After the declaration is launched, the result code in the customs returned receipt. The value can be one of the following items:
Note: Alipay returns the data as returned by the customs, and the parameter values are subject to the customs definition.
|
customs_info String | After the declaration is launched, the result description in the customs returned receipt.
|
customs_return_time String | After the declaration is launched, the receipt time returned by customs, with a format of yyyyMMddHHmmss.
|
Error codes
Error code | Description |
INVALID_PARAMETER | The parameter format is illegal, due to one of the following reasons: more than 350 characters, empty, a form number is empty, or a form number is more than 32 characters. |
MAX_OUT_REQUEST_NO_EXCEEDED | The number of declaration forms in a single request is more than 10. |
Samples
Request
https://intlmapi.alipay.com/gateway.do?service=alipay.overseas.acquire.customs.query&partner=208xxxxxxxxx6931&_input_charset=UTF-8&sign_type=MD5&out_request_nos=out_request_no_20190904_172900&sign=3f8cda0bddaf9b79d58cb1f0149affc9
Response
Synchronous response
A successful query return:
<?xml version="1.0" encoding="utf-8"?>
<alipay>
<is_success>T</is_success>
<request>
<param name="sign">eb9ece9d658e7a9671411d1b43b5750c</param>
<param name="_input_charset">UTF-8</param>
<param name="sign_type">MD5</param>
<param name="service">alipay.overseas.acquire.customs.query</param>
<param name="out_request_nos">487xxxxxxxxx3624,766xxxxxxxxx9532</param>
<param name="partner">208xxxxxxxxx6350</param>
</request>
<response>
<alipay>
<records>
<customs_declare>
<alipay_declare_no>201xxxxxxxxxxxxxxxxxxx5271</alipay_declare_no>
<amount>1.00</amount>
<is_split>T</is_split>
<sub_out_biz_no>999xxxxxxxx9999</sub_out_biz_no>
<customs_place>ZONGSHU</customs_place>
<last_modified_time>2015-10-15 14:24:56</last_modified_time>
<memo/>
<merchant_customs_code>code</merchant_customs_code>
<merchant_customs_name>1</merchant_customs_name>
<out_request_no>487xxxxxxxxx3624</out_request_no>
<status>succ</status>
<trade_no>201xxxxxxxxxxxxxxxxxx5271</trade_no>
<customs_code>2</customs_code>
<customs_info> Adding Declaration Successful [B0B2F23E-2CF6-434D-9F24-8931B835A056]</customs_info>
<customs_return_time>201xxxxxxx2358</customs_return_time>
</customs_declare>
<customs_declare>
<alipay_declare_no>201xxxxxxxxxxxxxxxxxx6255</alipay_declare_no>
<amount>1.00</amount>
<customs_place>henan</customs_place>
<last_modified_time>2015-10-15 14:24:56</last_modified_time>
<memo/>
<merchant_customs_code>code</merchant_customs_code>
<merchant_customs_name>name</merchant_customs_name>
<out_request_no>766xxxxxxxxx9532</out_request_no>
<status>succ</status>
<trade_no>201xxxxxxxxx0237</trade_no>
<customs_code>2</customs_code>
<customs_info> Adding Declaration Successful [B0B2F23E-2CF6-434D-9F24-8931B835A056]</customs_info>
<customs_return_time>201xxxxxxx2358</customs_return_time>
</customs_declare>
</records>
<result_code>SUCCESS</result_code>
</alipay>
</response>
<sign>15669c65f3d19d0691425bba349a8b55</sign>
<sign_type>MD5</sign_type>
</alipay>
When the request is successful, but the business processing fails:
<?xml version="1.0" encoding="utf-8"?>
<alipay>
<is_success>T</is_success>
<request>
<param name="sign">48201072f0d0991c3bab798d963c6cd8</param>
<param name="_input_charset">UTF-8</param>
<param name="sign_type">MD5</param>
<param name="service">alipay.overseas.acquire.customs.query</param>
<param name="out_request_nos">487xxxxxxxxx3624,766xxxxxxxxx9532,,</param>
<param name="partner">208xxxxxxxxx6350</param>
</request>
<response>
<alipay>
<detail_error_code>INVALID_PARAMETER</detail_error_code>
<detail_error_des> Declaration Form Parameters Illegal </detail_error_des>
<result_code>FAIL</result_code>
</alipay>
</response>
<sign>48fd2067e7fa2a7e779465d9e80dced5</sign>
<sign_type>MD5</sign_type>
</alipay>
When the request is failed or the accessed data are incorrect:
<?xml version="1.0" encoding="utf-8"?>
<alipay>
<is_success>F</is_success>
<error>ILLEGAL_SIGN</error>
</alipay>