Errors
eSIM API error handling.
A failed request should leave you with one decision: retry the same intention, or stop. It should not leave the customer with two eSIMs for one booking.
Code and responses on this page are illustrative. They show the shape of an integration. Confirm the production schema in your Cuppa account before you ship.
Read the status before you retry
If the response is not a success, store the status and the reference you sent. A timeout is the awkward case, because you may not know whether the fulfilment was created. Look up the reference before you send a second create.
What the person should see
Your interface should say that connectivity is not ready yet. Do not invent an installation code. When a later success or webhook arrives for that reference, then show the installation details.
- Keep the API key on the server
- Log the reference, not the key
- Make retries idempotent on your reference
- Surface a pending state instead of a fake QR code