Email an eSIM
const url = 'https://api.roamex.com/v1/esims/fulfill';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"esimId":"00000000-0000-4000-8000-0000000000c1","email":"traveller@example.com","name":"Sam Example","language":"nl"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.roamex.com/v1/esims/fulfill \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "esimId": "00000000-0000-4000-8000-0000000000c1", "email": "traveller@example.com", "name": "Sam Example", "language": "nl" }'Emails an eSIM’s QR code and install details to a traveller, with your branding. Calling it again for the same eSIM resends it, to the same or another address. After 20 sends of one eSIM further calls are refused with 429 FULFILL_LIMIT_REACHED, which does not clear with time.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The traveller’s address. Trimmed and lower-cased.
The traveller’s full name. The first word is the first name and the rest the last name; each may be up to 100 characters.
Used together with lastName instead of name when both are set.
Email language: en, nl, es, de, it, fr, pl, pt, tr, el, cs or ro. A regional tag such as de-DE uses its base language. Any other value sends in English.
Example
{ "esimId": "00000000-0000-4000-8000-0000000000c1", "email": "traveller@example.com", "name": "Sam Example", "language": "nl"}Responses
Section titled “Responses”The email was sent.
object
true when this eSIM had been sent before.
object
Empty when no name was given.
The traveller’s status page for this eSIM.
Example
{ "success": true, "fulfilled": true, "isResend": false, "recipient": { "email": "traveller@example.com", "name": "Sam Example" }, "statusPageUrl": "https://roamex.com/esim/example-status-token", "message": "eSIM sent successfully to traveller@example.com"}Headers
Section titled “Headers”Calls allowed per minute for this endpoint group.
Calls left in the current minute.
When the current window ends, in Unix seconds.
INVALID_JSON: the body is missing or not a JSON object.MISSING_ESIM_ID:esimIdis missing or not a string.MISSING_EMAIL:emailis missing or not a string.INVALID_EMAIL:emailis not a valid address or is longer than 254 characters.INVALID_NAME: the first or last name is longer than 100 characters.ESIM_CANCELLED: the eSIM is cancelled.ESIM_NOT_READY: the eSIM is not provisioned yet. Wait and try again.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}AUTH_ERROR: the key is missing, malformed, unknown or revoked. The message says which, for example Missing Authorization header, Invalid Authorization header format. Use: Bearer <api_key>, Invalid API key format or Invalid API key.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "AUTH_ERROR", "message": "Invalid API key" }}AUTH_ERROR: the account is suspended (Your account is suspended. Please contact support.) or rejected (Account is not approved for API access).
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}ESIM_NOT_FOUND: no eSIM with this id belongs to your account.NOT_FOUND: the API is switched off on the platform.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}ESIM_EXPIRED: the eSIM has expired and its install code no longer works.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}PAYLOAD_TOO_LARGE: the Content-Length header is over 100 KB.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}Branch on the code, not on the status.
FULFILL_LIMIT_REACHED: this eSIM has been sent 20 times. This does not clear with time; do not retry.RATE_LIMITED: see the shared errors.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}Headers
Section titled “Headers”Seconds to wait before retrying.
EMAIL_FAILED: the email was not sent. The message says whether the attempt counts against the 20 sends.FULFILL_FAILED: the send could not be processed.INTERNAL_ERROR, orAUTH_ERRORwith status 500: see the shared errors.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}ESIM_NOT_READY: the eSIM’s install data could not be retrieved just now. Nothing was sent. Retry with backoff.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}
