Skip to main content
A request can time out after trdrs has already acted on it, and your code can’t tell. Idempotency makes that safe: you give each intent an id, and sending the same intent again never does the work twice. Use this page when you write the retry logic for orders and venue writes. There are two mechanisms, one for each side of the API, and one rule for both: one intent, one id, forever.

Orders: clientOrderId

Every call that places, replaces or protects an order carries a clientOrderId that you choose. It names one trading intent.
  • Create a new id when the trader makes a new decision.
  • Send the same id when you retry that decision, whatever went wrong the first time.
  • Never reuse an id for a different decision.
If the first attempt timed out, retry with the same id. Either the order is placed now, or the answer is 409 because it was placed the first time. Both outcomes are correct, and neither doubles the trader’s position. Cancels don’t take an id. A cancel is already safe to repeat at the market, so you can send it again after a partial failure.

Venue writes: Idempotency-Key

Every write under /api/partner/venues/{venueId}/… takes an Idempotency-Key header of 1 to 128 characters: saving an instrument, a route or a group, publishing a risk policy, issuing an account, moving money on one, resetting, halting, advancing a stage, registering a webhook or sending it a test ping. A write without one is refused with 400 idempotency_key_required. Three writes take no key: removing a webhook, and updating the brand or its logo.
What a repeat returns depends on the write: The Legacy Partner API carries the same rule in the body instead of a header: a referenceId on issuing, resetting and balance operations.

Side by side