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

https://intlmapi.alipay.com/gateway.do

Test environment

https://mapi.alipaydev.com/gateway.do

Request parameters

ParameterDescription
Basic parameter
service

String Required

Interface name

Example:alipay.acquire.overseas.query

sign

String Required

Sign value

Example:c8il4epm90wyn768fijgqhy8tay37gqa

sign_type

String Required

Sign type. RSA, RSA2 and MD5 are supported. Use uppercase. 

Example:MD5

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.

Example:UTF-8

Operation parameter
partner_trans_id

String(64) Required

The original partner transaction ID given in the payment request

Example:2010121000000002

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.

Example:201311221703338463

Note:

Do not use the halfwidth quotation mark (") in parameter values.

Response

ParameterDescription

is_success

String(1) Required

Indicates whether the request is accepted by the Alipay gateway.

T: accepted

F: rejected

Example:T

sign_type

String Required

Sign type. RSA, RSA2 and MD5 are supported. Use uppercase. 

Example:MD5

sign

String(32)

Required

Sign value

Example:59c7275cf3c82f038b7c0076f9888926

payment_inst

String(32)

Required

This parameter identifies the wallet type with a value of ALIPAYCN or ALIPAYHK.

Example: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.

Example:SUCCESS

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.

Example:TRANS_NOT_FOUND

alipay_trans_status

String(32)

Transaction status. See Trade status for details.

Example:WAIT_BUYER_PAY

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. 

Example:cao***@126.com or 186***22156

alipay_buyer_user_id

String(16) 

Required

The unique ID for each Alipay account, which starts with 2088.

Example:2088102130896433

partner_trans_id

String(64)

Required

Equal to the partner_trans_id field given in the request

Example:201311221000000002

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.

Example:201311221703338463

alipay_pay_time

String(16)

The time that the transaction was paid, which is in a format of YYYYMMDDHHMMSS. 

Example:201311212323

currency

String(8)

Required

The currency used for labeling the price of the transaction 

Example:USD

trans_amount

Number(11,2) Required

The transaction amount in the currency given above. Range: 0.01-100000000.00. Two digits after decimal point. 

Example:39.25

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. 

Example:2.19

Parameters rejected by Alipay gateway:

ParameterDescription

is_success

String(1) Required

Indicates whether the request is accepted by the Alipay gateway.

T: accepted

F: rejected

Example:F

sign_type

String Required

Sign type. RSA, RSA2 and MD5 are supported. Use uppercase. 

Example:MD5

sign

String(32) Required

Sign value

Example:59c7275cf3c82f038b7c0076f9888926

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. 

Example:TRANS_NOT_FOUND

detail_error_des

String(48)

Explanation of the detailed error code. If result_code is SUCCESS, this parameter is not returned.

Example:New parameter??? needs to get list from Dev team

Error codes

Error codeDescription
SYSTEM_ERRORAlipay 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:

copy
<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_statusy_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:

copy
<?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>