# inquiryRefund

`POST /v1/payments/inquiryRefund`

Use this API to inquire about the refund status of 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： 

-   [Request header](https://docs.antom.com/ac/ams/api_fund.md#ML5ur)
-   [Response header](https://docs.antom.com/ac/ams/api_fund.md#WWH90)

> **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:

- Maximum length: 64 characters

#### refundId (String)

The unique ID assigned by APO 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:

- Maximum length: 64 characters

## Response parameters

#### result (Result, REQUIRED)

Information about the request call result.

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

##### resultCode (String, REQUIRED)

Result code. Possible values are listed in the **Result/Error codes table** on this page.

More information:

- Maximum length: 64 characters

##### resultStatus (String, REQUIRED)

Result status. Valid values are:  

-   `S`: Successful
-   `F`: Failed
-   `U`: Unknown

More information:

- Maximum length: 1 character

##### resultMessage (String, REQUIRED)

Result message that explains the result code.

More information:

- Maximum length: 256 characters

#### refundId (String)

The unique ID assigned by APO to identify a refund. A one-to-one correspondence between _refundId_ and _refundRequestId_ exists.

> **Note**: This field is returned when the API is called successfully (the value of r_esult.resultStatus_ is `S`).

More information:

- Maximum length: 64 characters

#### refundRequestId (String)

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

> **Note**: This field is returned when the API is called successfully (the value of _result.resultStatus_ is `S`).

More information:

- Maximum length: 64 characters

#### refundAmount (Amount)

The refund amount that is initiated by the merchant.

> **Note**: This field is returned when the API is called successfully (the value of _result.resultStatus_ is `S`).

##### currency (String, REQUIRED)

The 3-letter currency code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard.

More information:

- Maximum length: 3 characters

##### value (Integer, REQUIRED)

The amount to charge as a positive integer in the smallest currency unit. For example, $1.00 should be charged as 100 cents to charge USD 1.00, or 100 to charge JPY 100, a 0-decimal currency.

Notes: For details about the smallest currency unit, see [Smallest unit of the currency](https://global.alipay.com/docs/ac/ref/cc#ONkIe).

More information:

- Value range: 0 - unlimited

#### refundTime (Datetime)

The date and time when the refund reaches a final state of success on the APO side.

> **Note**: This field is returned when the refund succeeds (the value of _refundStatus_ is `SUCCESS`).

More information:

- The value follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) standard format. For example, "2019-11-27T12:01:01+08:00".

#### refundStatus (String)

Indicates the final status of the Antom refund. Valid values are:  

-   `SUCCESS`: Indicates the refund succeeded. 
-   `PROCESSING`: Indicates the refund is under processing. 
-   `FAIL`: Indicates the refund failed.

> **Notes**: 
>
> -   This field is returned when the API is called successfully (the value of _result.resultStatus_ is `S`).
> -   This field only identifies the refund status on the APO side and does not include the digital walltes side.

More information:

- Maximum length: 16 characters

#### grossSettlementAmount (Amount)

The refund settlement amount, which equals the refund amount multiplied by the value of _settlementQuote_.

> **Note**: This field is returned when the currency exchange is predetermined and the exchange rate is locked at the time of the transaction.

##### currency (String, REQUIRED)

The acquiring currency that is specified in the contract. A 3-letter currency code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard.

More information:

- Maximum length: 3 characters

##### value (Integer, REQUIRED)

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).

Note: For details about the smallest currency unit, see [Smallest unit of the currency](https://global.alipay.com/docs/ac/ref/cc#ONkIe).

More information:

- Value range: 0 - unlimited

#### settlementQuote (Quote)

The exchange rate between the settlement currency and transaction currency.

> **Note**: This field is returned when _grossSettlementAmount_ is returned.

##### guaranteed (Boolean)

Guaranteed exchange rate available for payment.

##### quoteCurrencyPair (String, REQUIRED)

The exchange rate between settlement currency and transaction currency. Two currencies are separated with a slash and use the three-letter [ISO-4217](https://www.iso.org/iso-4217-currency-codes.html) currency code.

More information:

- Maximum length: 16 characters

##### quoteExpiryTime (Datetime)

Expiration time of the exchange rate.

More information:

- The value follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) standard format. For example, "2019-11-27T12:01:01+08:00".

##### quoteId (String)

The unique ID that is assigned by Antom to identify an exchange rate.

More information:

- Maximum length: 64 characters

##### quotePrice (Decimal, REQUIRED)

The exchange rate used when a currency conversion between settlement currency and transaction currency occurs.

More information:

- Value range: 0 - unlimited

##### quoteStartTime (Datetime)

Effective time of the exchange rate.

More information:

- The value follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) standard format. For example, "2019-11-27T12:01:01+08:00".

#### acquirerInfo (AcquirerInfo)

The information of the acquirer that processes the payment.

##### acquirerName (String)

The name of the acquirer.

More information:

- Maximum length: 64 characters

##### referenceRequestId (String)

The unique ID that is assigned by APO to identify a payment request sent to the acquirer.

More information:

- Maximum length: 64 characters

##### acquirerMerchantId (String)

The unique ID that is assigned by the acquirer to identify a merchant.

More information:

- Maximum length: 64 characters

##### acquirerTransactionId (String)

The unique ID that is assigned by the acquirer to identify a transaction.

More information:

- Maximum length: 64 characters

##### acquirerResultCode (String)

The acquirer's result code that indicates the transaction process result.

More information:

- Maximum length: 64 characters

##### acquirerResultMessage (String)

The result message that describes _acquirerResultCode_ in detail.

More information:

- Maximum length: 64 characters

#### rrn (String)

Retrieval Reference Number (RRN). This can be provided to track details of the payment, refund or dispute with the card issuer.

More information:

- Maximum length: 32 characters

#### arn (String)

Acquirer reference number. It can be provided to track the flow of funds.

More information:

- Maximum length: 64 characters

## More Information

To decide when to use _refundRequestId_ or _refundId_, follow these rules:

-   If a successful result is returned after calling the [**refund**](https://docs.antom.com/ac/apo/refund_online.md) API, use _refundId_ or _refundRequestId_ to inquire about the original refund result.
-   If an unknown exception or timeout occurs after calling the [**refund**](https://docs.antom.com/ac/apo/refund_online.md) API, use only _refundRequestId_ to inquire about the original refund result.

## 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`, the refund result inquiry is successful.
-   If the value of _result.resultStatus_ is `F`, the refund inquiry failed.
-   If the value of _result.resultStatus_ is `U`, the request result is unknown. Use the same request parameters to retry the inquiry request.

## Result/Error codes

| Code | Value | Message | Further action |
| --- | --- | --- | --- |
| SUCCESS | S | Success | The interface is called successfully. Obtain the refund status from refundStatus. |
| ACCESS_DENIED | F | Access is denied. | Contact APO Technical Support for detailed reasons. |
| INVALID_API | F | The called API is invalid or not active. | Contact APO Technical Support to resolve the issue. |
| KEY_NOT_FOUND | F | The private key or public key of APO or the merchant is not found. | Check whether the private key or public key exists. If not, upload the private key in APO Dashboard. |
| NO_INTERFACE_DEF | F | API is not defined. | Check whether the URL is correct. Please refer to the endpoint in the API documentation. |
| ORDER_NOT_EXIST | F | The order does not exist. | Call the API again after 15 seconds. If no results are returned after three retries, the order has not been placed. |
| PARAM_ILLEGAL | F | The required parameters are not passed, or illegal parameters exist. For example, a non-numeric input, an invalid date, or the length and type of the parameter are wrong. | Check and verify whether the required request fields (including the header fields and body fields) of the current API are correctly passed and valid. |
| PROCESS_FAIL | F | A general business failure occurred. | Do not retry. Human intervention is usually needed. It is recommended that you contact APO Technical Support to troubleshoot the issue. |
| SYSTEM_ERROR | F | A system error occurred. | Do not retry, and contact APO Technical Support for more details. |
| REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. | Call the API again to resolve the issue. If not resolved, contact APO Technical Support. |
| UNKNOWN_EXCEPTION | U | An API call has failed, which is caused by unknown reasons. | Call the API again to resolve the issue. If not resolved, contact APO Technical Support. |

## Refund result codes

| Code | Value | Message | Further action |
| --- | --- | --- | --- |
| SUCCESS | S | Success | The refund is successful, no further action is needed. |
| ACCESS_DENIED | F | Access is denied. | Contact APO Technical Support for detailed reasons. |
| API_INVALID | F | The API name or API call format is used incorrectly. | Check whether the API name, HTTP method, or request format is correct when sending the request. |
| CURRENCY_NOT_SUPPORT | F | The currency is not supported. | Contact APO Technical Support for detailed reasons. |
| INVALID_MERCHANT_STATUS | F | The merchant status is abnormal because restrictions exist. | Contact APO Technical Support for detailed reasons. |
| KEY_NOT_FOUND | F | The private key or public key of APO or the merchant is not found. | Check whether the private key or public key exists. If not, upload the private key in A PO Dashboard. |
| MERCHANT_BALANCE_NOT_ENOUGH | F | The merchant balance is insufficient. | Call the API again after the merchant has sufficient balance. The refundRequestId field needs to be changed when you try again. |
| MULTIPLE_REFUNDS_NOT_SUPPORTED | F | Multiple refunds are not supported because restrictions exist in the contract. | Check whether multiple refunds exist. Do not call the refund API anymore. For each refund, only call the API once. |
| NO_INTERFACE_DEF | F | API is not defined. | Check whether the URL is correct. Please refer to the endpoint in the API documentation. |
| ORDER_IS_CLOSED | F | The request you initiated has the same paymentRequestId as that of the existed transaction, which is closed. | Use a new paymentRequestId to initiate the refund again. |
| ORDER_NOT_EXIST | F | The order does not exist. | Check whether paymentId is correct. If correct, contact APO Technical Support for specific reasons. |
| ORDER_STATUS_INVALID | F | The order status is invalid. The transaction is under process or the transaction is failed. | Check the order status and take corresponding actions. Wait if the transaction is under process. Do not initiate the refund if the transaction failed. Contact APO Technical Support for specific reasons. |
| PARAM_ILLEGAL | F | The required parameters are not passed, or illegal parameters exist. For example, a non-numeric input, an invalid date, or the length and type of the parameter are wrong. | Check and verify whether the required request fields (including the header fields and body fields) of the current API are correctly passed and valid. |
| PROCESS_FAIL | F | A general business failure occurred. | Do not retry. Human intervention is usually needed. It is recommended that you contact APO Technical Support to troubleshoot the issue. |
| REFUND_AMOUNT_EXCEED | F | The total refund amount exceeds the payment amount. | Confirm whether the total refund amount exceeds the payment amount. Create a new refund by using an amount less than or equal to the payment amount, or contact APO Technical Support. |
| REFUND_WINDOW_EXCEED | F | The refund date exceeds the refundable period that is agreed in the contract. | Confirm whether the refund date exceeds the refundable period. Check the refundable period in the contract or contact APO Technical Support for the specific refundable period. |
| REPEAT_REQ_INCONSISTENT | F | The amount or currency is different from the previous request. | Ensure all the fields in the requests are the same or use a new paymentRequestId to initiate the refund again. |
| RISK_REJECT | F | The request is rejected because of the risk control. | Prompt the user that the request is rejected because the risk control failed. |
| SYSTEM_ERROR | F | A system error occurred. | Do not retry, and contact APO Technical Support for more details. |
| REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. | Call the API again to resolve the issue. If not resolved, contact APO Technical Support. |
| UNKNOWN_EXCEPTION | U | An API call has failed, which is caused by unknown reasons. | Call the API again to resolve the issue. If not resolved, contact APO Technical Support. |

## Response

### SUCCESS

```json
{
  "acquirerInfo": {
    "acquirerMerchantId": "76476400001****",
    "acquirerName": "2C2P",
    "acquirerTransactionId": "58223943819946212****",
    "referenceRequestId": "202508281903130309950020979****"
  },
  "rrn": "48747813****",
  "arn": "2415673733096155864****",
  "acquirerReferenceNo": "20250828190313xxxx0500209794961",
  "refundAmount": {
    "currency": "USD",
    "value": "100"
  },
  "refundId": "20250828194010890xxxx11500284767910",
  "refundRequestId": "REFUND_2025xxxx122508210_AUTO",
  "refundStatus": "SUCCESS",
  "refundTime": "2025-08-27T21:25:09-07:00",
  "result": {
    "resultCode": "SUCCESS",
    "resultMessage": "success.",
    "resultStatus": "S"
  }
}
```

### REFUND_ORDER_NOT_EXIST

```json
{
  "result": {
    "resultCode": "ORDER_NOT_EXIST",
    "resultMessage": "The order does not exist.",
    "resultStatus": "F"
  }
}
```