Get started

Environments & sandbox

Live and Sandbox share one URL; the token decides. Everything you can test without real money.

Live and Sandbox

Live spends real money on real eSIMs. Sandbox behaves the same way with test money and simulated eSIMs: same URL, same endpoints, same answers, same webhooks. The only difference is the token you send (one per environment).

To check which one a token belongs to, call /topup/config: it answers sandbox: true for a sandbox token. Webhooks carry environment as well.

Test balance

/sandbox/balance sets the test balance to any amount from 0 to 1,000,000 USD. The change is recorded as an ADJUSTMENT transaction, so the monthly statement still adds up. Set it low to test INSUFFICIENT_BALANCE and the balance.low webhook.

Sandbox endpoints refuse live tokens with SANDBOX_ONLY (HTTP 403), so they can never touch real money.

Simulated payment page

Top-ups work the same as in Live: /topup/create returns a paymentUrl. In the sandbox it opens Burj's simulated payment page with Pay and Fail buttons instead of the card form. Paying credits the test balance and sends balance.topped_up; then the payer is sent to your callbackUrl.

eSIM simulator

Real eSIMs change state when the traveller installs and uses them. In the sandbox you play those moments with /sandbox/esim/simulate. It runs the same code as real provider events, so status, usage, analytics and webhooks behave exactly as in production.

eventStatus afterWebhook
installed230 INSTALLEDesim.installed
activated250 ACTIVE (plan dates set)esim.activated
usageACTIVE, usagePercent of the data used (default 50)esim.usage_80_percent once it reaches 80%
expired300 EXPIREDesim.expired

Call /order/activate first: a real eSIM can't be installed before it has a profile (ORDER_NOT_ACTIVATED). Unlimited packages have no data usage to simulate (UNLIMITED_PACKAGE).

Failure simulation

Add simulate to /order/create with a sandbox token to rehearse what happens when the eSIM provider has a bad day:

  • PROVIDER_FAILURE: nothing is issued, HTTP 502 PROVIDER_ORDER_FAILED, the amount is refunded, and order.failed is sent.
  • PARTIAL_FAILURE: fewer eSIMs than asked come back with partial; the rest is refunded automatically.

simulate is a sandbox-only field: never send it with a live token.

Sandbox webhooks

The sandbox has its own webhook settings and signing secret. Its events carry "environment": "sandbox", so one endpoint can serve both environments and still tell them apart. Use /webhook/test to send a test event at any time, and /webhook/deliveries to see what was sent and how your server answered. See Webhooks.

To test X, do Y

To testDo
A successful orderSet a balance, then /order/create and /order/activate
Not enough balance/sandbox/balance with 0, then order → INSUFFICIENT_BALANCE
Provider failure and refund/order/create with simulate: "PROVIDER_FAILURE"
A partial ordersimulate: "PARTIAL_FAILURE" with quantity ≥ 2
A safe retrySend the same order twice with the same Idempotency-Key → Idempotent-Replayed: true
Install and activation/sandbox/esim/simulate installed, then activated
The 80% data alertevent: "usage", usagePercent: 85
Expiryevent: "expired"
Low balance alertSet lowBalanceThreshold in /webhook/configuration, then lower the balance under it
A top-up/topup/create → open paymentUrl → Pay (or Fail)
Your webhook endpoint/webhook/test, then /webhook/deliveries
Webhook retriesAnswer 500 from your endpoint, watch the delivery go to RETRYING, then resend it