The Idempotency-Key header
SendIdempotency-Key on POST /v1/sales and POST /v1/credit-notes.
Use a value that is stable for the document: your own order or invoice id works, and so does a UUID that you store
with the order. Do not generate a new random key for each retry, because that defeats the purpose. A key shorter
than 8 characters is refused for the same reason.
What a repeat returns
Sending the same request with the same key again returns200 with the original document, and the header:
POST /v1/sales/{id}/retry.
Without a key
If you send noIdempotency-Key, your traderInvoiceNumber plays the same role: repeating a request with the same
number returns the existing document.
Using a number that already exists with a different key is a 409 with the code conflict, and the message
tells you to use a new number or repeat the original request with its original key.
What is and is not idempotent
Read next
- Sales: the outcomes of a sale request
- Errors & Troubleshooting: which failures are safe to retry