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

Inquire about payment status

To obtain the payment status, you can monitor the asynchronous notification or actively call the inquiryPayment API to get the payment status. Although a retransmission mechanism exists for the asynchronous notification, the notification might not be received due to network issues when the user successfully completes the payment. Therefore, it is necessary to actively inquire about the payment status by using the inquiryPayment API.

Usually, when you encounter one of the following cases, call the inquiryPayment API:

  • No clear payment status can be obtained. For example, when the payment status notification is not received within one minute after receiving the response of the payment request.
  • The payment process times out and no payment status is obtained.


If the domain name is, the request URLs for calling the inquiryPayment API are as follows:

  • Sandbox environment:
  • Production environment:

You can use paymentId or paymentRequestId to initiate the inquiryPayment request. It is suggested to use the paymentRequestId field because it is assigned by the merchant to identify each unique request. The following example shows an inquiryPayment request with the paymentId field specified.

{     "paymentId": "212302615674274268857659685498868097avhIBxVMMX201909020000024285" }


The following example shows a response of the inquiryPayment API. The payment status is presented in the paymentStatus field.

    "result": {
        "resultStatus": "S",
        "resultCode": "SUCCESS",
        "resultMessage": "success."
    "paymentResultCode": "SUCCESS",
    "paymentResultMessage": "success",
    "paymentStatus": "SUCCESS",
    "paymentId": "212302615674274268857659685498868097avhIBxVMMX201909020000024285",
    "paymentRequestId": "pay_1029760066716669_102775765079666",
    "paymentAmount": {
        "currency": "PHP",
        "value": "800"
    "RediretActionForm": {
        "redirectUrl": "",
        "method": "GET"

The result field: This field only indicates the call status of this inquiry request. It does not indicate the payment status. Details about the call status are as follows:

  • S: indicates that the inquiryPayment API call was successful and you can get the payment status from the value of paymentStatus.
  • F: indicates that the inquiryPayment API call failed. You must investigate the root cause. If the root cause is fixable and the order still exists in the Alipay system, retry the inquiryPayment API until a result of S is obtained.
  • U: indicates that the inquiryPayment API call status is unknown. After getting a resultStatus of U, call the inquiryPayment API with the same parameters multiple times until a result of S or F is obtained. If S or F is not returned after the maximum number of retries, the system alarm will be triggered and you must investigate and solve the problem.

The paymentStatus field: This field indicates the payment status of the order. This field is returned only when the value of result.resultStatus is S. The value of this field can be:

  • SUCCESS: indicates the payment succeeded. As this is a final payment status, stop the inquiry process.
  • FAIL: indicates the payment failed. As this is a final payment status, stop the inquiry process.
  • CANCELLED: indicates the payment is canceled. As this is a final payment status, stop the inquiry process.
  • PROCESSING: indicates that the payment is still processing. This is an intermediate payment status. When this value is returned, continue the inquiry process in the form of polling until a final payment status is obtained or until the asynchronous notification is received. The polling time needs to last for at least 14 minutes (Alipay's payment expiration time).