alipay.trade.query
Call the alipay.trade.query interface to query the payment transaction status.
Request
Service address
Environment | HTTPS request URL |
Production environment | |
Test environment |
Request parameters
Parameter | Description |
Basic parameter | |
app_id String (32) | The unique ID that is assigned by Alipay to identify an application. Example: |
method String (128) | Interface name Example: |
format String (40) | Only JSON is supported. Example: |
charset String (10) | The charset with which the request data is encoded. GBK and UTF-8 are supported. Example: |
sign_type String (10) | Signature type. RSA and RSA2 are supported. Use uppercase. Example: |
sign String (344) | Signature value |
timestamp String (19) | The time when the merchant server sends the request. The format is yyyy-mm-dd hh:mm:ss. Example: |
version String (3) | The API version. The value is fixed as 1.0. Example: |
notify_url String (256) | The URL for receiving asynchronous notifications after the pre-auth is completed. Example: |
app_auth_token String (40) | To query authorization information. Example: Note: After a merchant authorizes an ISV to use certain APIs, Alipay will assign an app_auth_token to the ISV. The ISV can use this interface to query the authorization information such as the authorizer and authorized APIs corresponding to the app_auth_token. For more details, see Overview of the app authorization (in Mandarin). |
biz_content String | Collection of request parameters. The maximum length is not limited. Except for common parameters, all other request parameters must be passed in to this parameter. |
Business parameter | |
out_trade_no String (64) | The unique transaction ID that is assigned by the merchant. This parameter is required when trade_no is not provided. If out_trade_no and trade_no appear at the same time, trade_no takes precedence. Example: |
trade_no String (64) | The serial number assigned by Alipay to identify a trade in Alipay system. This parameter is required when trade_no is not provided. If out_trade_no and trade_no appear at the same time, trade_no takes precedence. Example: |
Response
Synchronous response
Parameter | Description |
Basic parameter | |
code String (16) | The gateway return code, which indicates whether the request is accepted by Alipay gateway. Example: |
msg String (32) | Description of the gateway return code Example: |
sub_code String (16) | Processing result of the request Example: |
sub_msg String (64) | Description of the processing result of the request |
sign String (344) | The sign value. See Signature for details. |
Business parameter | |
out_trade_no String (64) | The unique transaction ID that is assigned by the merchant. Example: |
trade_no String (64) | The serial number assigned by Alipay to identify a trade in Alipay system. This parameter is required when out_trade_no is not provided. Example: |
trade_status String (10) | The trade status. Possible values include:
|
trans_currency String (8) | The transaction currency. Use uppercase. Example: |
settle_currency String (8) | The settlement currency. Use uppercase. Example: |
settle_amount Price (11) | Settlement amount Example: |
pay_currency String (8) | Payment currency Example: |
pay_amount Price (11) | Transaction amount Example: |
settle_trans_rate String (11) | The exchange rate between the settlement currency and the transaction currency. Example: |
trans_pay_rate String (11) | The exchange rate between the transaction currency and the payment currency. Example: |
buyer_logon_id String (100) | Buyer's Alipay user login ID Example: |
buyer_user_id String (32) | Buyer's Alipay user ID Example: |
total_amount Price (11) | Total amount Example: |
terminal_id String (32) | Terminal ID of the merchant Example: |
store_name String (64) | Store name Example: |
Error codes
Error Code | Description |
ACQ.SYSTEM_ERROR | System error |
ACQ.INVALID_PARAMETER | Incorrect parameter |
ACQ.TRADE_NOT_EXIST | The transaction does not exist. |