Assign a customer
Records which of your customers holds an eSIM. Customer details are not locked at order time — a reseller can buy fifty eSIMs as stock and fill in the buyer as each one sells. An unassigned eSIM is a valid state.
A customer already in your list with the same email or phone is reused rather than duplicated, so one person stays one record across all their eSIMs.
Path parameters
Section titled “Path parameters”| Name | Notes |
|---|---|
iccid |
The ICCID of the eSIM |
Request
Section titled “Request”| Field | Type | Required | Notes |
|---|---|---|---|
customer |
object | null | Yes | Send null to remove the current assignment |
customer.full_name |
string | Yes | 2–255 characters |
customer.email |
string | No | Must be a valid address |
customer.phone |
string | No | E.164 format, e.g. +905321234567 |
customer.external_ref |
string | No | Your own id for this customer, max 255 |
curl -X POST https://partner-api.esimfo.com/v1/esims/89852350326100409575/customer \ -H 'Authorization: Bearer esf_live_at_...' \ -H 'Content-Type: application/json' \ -d '{ "customer": { "full_name": "Ada Lovelace", "email": "[email protected]", "phone": "+905321234567", "external_ref": "crm-88213" } }'To detach:
curl -X POST https://partner-api.esimfo.com/v1/esims/89852350326100409575/customer \ -H 'Authorization: Bearer esf_live_at_...' \ -H 'Content-Type: application/json' \ -d '{ "customer": null }'Response 204
Section titled “Response 204”No content. A 204 means the assignment was stored.
This replaces, it does not merge. The object you send becomes the customer
record. Omitting email on a second call clears the address that was there —
send the complete object every time.
external_ref is the field to use. Put your own CRM or order id here and
you can reconcile eSIMs back to your records without matching on names.
Safe to repeat. Assigning the same customer twice is harmless, so this call needs no idempotency key.
Errors
Section titled “Errors”| Status | Code | Cause |
|---|---|---|
| 404 | not_found |
No such ICCID, or it does not belong to your account |
| 422 | validation_failed |
full_name too short, or a malformed email |
| 403 | insufficient_scope |
Key lacks the required scope |
