Payment Result Inquiry
Use this interface to query for information about a previously submitted payment request or accept asynchronous processing result for a payment.
Request parameters
Response parameters
The request result, which contains information related to the request result, such as status and error codes.
Result status. Possible values are:
- S: Indicates that the result status is successful.
- F: Indicates that the result status is failed.
- U: Indicates that the result status is unknown.
Indicates the final status of Alipay payment. Valid values are:
- SUCCESS: Indicates the transaction is successful.
- FAIL: Indicates the transaction is failed.
- PROCESSING: Indicates the transaction is under processing.
- CANCELLED: Indicates the transaction is cancelled.
The payment amount that the merchant requests to receive in the order currency.
The 3-letter currency code that follows the ISO 4217 standard.
Authorization expiration time, which follows the ISO 8601 standard.
The date and time when the payment is created, which follows the ISO 8601 standard.
The date and time when the payment reaches a final state of success or failure, which follows the ISO 8601 standard.
PMP customer information.
Note: PMP, payment method provider, is an organization that processes payment services and other value-added services on behalf of the payer.
The name of PMP.
Note: PMP, payment method proivder, is an organization that processes payment services and other value-added services on behalf of the payer.
The customer ID of PMP.
Note: PMP, payment method proivder, is an organization that processes payment services and other value-added services on behalf of the payer.
Provides information about the redirection action.
Indicates the method type. Possible values are:
- POST: Indicates that the request that is sent to the redirection address needs to be a POST request.
- GET: Indicates that the request that is sent to the redirection address needs to be a GET request.
- SCAN: Indicates that the request that is sent to the redirection address needs to be a SCAN request.
Information about the transaction
The transaction result, which contains information related to the business result and error information.
Result status. Possible values are:
- S: Indicates that the result status is successful.
- F: Indicates that the result status is failed.
- U: Indicates that the result status is unknown.
Transaction type for each subsequent payment activity. Possible values are:
- PAYMENT: Indicates a payment process.
- REFUND: Indicates a refund process.
- CANCEL: Indicates a cancellation process.
- AUTHORIZATION: Indicates an authorization process.
- CAPTURE: Indicates a capture process.
- VOID: Indicates a void for authorization.
Transaction status type. Possible values are:
- SUCCESS: indicates the transction is successful.
- FAIL: indicates the transaction is failed.
- PROCESSING: indicates the transaction is being processed.
- CANCELLED: indicates the transaction is cancelled.
Transaction amount. When the transaction type is CAPTURE, the value of this field is identical to captureAmount. When the transaction type is REFUND, the value of this field is identical to refundAmount.
The 3-letter currency code that follows the ISO 4217 standard.
The amount to charge as a positive integer in the smallest currency unit. (That is, 100 cents to charge $1.00, or 100 to charge JPY ¥100, a zero-decimal currency).
Total settlement amount, which equals to transaction amount multiplied by the value of settlementQuote.
Note: This field is empty when the settlement currency is the same as the transaction currency.
The 3-letter currency code that follows the ISO 4217 standard.
The exchange rate between the settlement currency and transaction currency at the time of transaction, which is provided only in the locked-in rate case.
Note: This field is empty when the settlement currency is the same as the transaction currency.
Effective time of the exchange rate, which follows the ISO 8601 standard
Expiration time of the exchange rate, which follows the ISO 8601 standard
More information
This section provides additional information about certain parameters. See the following list for details:
- paymentTime:
The successful execution time of this payment by Alipay, that is, the date and time when the payment reaches a final state of success or failure. This value is used as the start time of the subsequent revocable and refundable time. For example, if the refundable time is 6 months, the final time to accept the refund is paymentTime plus 6 months. - paymentId:
The unique payment processing ID. For polling the same payment, this field must be unique; for polling different payments, this field must be different. This value can be used for further actions like inquiry, cancel, or refund. - paymentRequestId or paymentId:
To decide when to use paymentRequestId or paymentId, follow these rules: - If the payment interface calling returns successfully, the merchant can use the paymentId or paymentRequestId to query the original payment.
- If the payment interface calling returns unknown exception or times out, the merchant can only use paymentRequestId to query the payment result.
- If the payment cancellation interface calling returns unknown exception or times out, the merchant can use either paymentId or paymentRequestId of the original payment to query the cancel result.
- If the refund interface calling returnes unknown exception or times out, the merchant can use either paymentId or paymentRequestId of the original payment to query the refund result. But using refundRequestId is not supported.
Result process logic
For different request results, different actions are to be performed. See the following list for details:
- If the value of result.resultStatus is
S, payment result inquiry succeeds. - If the value of result.resultStatus is
F, payment inquiry fails. - If the value of result.resultStatus is
U, then the request result is unknown. Use the same request parameters to retry the inquiry request.
Result/Error codes
| Code | Value | Message |
|---|---|---|
| SUCCESS | S | Success |
| ORDER_NOT_EXIST | F | The order does not exist. |
| PROCESS_FAIL | F | A general business failure occurred. Do not retry. |
| PARAM_ILLEGAL | F | Illegal parameters exist. For example, a non-numeric input, or an invalid date. |
| KEY_NOT_FOUND | F | The key is not found. |
| ACCESS_DENIED | F | Access denied |
| REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. |
| API_INVALID | F | API is invalid or not active. |
| CLIENT_INVALID | F | The client is invalid. |
| SIGNATURE_INVALID | F | The signature is invalid. |
| METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTP method. |
| MEDIA_TYPE_NOT_ACCEPTABLE | F | The server does not implement the media type that is acceptable to the client. |
| UNKNOWN_EXCEPTION | U | An API calling is failed, which is caused by unknown reasons. |
Request
Method
POST
Endpoint
v1/payments/inquiryPayment
Header
Accept: application/json