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

Refund

After transaction is paid successfully, you can issue a refund by using the refund API or Antom Merchant Portal.

Before issuing a refund, you must be familiar with the following information:

  • Commission fee: Whether the commission fee is returned is subject to the contract.
  • Refund exchange rate: 
    • For cross-currency settlement and locked-in currency conversion mode, the exchange rate on the day the refund is issued is applied.
    • For cross-currency settlement and non-locked-in currency conversion mode, the exchange rate on the following day the refund is issued is applied.
    • No exchange rate is involved when the settlement currency is the same as the transaction currency.

Refund using API

You can use APIs to initiate a refund and obtain refund results. The following figure illustrates the workflow of the refund process:

image.png

Figure 1. Refund workflow

Initiate a refund

The following requirements for a refund request must be satisfied when you use the refund API. Otherwise, the corresponding error codes are to be returned by Antom:

Refund requirement

Error code

Refund currency

The value of the parameter refundAmount.currency in the refund request needs to be consistent with the value of the parameter paymentAmount.currency used for initiating a payment.

CURRENCY_NOT_SUPPORT

Refund amount

The value of the parameter refundAmount.value in the refund request must be no less than the minimum refund amount (which is usually the same as the minimum payment amount) and no greater than the refundable amount of a payment.

REFUND_AMOUNT_EXCEED

Payment status

For card payment methods:

  • Only captured payments can be refunded.
  • For a payment where a chargeback occurs and the liability is not judged, a refund is not allowed.

For other payment methods, the refund is allowed only when the value of the paymentStatus parameter of the original payment is SUCCESS.

ORDER_STATUS_INVALID

Refund period

The refund is allowed only when the refund is issued within the refund period of the corresponding payment method.

REFUND_WINDOW_EXCEED

Table 1. Refund requirements

The key parameters contained in refund requests are listed as follows (For details, see the refund API):

Parameter

Description

refundRequestId

The unique identifier that you assign to a payment.

paymentId

The unique identifier that Antom assigns to the original payment to be refunded.

refundAmount

The refund amount must be no less than the minimum refund amount (which is usually the same as the minimum payment amount) and no greater than the refundable amount of a payment.

refundNotifyUrl

The URL for receiving asynchronous refund notifications.

Table 2. Key parameters of refund requests

Obtain the refund result

After you initiate a refund request, you can use either of the following three ways to obtain the refund result:

  • Obtain the refund result by checking the response returned through the refund API.
  • Call the inquiryRefund API to inquire about the refund status.
  • View the refund result through asynchronous notifications sent by Antom.

Check the refund status through the refund API

After you call the refund API, Antom synchronously returns the refund result. The resultStatus parameter in the API response indicates the refund status of this payment. The values of resultStatus are explained as follows:

resultStatus

Explanation

S

The refund is successful.

U

The refund is being processed. When the value of resultCode is REFUND_IN_PROCESS, you can obtain the final refund result through the inquiryRefund API or the notifyRefund notification.

F

The refund failed. See error codes of the refund API for troubleshooting.

Table 3. Values of resultStatus

Inquire about the refund status

Regardless of the payment method used for a payment, you can call the inquiryRefund API to inquire about the refund status. The refund status is indicated by the refundStatus parameter in the response. The following table explains the possible values of the refundStatus parameter:

refundStatus

Explanation

SUCCESS

The refund is successful.

PROCESSING

The refund is being processed.

FAIL

The refund failed.

Table 4. Values of refundStatus in the inquiryRefund API

Receive an asynchronous notification of the refund status

Before you can receive an asynchronous notification of the refund status, you must set a notification address. You can configure the address in Antom Dashboard or by specifying the refundNotifyUrl parameter in the refund API. After you receive the notification, check the refund status through the refundStatus parameter in the notification. The values of refundStatus are explained as follows:

refundStatus

Explanation

SUCCESS

The refund is successful.

FAIL

The refund failed.

Table 5. Values of refundStatus in the notifyRefund API

Inquire about the refund records

You can view the refund records of a transaction by using the inquiryRefund API. If a transaction has been refunded, the parameter transactions shows the refund records of the transaction.

Refund in Antom Merchant Portal

You can issue a refund on Antom Merchant Portal. For more information about how to issue a refund and view the refund result, see Refund transactions on Antom Merchant Portal.