List plans
const url = 'https://api.roamex.com/v1/plans?lang=nl';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"region":"JP","type":"one-time","page":1,"limit":20}'};
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/plans?lang=nl' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "region": "JP", "type": "one-time", "page": 1, "limit": 20 }'Lists the plans you can buy through the API at your price, cheapest first. Filter by country code or region slug, plan type and data size; a page holds up to 100 plans. A page past the end returns an empty plans list with total 0, so read total from a page that has plans.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Language of plan and destination names in the response: en, nl, es, de, it, fr, pl, pt, tr, el, cs or ro. Any other value, or none, gives English. It never changes which items are returned or any figure.
Example
nlRequest Body
Section titled “Request Body”Optional. An empty body lists every plan, 50 per page.
object
A 2-letter country code, or a slug from /regions. A country code also matches regional plans that include that country. Characters other than letters, digits, _ and - are removed first, and the rest must be 1 to 50 characters. An unknown region slug returns 400 INVALID_REGION; a country code with no plans returns an empty list. A non-string value is ignored.
one-time for fixed-data plans, unlimited for day passes. Any other value returns 400 INVALID_TYPE.
Smallest data amount, in bytes. A numeric string is accepted. A negative value is ignored. A value that is not a number returns 400 INVALID_MIN_DATA.
Largest data amount, in bytes. A numeric string is accepted. A negative value is ignored. A value that is not a number returns 400 INVALID_MAX_DATA.
Page number. A missing or non-numeric value means 1.
Plans per page. A missing or non-numeric value means 50; larger values are lowered to 100.
Example
{ "region": "JP", "type": "one-time", "page": 1, "limit": 20}Responses
Section titled “Responses”A page of plans.
object
object
Use as planId.
object
A country code, or a comma-separated list of country codes for a regional plan.
The country codes the plan covers.
object
0 when unknown.
Two decimals in GB, whole numbers in MB and KB, 0 B when unknown.
A day pass.
object
The full-speed data per day.
object
0 when unknown.
Two decimals in GB, whole numbers in MB and KB, 0 B when unknown.
object
Your price. For a fixed-data plan it is what /esims/purchase charges per eSIM. For a day pass it is a one-day rate, with perDay and note; the total for several days is not this rate times the days, and /esims/purchase returns it.
object
Euro cents.
Present on day passes only.
Present on day passes only.
unlimited is a day pass.
Whether eSIMs of this plan can be topped up.
object
When the validity period starts: at installation on a device, or at the first connection to a network. null when unknown.
The plan must be activated within this many days. null when unknown.
object
Matching items across all pages.
Example
{ "success": true, "plans": [ { "id": "00000000-0000-4000-8000-0000000000b1", "name": "Japan · 1 GB · 7 days", "region": { "code": "JP", "name": "Japan", "countries": [ "JP" ], "isRegional": false }, "data": { "bytes": 1073741824, "formatted": "1.00 GB" }, "validity": { "days": 7, "unit": "DAY" }, "price": { "amount": 450, "currency": "EUR", "formatted": "€4.50" }, "type": "one-time", "supportsTopUp": true, "activation": { "startsOn": "first_connection", "activateWithinDays": 180 } } ], "pagination": { "page": 1, "limit": 20, "total": 1, "totalPages": 1 }}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 not a JSON object.INVALID_REGION:regionis not a known country code or region slug.INVALID_TYPE:typeis notone-timeorunlimited.INVALID_MIN_DATA:minDatais not a number of bytes.INVALID_MAX_DATA:maxDatais not a number of bytes.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "INVALID_TYPE", "message": "Unknown type. Use 'one-time' or 'unlimited'." }}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}NOT_FOUND: the API is switched off on the platform. Every endpoint answers this before the key is checked, with the message This feature is not available.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "NOT_FOUND", "message": "This feature is not available." }}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}RATE_LIMITED: the account’s per-minute budget for this endpoint group is used up, or too many refused keys came from this IP address. Wait the Retry-After seconds.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "RATE_LIMITED", "message": "Rate limit exceeded. Please wait 42 seconds before retrying." }}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.
Seconds to wait before retrying.
DATABASE_ERROR: the plans could not be read.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}Transient. Retry with backoff.
PRICING_UNAVAILABLE: your account pricing could not be confirmed.REGION_LOOKUP_FAILED: the region slug could not be resolved.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}
