An eSIM API looks like a small surface: list plans, place an order, get a profile, check usage. Six endpoints cover it in almost every provider’s documentation, and a competent developer can wire them up in a week — which is why so many eSIM API integrations ship on time and then fail in their first busy month.
The week is not the problem. The problem is what happens on the day the API returns a 200 with a profile that was already issued, or a webhook that never arrives, or an order that succeeds twice because your retry logic was correct and the network was not. Those are not edge cases; they are the normal weather of a production integration, and they are the part of the work that decides whether the thing survives a busy season.
What six calls does an eSIM integration actually need?
The shape is consistent across providers, even when the names differ.
| Call | What it does | Where integrations break |
|---|---|---|
| Catalogue | Lists plans by country, size, validity | Filtering and pagination on a large catalogue |
| Quote | Prices an order before you commit | Currency, tax, and whether the price is locked |
| Order | Places the order, returns a profile | Duplicate submission on retry |
| Status | Reports activation and usage | Polling frequency, and what “activated” means |
| Top-up | Adds data to an existing profile | Whether the same profile supports it at all |
| Cancel | Revokes an unused profile | Refund eligibility and timing |
One thing the table hides: a profile is not a file you host. GSMA describes eSIM as a SIM downloaded into an embedded secure element, and a phone can hold several profiles while only one is active at a time . That single-active rule is why your status model needs a device side as well as an order side, and why “activated” in a provider dashboard can mean something different from “working” on the customer’s phone.
Two of these deserve more attention than they usually get.
Quote is optional in most documentation and essential in practice. If you cannot lock a price before showing it to a customer, your checkout is quoting a number you may not honour. Ask whether the quote is guaranteed for a window, and what happens if the catalogue changes inside it.
Cancel is the one nobody builds until they need it. An unused profile that cannot be revoked is a refund you absorb. Build the cancel path in the same sprint as the order path, even if you do not expose it in your UI yet.
Does a sandbox tell you the truth about production?
No, and the gap is specific enough to list.
Speed. Sandbox responses come back in milliseconds because nothing is being provisioned. Production orders hit a real SM-DP+ and can take seconds, occasionally longer, and your timeout has to accommodate that without assuming failure.
Duplicates. Sandboxes rarely simulate the case where the same request ID arrives twice. Production does this constantly, because retries are how HTTP clients survive flaky networks. If your order call is not idempotent on your side, you will issue two profiles and pay for both.
Partial failure. A sandbox usually returns either success or an error. In production, an order can succeed at the network and fail in the response, leaving you with a profile you have paid for and no record of it. Reconciliation, not retry, is the answer.
Catalogue drift. Sandbox catalogues are static. Production catalogues change when a plan is withdrawn or repriced, and a checkout that hard-codes a plan ID will break quietly on the day that plan is retired.
The practical rule: treat the sandbox as documentation that runs, not as a test environment that predicts production. The only meaningful test is a small number of real orders with real money, watched closely.
Which four failure modes appear after go-live?
These four account for most of the incidents a new integration sees, and all four are design problems rather than API problems.
Duplicate orders from retries. Your client times out at three seconds, retries, and the first request was actually processed. Now two profiles exist for one customer. The fix is an idempotency key generated on your side and reused across retries, plus a reconciliation job that scans for orphaned profiles.
Webhooks that arrive late, twice, or not at all. Webhook delivery is best-effort in almost every implementation. If your order state depends on receiving one, you have built a system that fails silently. Use webhooks for speed and a scheduled status poll for truth, and make the state machine tolerant of the same event arriving twice.
Timeouts that are actually successes. A request that exceeds your timeout has not necessarily failed. It may have succeeded and simply been slow to respond. Treating a timeout as a failure and retrying is how duplicate orders happen. Log the request ID before you send, and reconcile ambiguous outcomes rather than guessing.
Profile delivery lag. Some providers generate the QR code or activation string asynchronously. Your order returns successfully, the customer sees a blank screen for twenty seconds, and your support queue grows. Know which model your provider uses and design the UI around it: an “issuing your eSIM” state is better than a spinner that might mean failure.
How do you handle a webhook that arrives twice?
Treat every event as a fact to be recorded, not a command to be executed. Stripe has documented the same rule for its own webhooks for years: an endpoint can receive the same event more than once , so the handler must be safe to run twice.
Store the event ID, check whether it has been processed, and if it has, update state idempotently rather than repeating the action. A webhook saying “profile activated” should set a field to active, not increment a counter or trigger a notification a second time.
The same discipline applies to your own outbound calls. Every order request should carry a key you generated, so that a retry is recognisably the same intent rather than a new one. This is a small amount of design work that prevents the single most expensive class of bug in this integration.
Are five tests enough before the first real order?
Yes, and none of them need a full QA cycle; each catches a failure that is expensive to find later.
- Two identical order requests. Fire the same payload twice with the same idempotency key. You should get one profile and two identical responses.
- A forced timeout on the order call. Lower your client timeout to something absurd and place an order. Then check whether a profile was created anyway.
- An order for a plan that has been withdrawn. Confirm your checkout fails gracefully instead of selling something that no longer exists.
- A status poll on an order that never activated. Confirm you can distinguish “not yet” from “failed”, because they need different customer messages.
- A cancel on an unused profile. Confirm the refund path works, and record how long the credit takes to appear.
When is an API the wrong choice?
Four cases where you should not build it.
You sell fewer than a few hundred eSIMs a month. The engineering and monitoring cost exceeds the margin difference between API and dashboard. Use the dashboard and revisit when volume justifies it.
Your checkout is a form, not a flow. If the purchase is a single step at the end of a static page, a white-label storefront will do the same job for less work.
You have no one to maintain it. An integration is a living thing: providers deprecate endpoints, add fields and change error formats. Without someone responsible for it, it will break silently on a quiet Tuesday.
You need it live next week. Realistic API integrations take weeks, not days, once you count the reconciliation logic and the edge cases above. If the deadline is immovable, a storefront ships faster.
Want the API docs and a sandbox key?
Talk to usWhere does this integration actually get hard?
The endpoints are not the hard part; the state machine is. Get three things right — idempotent orders, reconciliation instead of blind retries, and a status poll that backstops your webhooks — and the rest is CRUD around a catalogue.
Whether you build against an eSIM API or buy through a dashboard is a volume decision rather than a taste one. The commercial side of what you are integrating is in our per-country wholesale costs , and if you are still deciding whether to build at all, the reseller program comparison sets out what each account type asks of you before the first line of code. For the commercial context behind all of it, the wholesale eSIM primer is the place to start.
