Request parameters are the request data provided to Alipay when merchants are exchanging data with Alipay, in order for Alipay to carry out further processing based on these data.
Parameter | Type (byte length) | Parameter Description | Null or Not | Examples |
Basic Parameters | ||||
service | String | The interface name | Not Null | alipay.overseas.acquire.customs.query |
partner | String(16) | The unique Alipay user ID corresponding to the signed Alipay account. The 16-bit pure number started with 2088. | Not Null | 2088101568338364 |
_input_charset | String | The encoding formats used by the merchant websites, such as utf-8, gbk, gb2312, etc. | Not Null | UTF-8 |
sign_type | String | The three optional values are DSA, RSA, and MD5, which must be capitalized. | Not Null | MD5 |
sign | String | Please refer to "Appendix: Signature and Signature Verfication" of this document. | Not Null | b7baf9af3c91b37bef4261849aa76281 |
Business Parameters | ||||
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, "_", "-", ":" | Not Null | 201506010001,201506010002,201506010003 |
https://mapi.alipay.com/gateway.do?out_request_nos=201506010001%2C201506010002%2C201506010003&sign_type=MD5&sign=b7baf9af3c91b37bef4261849aa76281&_input_charset=UTF-8&service=alipay.overseas.acquire.customs.query&partner=2088101568338364
Description:
This sample is for reference only, and the gateway of Alipay ishttps://mapi.alipay.com/gateway.do.
After Alipay processes the request data provided by the merchant, it will return the result data in order for the merchant to carry out further processing based on these data.
The returned results are divided into two scenarios, one is the result from normally accepted business, and another is system-level exception or accessed data errors. For the normally accepted business, the merchants need to parse the response code to determine whether the business is successfully processed.
Parameter | Type (Length Range) | Parameter Description | Null or Not | Examples |
Basic Parameters | ||||
is_success | String |
Whether the request is successful. A successful request doesn't mean the business has been processed successfully.
|
Not Null | T |
sign_type | String | The three optional values are DSA, RSA, and MD5, which must be capitalized. | Nullable | MD5 |
sign | String | Please refer to "Appendix: Signature and Signature Verification" of this document. | Nullable | 3afc92ac4708425ab74ecb2c4e58ef56 |
error | String |
|
Nullable | ILLEGAL_SIGN |
Business Parameters | ||||
result_code | String(32) |
The response code of processing results.
|
Not Null | SUCCESS |
not_found | String | The business is processed successfully (result_code=SUCCESS), but there are unfound declaration request numbers, then this parameter can be returned, and multiple values are separated by English commas. | Nullable | 201506010001 |
detail_error_code | String(48) | The cause description to returned response code, please refer to Business Error Codes. When the result_code response code is SUCCESS, this parameter will not be returned. | Nullable | INVALID_PARAMETER |
detail_error_des | String(64) | The textual description to detailed error code, please refer to the meanings in Business Error Codes. When the result_code response code is SUCCESS, this parameter will not be returned. | Nullable | Declaration Form Parameters Illegal |
<customs_declare>There may exist multiple declaration form information, and xml nodes | ||||
out_request_no | String(32) | The merchant-side declaration request number, corresponding to a certain declaration request number in the parameters | Nullable | 4877067126133624 |
alipay_declare_no | String(64) | The Alipay declaration serial number. | Nullable | 2015082011082370647505271 |
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 | Nullable | 2015082011082370647505271 |
customs_place | String(20) | The customs number. | Nullable | hangzhou |
merchant_customs_code | String(20) | The merchant customs recordation number. | Nullable | code |
merchant_customs_name | String(256) | The merchant customs recordation name. | Nullable | 1 |
amount | String(20) | The declaration amount, with the unit RMB "Yuan", up to two digits after the decimal point. | Nullable | 1.00 |
is_split | String(1) |
|
Nullable | T |
sub_out_biz_no | String(32) | The merchant sub order number. It is passed during form splitting by the merchant and must be passed during form splitting. | Nullable | 999999999999999 |
status | String(10) |
The current status of this declaration form.
|
Nullable | succ |
memo | String(256) | The notes. | Nullable | The customs returned parameters is illegal |
last_modified_time | String(20) | The last update time of status. | Nullable | 10/15/2015 2:24:56 PM |
customs_code | String |
After the declaration is launched, the result code in the customs returned receipt.
|
Nullable | 2 |
customs_info | String | After the declaration is launched, the result description in the customs returned receipt. | Nullable | Adding Declaration Successful [B0B2F23E-2CF6-434D-9F24-8931B835A056] |
customs_return_time | String | After the declaration is launched, the receipt time returned by customs, with the format: yyyyMMddHHmmss. | Nullable | 20160414142358 |
Description:
The synchronously returned parameters may return more nodes with the evolution of the Alipay service side, which requires the program users to ignore the nodes outside the document description.
Example of 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">4877067126133624,7665166179649532</param>
<param name="partner">2088101143686350</param>
</request>
<response>
<alipay>
<records>
<customs_declare>
<alipay_declare_no>2015082011082370647505271</alipay_declare_no>
<amount>1.00</amount>
<is_split>T</is_split>
<sub_out_biz_no>999999999999999</sub_out_biz_no>
<customs_place>hangzhou</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>4877067126133624</out_request_no>
<status>succ</status>
<trade_no>2015082011082370647505271</trade_no>
<customs_code>2</customs_code>
<customs_info> Adding Declaration Successful [B0B2F23E-2CF6-434D-9F24-8931B835A056]</customs_info>
<customs_return_time>20160414142358</customs_return_time>
</customs_declare>
<customs_declare>
<alipay_declare_no>2015081811082379147506255</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>7665166179649532</out_request_no>
<status>succ</status>
<trade_no>2015081710650237</trade_no>
<customs_code>2</customs_code>
<customs_info> Adding Declaration Successful [B0B2F23E-2CF6-434D-9F24-8931B835A056]</customs_info>
<customs_return_time>20160414142358</customs_return_time>
</customs_declare>
</records>
<result_code>SUCCESS</result_code>
</alipay>
</response>
<sign>15669c65f3d19d0691425bba349a8b55</sign>
<sign_type>MD5</sign_type>
</alipay>
Example of when a 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">4877067126133624,7665166179649532,,</param>
<param name="partner">2088101143686350</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>
Example of when a request is failed or the accessed data is incorrect:
<?xml version="1.0" encoding="utf-8"?>
<alipay>
<is_success>F</is_success>
<error>ILLEGAL_SIGN</error>
</alipay>
Detailed Error Code (detail_error_code) | Meaning (detail_error_des) |
---|---|
INVALID_PARAMETER | The parameter format is illegal: 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 |