Idempotent requests
A dropped connection should never double-book. Send an Idempotency-Key header on a create request, and a retry with the same key replays the first response instead of creating a second resource.
How it works
Generate a unique key per logical operation (a UUID works well) and send it on the POST that creates an order or booking.
curl -X POST https://api.hermeseus.com/v3/HAPI/flights/orders \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 5f2b8c1a-3e4d-4a6b-9c7e-1d2f3a4b5c6d" \
-d '{ … }'If you repeat the request with the same key, the original response is returned again, with an Idempotency-Replayed: true header, and no new order is created.
Where to use it
Use an idempotency key on every request that creates or mutates an order or booking: creating an order, requesting ticket issuance, confirming, cancelling, or refunding. Reads and searches do not need one.
One key, one operation.
A key is remembered for 24 hours. Reuse the same key only for retries of the exact same request; use a fresh key for a genuinely new operation.
Was this page helpful?