Skip to main content

Safe retries

Send a call again without doing it twice.

Networks fail. Add an Idempotency-Key to calls that change data. Use your own id, up to 200 letters.

Make a new key for each new action, such as a random id or your own order id. Use the same key again only to send the exact same call again. The examples in these docs make a new random key each time with $(uuidgen) or crypto.randomUUID().

  • The same key and the same body gives the first answer again, with the header Idempotent-Replay: true.
  • The same key and a different body gives retry_body_changed.
  • If the first call still runs, you get still_running.
  • We keep the key for 24 hours.

Retry after 429, 500 and 503. Don't retry other errors without fixing them.

Sales and events also have an external_id. Sending the same one twice makes one record, even after 24 hours.

Was this useful?

Your answer stays in this browser.