Programmatic provisioning
Programmatic eSIM provisioning.
Provisioning creates an eSIM for a plan and ties it to a reference you choose. That reference is yours: a booking, an employee, an order.
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.
The request
The example below asks for one plan and sends a booking reference. Your production fields may differ. Map them once, in one place, and reuse that mapper.
POST /v1/fulfilments
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"product_id": "example_plan",
"reference": "booking_4821"
}What you store
Store the fulfilment id, the status, your reference and the installation details. If the call fails, do not assume an eSIM was created. Check the error, then decide whether to retry the same reference.
HTTP/1.1 201 Created
{
"id": "ful_example",
"status": "provisioned",
"product_id": "example_plan",
"reference": "booking_4821",
"esim": {
"iccid": "8900000000000000000",
"activation_code": "LPA:1$example$CODE"
}
}After it succeeds
Return the installation details to your own user interface. Listen for later status changes on a webhook if you need the booking or employee record to update without another poll.