Supported endpoints
The following endpoints support idempotent requests.POST /transactionsPOST /transactions/:id/capturePOST /transactions/:id/authorization/incrementPOST /transactions/:id/voidPOST /transactions/:id/refundsPOST /transactions/:id/refunds/all
POST /gift-cards/activations and POST /gift-cards/issuances endpoints also accept an
Idempotency-Key header. For these endpoints, the key is forwarded to the gift card service,
which makes the request idempotent if the service supports it. Gr4vy doesn’t store the response.
Making an idempotent request
To make an idempotent request, specify theIdempotency-Key header in the
request.
Most of the SDKs support passing through this header on
the API call.
Concurrent requests
When making an idempotent request using the sameIdempotency-Key as a previous
request, and the original request is still being processed, an
error is received. This request can be safely retried. It is recommended to apply an exponential
back-off when retrying transactions.
Retrying after a timeout
A request that takes too long can end with a504 response, even though the operation continues
and can still complete. Don’t retry such a request straight away. Wait for the
webhook, or look up the result, for example by searching
transactions by external_identifier, before you retry with the same Idempotency-Key and an
exponential back-off. See handling timeouts for more strategies.
Conflicting requests
When making an idempotent request using the sameIdempotency-Key as a previous
request, and the request is not the same (for example, the request body is
different), an error is received. Retrying this request will not change the
error response. The request should be checked.