Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

alipay.intl.acquiring.offline.payQuery_2.0.2

The merchant can use this API to query transaction status and other information.

Request

Service address

Request head

ParameterNameTypeLengthRequiredDescriptionSample
versionAPI versionString8YThe API version2.0.2
functionAPI nameString128YThe API namealipay.intl.acquiring.offline.payQuery
clientIdClient IDString32YThe unique ID assigned by Alipay to identify a client that makes API calls211xxxxxxxxxxxxxxx044
reqTimeRequest timeDate time/YDate time with timezone, see RFC 3339 Section 5.6 for details.2001-07-04T12:08:56+05:30
reqMsgIdRequest message IDString64YThe unique ID assigned by client to identify a request message1234567asdfasdf1123fda
reserveReserved parameterString256NKey/Value formatted parameter for future use{key/value}
signTypeSign typeString64NThe signature typeRSA2

Request body

ParameterNameTypeLengthRequiredDescriptionSample
partnerIdPartner IDString32YThe unique partner ID assigned by Alipay. This parameter identifies the settlement target that Alipay settles to.218xxxxxxxxxxxxxxxx023
acquirementIdAlipay transaction IDString64CThe unique Alipay transaction ID.
Note: This parameter is required when merchantTransId is NULL.
2015xxxxxxxxxxxxxxxxxxxxx678
merchantTransIdMerchant transaction IDString64CThe unique ID assigned by the merchant to identify a transaction.
Note: This parameter is required when acquirementId is NULL.
510xxxxxxxxxxxxxx002

Response

Response head

ParameterNameTypeLengthRequiredDescriptionSample
versionAPI versionString8YThe API version2.0.2
functionAPI nameString128YThe API namealipay.intl.acquiring.offline.payQuery
clientIdClient IDString32YThe unique ID assigned by Alipay to identify a client that makes API calls211xxxxxxxxxxxxxxx044
respTimeResponse timeDate time/YDate time with timezone, see RFC 3339 Section 5.6 for details.2001-07-04T12:08:56+05:30
reqMsgIdRequest message IDString64YThe unique ID assigned by client to identify a request message1234567asdfasdf1123fda
reserveReserved parameterString256NKey/Value formatted parameter for future use{key/value}

Response body

ParameterNameTypeLengthRequiredDescriptionSample
resultInfoResult infoResultInfo/Y

See resultInfo for details.

{
    "resultStatus": "S",
    "resultCodeId": "00000000",
    "resultCode":"SUCCESS",
    "resultMsg": "result message"
}
paymentThe payment informationPayment/C

See payment for details. This parameter is required when reultCode is SUCCESS.

{
"acquirementId": "2015xxxxxxxxxxxxxxxxxxxxx678",
                      "merchantTransId": "510xxxxxxxxxxxxxx234",
"payStatus": "PAY_SUCCESS",
"orderAmount": { "currency": "CNY", "value": "2390"},
"paymentTime": "2001-07-04T12:08:56+05:30"
}
userSiteUser siteString64CThe user site shows where the buyer's wallet app belongs. ALIPAY_CN: Alipay China site
Note: This parameter is required when reultCode is SUCCESS
ALIPAY_CN
userIdUser IDString64NThe user ID that identifies a user in the user site208xxxxxxxxxx012
userLoginIdUser login IDString64NThe ID that the user uses to login to the wallet app. The ID is masked to protect the customer privacy.c***@gmail.com

Sub-parameters

resultInfo

ParameterNameTypeLengthRequiredDescriptionSample
resultStatusResult statusString2YThe request status can be:
S: success
F: failure
U: unknown
S
resultCodeIdResult IDString8YAn 8-digit code that is used to identify a result. When resultStatus is S, the value must be 00000000. When resultStatus  is F or U, the value can be other result ID specified by the interface.00000000
resultCodeResult codeString64YThe result codeSUCCESS
resultMsgResult messageString256NWhen resultCode is S, this value can be empty. When resultCode is F or U, the error description is required.success

payment

ParameterNameTypeLengthRequiredDescriptionSample
acquirementIdAlipay transaction IDString64YThe unique Alipay transaction ID.2015xxxxxxxxxxxxxxxxxxxxx678
merchantTransIdMerchant transaction IDString64YThe unique ID assigned by the merchant to identify a transaction.510xxxxxxxxxxxxxx002
payStatusPayment statusString32YStatus can be:  
WAIT_PAY: Awaiting the payment
PAY_SUCCESS: Payment success
PAY_FAILED: Payment cancelled or closed
PAY_SUCCESS
orderAmountOrder amountMoney/YThe orderAmount is provided in the smallest common currency unit. For example, to create a charge for $1.00, set orderAmount value to 100 (100 cents).{"currency":"USD", "value":"239"}
conversionRateConversion rateExchangeRate/CThe exchage rate between orderAmount and payAmount.
Note: This parameter is required when payCurrencyDifferentWithOrderCurrency is true.  See conversionRate for details.
{
"baseCurrency":"USD",
"exchangeCurrency":"CNY",
"rate":"6.9123"
}
paymentTimePayment timeDate time/NThe time when the transaction is paid. Date time with timezone, see RFC 3339 Section 5.6 for details.2016-07-04T12:08:56+05:30

Money

ParameterNameTypeLengthRequiredDescriptionSample
currencyCurrencyString3YThe 3-letter currency code. See supported currencies for details.USD
valuevalueNumber16YThe amount. This value must be provided in the smallest common currency unit. For example, to create a charge for $1.00, you would set orderAmount: value=100 (100 cents).239

conversionRate

ParameterNameTypeLengthRequiredDescriptionSample
baseCurrencyBase currencyString3YThe base currencyUSD
exchangeCurrencyExchange currencyString3YThe exchange currencyCNY
rateRateString16YThe exchange rate of baseCurrency against exchangeCurrency6.9123

Result code

Functional logic result code

ResultIDResultCodeResultStatusRemarks
12005003ORDER_STATUS_INVALIDFThe transaction status is invalid.
12005004ORDER_NOT_EXISTFThe transaction does not exist.
12005134SIGN_TYPE_INVALIDFThe signature type is invalid.
12005135SIGN_TYPE_NOT_SUPPORTFThe signature type is not supported.

Basic result code

ResultIDResultCodeResultStatusRemarks
00000000SUCCESSSSuccess
00000019PROCESS_FAILFGeneral business failure
00000901UNKNOWN_EXCEPTIONUAPI failed because of unknown reasons
00000004PARAM_ILLEGALFThe parameter is incorrect.
00000007INVALID_SIGNATUREFThe signature is invalid.
00000008KEY_NO_FOUNDFThe key is not found.
00000013NO_INTERFACE_DEFFThe API is undefined.
00000014API_IS_INVALIDFThe API is invalid or nonactivated.
00000016OAUTH_FAILEDFThe oAuth authentication failed.
00000021ACCESS_DENIEDFAccess denied
12014152CLIENT_FORBIDDEN_ACCESS_APIFThe Client is not authorized to use this API.
12014155UNKNOWN_CLIENTFUnknown client
12014156INVALID_CLIENT_STATUSFInvalid client status
00000024REQUEST_TRAFFIC_EXCEED_LIMITFThe request traffic exceeds the limit.

Sample

Sample request

copy
{ 
    "request":{ 
        "head":{ 
            "version":"2.0.2", 
            "function":"alipay.intl.acquiring.offline.payQuery", 
            "clientId":"211xxxxxxxxxxxxxxx044", 
            "reqTime":"2001-07-04T12:08:56+05:30", 
            "reqMsgId":"1234567asdfasdf1123fda", 
            "reserve":"{}",
            "signType":"RSA2" 
        }, 
        "body":{ 
            "partnerId":"218820000000000000023", 
            "acquirementId":"2015xxxxxxxxxxxxxxxxxxxxx678"
        } 
    }, 
    "signature":"signature string" 
}

Sample response

copy
{ 
    "response":{ 
        "head":{ 
            "version":"2.0.2", 
            "function":"alipay.intl.acquiring.offline.payQuery", 
            "clientId":"211xxxxxxxxxxxxxxx044", 
            "respTime":"2001-07-04T12:08:56+05:30", 
 
            "reqMsgId":"1234567asdfasdf1123fda", 
            "reserve":"{}" 
        }, 
        "body":{ 
            "resultInfo":{ 
                "resultStatus":"S", 
                "resultCodeId":"00000000", 
                "resultCode":"SUCCESS", 
                "resultMsg":"success" 
            }, 
            "payment":{ 
                "acquirementId":"2015xxxxxxxxxxxxxxxxxxxxx678", 
                "merchantTransId":"51051001000000001234", 
                "payStatus":"PAY_SUCCESS", 
                "orderAmount":{ 
                    "currency":"USD", 
                    "value":"239" 
                }, 
                "paymentTime":"2001-07-04T12:08:56+05:30" 
            }, 
            "userSite":"ALIPAY_CN", 
            "userId":"208xxxxxxxxxx012", 
            "userLoginId":"c***@gmail.com" 
        } 
    }, 
    "signature":"signature string" 
}