Skip to content

Idempotency

Retry anything that spends money, without spending it twice.

Every route that spends money, holds inventory, sends mail or adds a record to the CRM requires an Idempotency-Key header. The key is checked at the edge, so a missing or malformed one never reaches business logic.

Idempotency-Key: 8f2a1c40-4a1e-4a7e-9a0f-2f1c0b7a91d3

Keys are free-form text between 8 and 255 characters. A UUID is a good default because it is unique without coordination, but anything stable and unguessable works.

What replaying does

  1. Same key, same body

    You get the original result back. The work is not repeated: no second order, no second charge, no second email. This is what makes a network timeout safe to retry.

  2. Same key, different body

    409, with a code naming the conflict — COMMERCE_IDEMPOTENCY_CONFLICT when creating an order, BOOKING_SELECTION_IDEMPOTENCY_CONFLICT when holding a selection, CRM_IDEMPOTENCY_CONFLICT in the CRM. The platform cannot tell which of the two requests you meant, so it refuses both rather than guessing.

  3. New key

    A new operation, every time. Reusing a key across two genuinely different bookings is the one mistake this header cannot protect you from.

Routes that require a key

Route What it does
POST /booking/selections Holds an offer with the supplier
POST /booking/quotes Freezes price, payment terms and policy
POST /booking/trips/{travelersTripId}/insurance-quotes Requests insurance quotes
POST /commerce/orders Creates an order from quotes
POST /commerce/orders/{orderId}/actions Submits checkout, creates a payment link
POST /commerce/orders/{orderId}/payments Takes a payment
POST /commerce/orders/{orderId}/confirmation-emails Sends confirmation mail
POST /commerce/payment-methods/actions Stores or links a card
POST /commerce/external-payments Records or reverses a payment taken elsewhere
POST /crm/travelers Adds a traveler
POST /crm/travelers/import Adds up to 200 travelers
POST /crm/travelers/{travelerId}/invitation Invites a traveler by email or SMS
POST /crm/travelers/{travelerId}/merge Merges a duplicate traveler
POST /crm/notes Adds a note
POST /crm/tasks Adds a task, or a template’s tasks

Everything not in this table is either safe to repeat — reads, and the last-write-wins updates — or guarded by state, like a segment that can only be approved once or a traveler that changes only with the revision you read.

Type to search…

↑↓ navigate↵ selectEsc close