# Idempotency Occasionally, you may need to retry a request due to a disrupted API call. For example, if you encounter a network error or timeout. > **Information** > > Some merchant-initiated transactions (MIT) may benefit from [automatic downtime retries](https://www.checkout.com/docs/payments/manage-payments/configure-scheduled-retries.md#Automatic_downtime_retries) if they fail due to an issuer or acquirer network timeout. The following endpoints from our [API](https://api-reference.checkout.com) support idempotent requests, so you can safely retry them without the risk of a duplicate request: - `/payment-contexts` - `/payments` - `/payments/{id}/authorizations` - `/payments/{id}/cancellations` - `/payments/{id}/captures` - `/payments/{id}/refunds` - `/payments/{id}/voids` - `/transfers` --- ## How it works To perform an idempotent payment or payment action request, provide a unique key in the `Cko-Idempotency-Key` HTTP header. This key is cached in our system if the request returns a `2xx` response code. By default, keys expire after 72 hours for both the sandbox and production environments. After this window of time, we process the request as normal. To change the default idempotency window for your production environment, contact your account manager or [request support](https://dashboard.checkout.com/support/new?topic=case_account_management_and_access&issue=issue_account_changes). > **Information** > > We strongly recommend using V4 UUIDs. Subsequent requests with the same key return the same HTTP status code and response body as the original request, if it was processed successfully. If the original request returns a `4xx` or `5xx` response code, we don't save an idempotent result, and we reattempt the payment. For example, if there was a validation error. If we detect concurrent requests with the same idempotency key, we process only one request. The other requests return a `409 Conflict with another request being processed` response. For example, if you automatically retry a payment after experiencing a network issue, while the original request is still being processed. We recommend waiting at least 30 seconds before you reattempt a request. ### Request example ```bash curl -X POST https://{prefix}.api.sandbox.checkout.com/payments \ -H 'Authorization: sk_be458ac1-f20e-4194-bf58-b28e5ffd88e7' \ -H 'Cko-Idempotency-Key: ' \ -H 'Content-Type: application/json' \ -d '{ "source": { "type": "token", "token": "tok_6qi7zfk7652udgy2thneaoxp7u" }, "amount": 1000, "currency": "USD" }' ```