# Idempotency

> Antom APIs support idempotency, allowing to retry a request multiple times while only performing the action once. This helps avoid unwanted duplication in case of failures and retries.

Antom APIs support idempotency, allowing to retry a request multiple times while only performing the action once. This helps avoid unwanted duplication in case of failures and retries.

If a transient error or a time-out occurred and the action was not completed in the previous request, the subsequent retry pushes the action to its completion. If the action is already completed, the action is to be performed only once and the same result is to be returned for the retry process. All Antom payment-related APIs are idempotent. The following table shows the most commonly used APIs and their idempotency rules.

# Idempotency fields

The following table lists the idempotency fields of APIs. For details of each idempotency field, see the corresponding API chapter.

| **API name** | **Idempotency field** | **Rules** |
| --- | --- | --- |
| **pay** | _paymentRequestId_ | Merchant uses the _paymentRequestId_ field for idempotency control. For payment requests that are initiated with the same value of _paymentRequestId_ and reach a final status (`S` or `F`), the same result is to be returned for the request. > **Note**: This API checks the consistency of some key request parameters such as _paymentRequestId_, _paymentAmount_, and _paymentMethodId_ if applicable. If any of the key values is different from that of the previous request, the error `REPEAT_REQ_INCONSISTENT` is to be returned. |
| **refund** | _refundRequestId_ | Merchant uses the _refundRequestId_ field for idempotency control. For refund requests that are initiated with the same value of _refundRequestId_ and reach a final status (`S` or `F`), the same result is to be returned for the request. > **Note**: If the value of _refundAmount_ is different from that of the previous request, the error `REPEAT_REQ_INCONSISTENT` is to be returned. |
| **capture** | _captureRequestId_ | Merchant uses the _captureRequestId_ field for idempotency control. For capture requests that are initiated with the same value of _captureRequestId_ and reach a final status (`S` or `F`), the same result is to be returned for the request. > **Note**: If the value of _captureAmount_ is different from that of the previous request, the error `REPEAT_REQ_INCONSISTENT` is to be returned. |
| **registration** | _registrationRequestId_ | Merchant uses the _registrationRequestId_ field for idempotency control. For registration requests that are initiated with the same value of _registrationRequestId_ and reach a final status (`S` or `F`), the same result is to be returned for the request. |
| **initAuthentication** | _authenticationRequestId_ | Merchant uses the _authenticationRequestId_ field for idempotency control. For initAuthentication requests that are initiated with the same value of _authenticationRequestId_ and reach a final status (`S` or `F`), the same result is to be returned for the request. |

Table 1. Idempotency fields and corresponding processing rules