Get started
Errors
Every error code, its HTTP status, and what your integration should do.
Handling errors
A failed call answers success: false with a stable code, a human message (safe to log, not to parse) and, for some codes, details.
- Branch on
code. Most new endpoints also use a matching HTTP status, but some older ones answer business errors with HTTP 200, so the status alone isn't enough. - Retry only what can succeed later:
RATE_LIMITED,IDEMPOTENCY_IN_PROGRESS,PROVIDER_ORDER_FAILED,ESIM_ACTIVATION_FAILED,INTERNAL_ERROR. - Show your own wording to end users. The table suggests what to tell them.
Error codes
| Code | HTTP | Meaning and what to do |
|---|---|---|
AUTH_UNAUTHORIZED | 401 | The token is missing, wrong or was rotated. Check the Authorization header. If you rotated the token, deploy the new one everywhere. |
AUTH_WRONG_OTP | 401 | The login code is wrong or expired. Ask for a new code with /login and try again. |
AUTH_PARTNER_INACTIVE | 200 | The partner account is not active yet. Wait for Burj to activate the account, or contact your account manager. |
RATE_LIMITED | 429 | Too many requests to this endpoint in the last minute. Back off and retry after a minute. Limits are per partner and per endpoint. |
PACKAGE_Quantity_NOT_FOUND | 200 | order/create was sent without packageId or quantity. Send both fields. |
INVALID_QUANTITY | 200 | quantity is not a whole number from 1 to 100. Split bigger orders into several orders of up to 100. |
INVALID_EXTERNAL_REFERENCE | 200 | externalReference is longer than 100 characters. Shorten your reference. |
PACKAGE_NOT_FOUND | 200 | Unknown packageId (or no longer sold). Reload the packages of the destination and use a current packageId. |
INSUFFICIENT_BALANCE | 200 | Not enough balance. details.balance and details.required tell you by how much. Top up (or set test money with /sandbox/balance), then retry. |
PROVIDER_ORDER_FAILED | 502 | The eSIM provider failed. Nothing was charged (details.refundedAmount). Retry with the same Idempotency-Key. |
INVALID_IDEMPOTENCY_KEY | 400 | The Idempotency-Key is empty, longer than 100 characters or not ASCII. Use a UUID. |
IDEMPOTENCY_KEY_REUSED | 422 | The same key was sent with a different order. Use a new key for every new order; reuse a key only to retry the same order. |
IDEMPOTENCY_IN_PROGRESS | 409 | The first request with this key is still running. Retry in a few seconds with the same key. |
ORDER_NOT_FOUND | 200 / 404 | Unknown order, or it belongs to another account (or environment). Check the orderId and that you use the token of the environment that placed it. |
ORDER_INVALID_STATUS | 200 | The eSIM was already activated. Read its install details with /{orderId}/data instead. |
ESIM_ACTIVATION_FAILED | 200 | The provider did not return the eSIM profile. Retry /order/activate a little later. |
INVALID_STATUSINVALID_SOURCEINVALID_KIND | 400 | A list filter has a value the API doesn't know. Use one of the values listed for that filter. |
INVALID_DATEINVALID_DATE_RANGEDATE_RANGE_TOO_LONG | 400 | from / to is not YYYY-MM-DD, is reversed, or spans more than 366 days. Send calendar days in Riyadh time, from ≤ to, at most 366 days apart. |
INVALID_CURSOR | 400 | The cursor did not come from a previous page. Pass pagination.nextCursor as it is. Start again without a cursor after changing filters. |
INVALID_MONTH | 400 | month is not YYYY-MM, or is in the future. Use a month from /statement/months. |
INVALID_INTERVALINVALID_DIMENSION | 400 | An analytics parameter has an unknown value. Use one of the documented values. |
WEBHOOK_URL_NOT_HTTPSWEBHOOK_URL_INVALID | 400 | The webhook URL is not a valid https:// URL. Use a public HTTPS endpoint. |
INVALID_EVENTSINVALID_THRESHOLD | 400 | Unknown event name, or a low-balance threshold that isn't a positive number. Pick events from availableEvents and send a number for lowBalanceThreshold. |
WEBHOOK_NOT_CONFIGURED | 400 | Test or rotate was called before a webhook URL was set. Set the URL with /webhook/configuration first. |
DELIVERY_NOT_FOUND | 404 | Unknown delivery id. Take the id from /webhook/deliveries. |
SANDBOX_ONLY | 403 | A sandbox endpoint was called with a production token. Use your sandbox (loginType "test") token. |
ORDER_NOT_ACTIVATED | 409 | The simulator was called before /order/activate. Activate the eSIM first, as you would in production. |
INVALID_EVENTINVALID_USAGE_PERCENTUNLIMITED_PACKAGE | 400 / 409 | Wrong simulator input, or a usage event on an unlimited package. Check event and usagePercent (0–100). Unlimited packages have no data usage. |
INVALID_AMOUNTAMOUNT_TOO_LOWAMOUNT_TOO_HIGHINVALID_CURRENCYINVALID_CALLBACK_URLPAYMENT_GATEWAY_ERRORINVOICE_NOT_FOUNDAMOUNT_MISMATCH | 400 / 404 / 502 | Top-up input outside the limits of /topup/config, a bad callback URL, or the payment gateway failed. Check the amount against /topup/config; retry gateway errors later. |
COUNTRY_NOT_FOUNDDUPLICATE_COUNTRYTOO_MANY_*NOT_IN_FAVORITESINVALID_ITEMS | 400 / 404 | The favorites list refers to an unknown or duplicated destination or package, or is too long. Send ids from /countries and /{countryId}/packages, each once. |
INTERNAL_ERROR | 500 | Something unexpected went wrong on our side. Retry. For orders, retry with the same Idempotency-Key. |