alipay.acquire.overseas.query
Call this interface to query the transaction with partner_trans_id or alipay_trans_id.
Request
Service address
Environment | HTTPS request URL |
Production environment | |
Test environment |
Request parameters
Parameter | Description |
Basic parameter | |
service String Required | Interface name
|
sign String Required | Sign value
|
sign_type String Required | Sign type. RSA, RSA2 and MD5 are supported. Use uppercase.
|
partner String(16) Required | 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. Example:2088*********662 |
_input_charset String | The charset with which the request data is encoded. The default value is GBK. UTF-8 is supported.
|
Operation parameter | |
partner_trans_id String(64) Required | The original partner transaction ID given in the payment request
|
alipay_trans_id String(64) | The transaction ID assigned by Alipay for the partner’s payment request, which follows a mapping relation with the partner field plus the partner_trans_id field.
|
Note:
Do not use the halfwidth quotation mark (") in parameter values.
Response
Parameter | Description |
is_success String(1) Required | Indicates whether the request is accepted by the Alipay gateway. T: accepted F: rejected
|
sign_type String Required | Sign type. RSA, RSA2 and MD5 are supported. Use uppercase.
|
sign String(32) Required | Sign value
|
payment_inst String(32) Required | This parameter identifies the wallet type with a value of ALIPAYCN or ALIPAYHK.
|
result_code String(32) Required | Processing result of the request, with a value of SUCCESS to indicate the process is successful, or FAIL to indicate the process is failed.
|
error String(48) | Error code that is returned when the request is not successful, to describe the request failure reason. This field is not returned when result_code is SUCCESS. For more information, see the Error Code section in this document.
|
alipay_trans_status String(32) | Transaction status. See Trade status for details.
|
alipay_buyer_login_id String(20) | Alipay login ID of the buyer, which can be an email address or mobile number. The ID is partially masked for privacy.
|
alipay_buyer_user_id String(16) Required | The unique ID for each Alipay account, which starts with 2088.
|
partner_trans_id String(64) Required | Equal to the partner_trans_id field given in the request
|
alipay_trans_id String(64) | The transaction ID assigned by Alipay for the partner’s payment request, which follows a mapping relation with the partner field plus the partner_trans_id field.
|
alipay_pay_time String(16) | The time that the transaction was paid, which is in a format of YYYYMMDDHHMMSS.
|
currency String(8) Required | The currency used for labeling the price of the transaction
|
trans_amount Number(11,2) | The transaction amount in the currency given above. Range: 0.01-100000000.00. Two digits after decimal point.
|
m_discount_forex_amount Number(9,2) | If coupons/vouchers are used in the transaction, the discount amount redeened in the settlement currency will be returned. Otherwise, no return.
|
Parameters rejected by Alipay gateway:
Parameter | Description |
is_success String(1) | Indicates whether the request is accepted by the Alipay gateway. T: accepted F: rejected
|
sign_type String | Sign type. RSA, RSA2 and MD5 are supported. Use uppercase.
|
sign String(32) | Sign value
|
detail_error_code String(48) | Detailed error code, which describes the reason for the response code returned. If the response code of result_code is SUCCESS, this parameter is not returned.
|
detail_error_des String(48) | Explanation of the detailed error code. If result_code is SUCCESS, this parameter is not returned.
|
Error codes
Error code | Description |
SYSTEM_ERROR | Alipay system is currently not available. Try again later. |
ILLEGAL_SIGN | Illegal signature. Use a legal signature and try again. |
INVALID_PARAMETER | Parameter value error. Check the standard of each request parameter according to the API speficaition |
ILLEGAL_ARGUMENT | Parameter name error. Check each request parameter according to the API specification. Contact Alipay technical support if this error persists |
ILLEGAL_PARTNER | Incorrect partner ID. Ensure that the value of partner parameter matches the partner value provided by Alipay. Contact Alipay technical support if this error persists. |
ILLEGAL_EXTERFACE | Interface configure error. Ensure that the service parameter has the same value with the one in API specification. Contact Alipay technical support if this error persists. |
ILLEGAL_PARTNER_EXTERFACE | Partner ID do not have access privilege. Contact Alipay technical support. |
ILLEGAL_SIGN_TYPE | Illegal sign type. Ensure that the value of sign_type is MD5,RSA or RSA2. Contact Alipay technical support if this error persists |
HAS_NO_PRIVILEGE | Has no privilege. Contact Alipay technical support. |
REASON_TRADE_BEEN_FREEZEN | Corresponding trade is been frozen due to security issues. Contact Alipay technical support. |
TRADE_NOT_EXIST | Cannot find corresponding trade according to the value of partner_trans_id. Ensure the partner_trans_id is correct. Contact Alipay technical support |
Samples
Request
Request sample with the partner_trans_id field specified:
https://intlmapi.alipay.com/gateway.do?service=alipay.acquire.overseas.query&sign_type=MD5&partner=208xxxxxxxxx5500&_input_charset=UTF-8&partner_trans_id=partner_trans_id_2019010_000035&sign=8e83b4cf23d88c08518de914cc36f522
Request sample with the alipay_trans_id field specified:
https://intlmapi.alipay.com/gateway.do?service=alipay.acquire.overseas.query&sign_type=MD5&partner=208xxxxxxxxx5500&_input_charset=UTF-8&alipay_trans_id=2019091022001414270571637760&sign=dfe37d7737e59cedc5bb094b404d815a
Response
Request succeeds:
<alipay>
<is_success>T</is_success>
<request>
<param name="alipay_trans_id">201xxxxxxxxxxxxxxxxxxxxx7760</param>
<param name="partner">208xxxxxxxxx5500</param>
<param name="service">alipay.acquire.overseas.query</param>
<param name="_input_charset">UTF-8</param>
<param name="sign">dfe37d7737e59cedc5bb094b404d815a</param>
<param name="sign_type">MD5</param>
</request>
<response>
<alipay>
<alipay_buyer_login_id>852-****4034</alipay_buyer_login_id>
<alipay_buyer_user_id>208xxxxxxxxx4270</alipay_buyer_user_id>
<alipay_pay_time>20190910162208</alipay_pay_time>
<alipay_trans_id>201xxxxxxxxxxxxxxxxxxxxx7760</alipay_trans_id>
<alipay_trans_status>TRADE_SUCCESS</alipay_trans_status>
<currency>HKD</currency>
<partner_trans_id>partner_trans_id_2019010_000035</partner_trans_id>
<payment_inst>ALIPAYHK</payment_inst>
<result_code>SUCCESS</result_code>
<trans_amount>0.01</trans_amount>
</alipay>
</response>
<sign>873af602af89572f4104251f762b861e</sign>
<sign_type>MD5</sign_type>
</alipay>
Request is failed:
<?xml version="1.0" encoding="UTF-8"?>
<alipay>
<is_success>F</is_success>
<error>ILLEGAL_SIGN</error>
<sign>02f6b289c46b8d0c1ea62b4f78637c1a</sign>
<sign_type>MD5</sign_type>
</alipay>