Idempotency-Key header to your request.
How it works
When you send aPOST request with an Idempotency-Key header, we will save the resulting status code and body of the first request made for any given key. Subsequent requests with the same key will return the exact same result, including HTTP status code and response body.
- Duration: Idempotency keys are cached for 24 hours.
- Conflicts: If you reuse an
Idempotency-Keywith a different request body, the API will return a409 Conflicterror (idempotency_conflict). - Concurrent requests: If a request is still processing, concurrent requests with the same key are rejected with the same
409 Conflicterror (idempotency_conflict) to prevent race conditions. - Errors: If the original request fails (any
4xxor5xxresponse), the key is not stored, so you can retry with the same key. Only successful (2xx) responses are replayed.
How to generate a key
The API accepts any string up to 255 characters, but we strongly recommend using a V4 UUID (Universally Unique Identifier). You should generate the key on your backend immediately before making the API call. If the request fails due to a network error, you must reuse that exact same key on the retry.Supported Endpoints
Idempotency is supported on allPOST (create) endpoints:
POST /v1/products/POST /v1/invoices/POST /v1/customers/
