Idempotency
Networks fail. A request times out, you retry, and now you’ve provisioned two eSIMs. Idempotency keys make that impossible.
How it works
Section titled “How it works”Every mutating request (POST / DELETE) accepts an Idempotency-Key header. Send a unique value per
logical operation:
curl -X POST https://api.sandbox.interglobe.io/v1/esims \ -H "Authorization: Bearer $IG_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "product_id": "prod_eu_5gb" }'- Retry with the same key → you get the original result back, and the operation runs only once.
- A request with that key is still processing →
409 idempotency_in_progress; wait briefly and retry. - Reuse a key with a different body →
400 idempotency_key_reused. Keys are 1:1 with a request.
Keys are retained for 24 hours.
You get it for free in the SDK
Section titled “You get it for free in the SDK”The TypeScript SDK attaches a fresh Idempotency-Key to every mutating request
automatically — so SDK retries are always safe. Pass your own only if you want to control the key (for
example, to make a retry across process restarts idempotent).
Related: idempotency_key_reused,
idempotency_in_progress.