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

inquiryRefund

POST /v1/payments/inquiryRefund

Use the inquiryRefund API to query for information about a previously submitted refund request.

Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:

Note: Set the data type of each field (except array) as String. This means that you must use double quotation marks (" ") to enclose the field value. Examples:

  • If the data type of a field is Integer and its value is 20, set it as "20".
  • If the data type of a field is Boolean and its value is true, set it as "true".

 

Request parameters

refundRequestId String  

The unique ID assigned by a merchant to identify a refund request. refundRequestId and refundId cannot both be null. Special characters are not supported. If both refundRequestId and refundId are specified, refundId takes precedence.

More information about this field

  • Maximum length: 64 characters

refundId String  

The unique ID assigned by Alipay to identify a refund. refundRequestId and refundId cannot both be null. A one-to-one correspondence between refundId and refundRequestId exists. If both refundRequestId and refundId are specified, refundId takes precedence.

More information about this field

  • Maximum length: 64 characters

Response parameters

result Result object REQUIRED

The request result contains information such as status and error codes.

Note: This field does not indicate the refund result. This field only indicates whether the inquiryRefund interface is called successfully. 

Show child parameters

refundId String  

The unique ID assigned by Alipay to identify a refund. A one-to-one correspondence between refundId and refundRequestId exists.

Note: This field is null when the refund record cannot be found, or result.resultStatus is F or U

More information about this field

  • Maximum length: 64 characters

refundRequestId String  

The unique ID assigned by the merchant to identify a refund request.

Note: This field is null when the refund record cannot be found, or result.resultStatus is F or U

More information about this field

  • Maximum length: 64 characters

refundAmount Amount object 

The refund amount that is initiated by the merchant.

Note: This field is null when the refund record cannot be found, or result.resultStatus is F or U

Show child parameters

refundTime Datetime  

The date and time when the refund reaches a final state of success on the Alipay side, not the Alipay+ Mobile Payment Provider (Alipay+ MPP) side. 

Note: This field is returned when the value of refundStatus is SUCCESS.

More information about this field

  • The value follows the ISO 8601 standard format. For example, "2019-11-27T12:01:01+08:00".

refundStatus String  

Indicates the final status of the Alipay refund, not the Alipay+ Mobile Payment Provider (Alipay+ MPP) side. Valid values are:  

  • SUCCESS: Indicates the refund is successful. 
  • PROCESSING: Indicates the refund is still under process. 
  • FAIL: Indicates the refund failed.

Note: This field is null when the refund record cannot be found, or result.resultStatus is F or U

More information about this field

  • Maximum length: 16 characters

grossSettlementAmount Amount object 

The refund settlement amount, which equals the refund amount multiplied by the value of settlementQuote. This field is returned when the currency exchange is predetermined and the exchange rate is locked at the time of the transaction.

Show child parameters

settlementQuote Quote object 

The exchange rate between the settlement currency and payment currency. This field is returned when grossSettlementAmount is returned.

Show child parameters
API Explorer

Request

URL
Request Body

Response

Response Body

More Information

This section provides additional information about key parameters. See the following list for details:

  • refundTime:

The time when Alipay successfully executes the refund. This is when the refund reaches a final state of success on the Alipay side, and does not include the Alipay+ Mobile Payment Provider (Alipay+ MPP) side.

  • refundStatus:

This field only identifies the refund status on the Alipay side and does not include the Alipay+ MPP side.  

  • refundId:

The unique refund processing ID. For polling the same refund, this field must be unique. For polling different refunds, this field must be different. This field can be used for the refund inquiry.

  • refundRequestId or refundId:
    • If a successful result is returned after calling the refund interface, the merchant can use refundId or refundRequestId to query the original refund result.
    • If an unknown exception or timeout is returned after calling the refund interface, the merchant can only use refundRequestId to query the original refund result.
    • If the merchant uses both refundId and refundRequestId to call this interface, Alipay will only use refundId to do the query, and ignore the refundRequestId in the request.
    • If the merchant uses a correct refundId or refundRequestId to call this interface, while that refund does not belong to the merchant, an error of ORDER_NOT_EXIST is returned.

Result process logic

For different request results, different actions need to be performed. See the following list for details:

  • If the value of result.resultStatus is S, then the refund result inquiry is successful.
  • If the value of result.resultStatus is F, then the refund inquiry failed.
  • 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

CodeValueMessageFurther action
SUCCESSSSuccess

The interface was called successfully, no further action is needed.

ORDER_NOT_EXISTFThe refund order does not exist.

Call the interface again after 15 seconds. If no results are returned after three retries, the order has not been placed. 

CLIENT_INVALIDFThe client is invalid.

Check whether clientId is correct. 

METHOD_NOT_SUPPORTEDFThe server does not implement the requested HTTP method.

Check whether the HTTP method is correct. 

MEDIA_TYPE_NOT_ACCEPTABLEFThe server does not implement the media type that is acceptable to the client.

Check whether the media type is correct.