RoamGrid APIB2B eSIM Infrastructure
Partner Integration & REST API Reference · v1.4.0

Connect Your eSIM Website to RoamGrid API

Complete technical documentation for partners on our $1,000/yr Half-World, $2,000/yr Worldwide, and Monthly plans.

1. Authenticate Every Request

Pass your issued partner key in the Authorization header. Use rg_sandbox_... during staging and rg_live_... in production.

Base URL: https://roamgridapi.store/api/v1
Authorization: Bearer rg_live_YOUR_API_KEY
2. Storefront Checkout Flow
  1. Call POST /v1/scanner/device-check before payment.
  2. Call POST /v1/orders after payment succeeds.
  3. Render order.setup.iosUniversalLink & QR on your order page.
  4. Call POST /v1/esims/:iccid/topup when buyers extend data.
3. Verify SM-DP+ Webhooks

Verify X-RoamGrid-Signature with HMAC-SHA256 before marking eSIMs Installed.

const sig = crypto
  .createHmac("sha256", process.env.RG_WEBHOOK_SECRET)
  .update(rawBody).digest("hex");
Partner Storefront Integration Example (Order + Scanner + Setup)
// Next.js / Express backend route on YOUR eSIM website
export async function fulfillCustomerEsim(planId: string, customerEmail: string) {
  const orderRes = await fetch("https://roamgridapi.store/api/v1/orders", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.ROAMGRID_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ planId, customerRef: customerEmail }),
  });
  const { order } = await orderRes.json();

  return {
    iccid: order.sim.iccid,
    qrImage: order.setup.qrCodeDataUri,
    iosOneTapUrl: order.setup.iosUniversalLink,
    androidIntent: order.setup.androidIntentUri,
    manual: order.setup.manualEntry,
  };
}
POST/api/v1/orders

Provision eSIM + Setup Bundle

Request API Access

Orders an eSIM profile from the SM-DP+ pool and returns ICCID, LPA activation string, QR code SVG/PNG, and Universal iOS/Android setup links in one payload.

Request JSON Body
{
  "planId": "pln_jp_5gb_15d",
  "customerRef": "reseller_order_9012",
  "eid": "89049032005008882600083419201122"
}
Example Response Schema
{
  "ok": true,
  "order": {
    "orderId": "ord_94f1c208a11b",
    "status": "RELEASED",
    "sim": {
      "iccid": "8944500918273645510",
      "lpaString": "LPA:1$smdp-apac.roamgridapi.store$RG-LIVE-4821-AC"
    },
    "setup": {
      "iosUniversalLink": "https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=...",
      "qrCodeDataUri": "data:image/png;base64,..."
    }
  }
}

Standard Error Codes & Plan Enforcement

HTTP 401UNAUTHORIZED / INVALID_API_KEYMissing, malformed, or revoked Authorization: Bearer rg_... header.
HTTP 403PLAN_REGION_RESTRICTEDRequested destination requires the $2,000 Worldwide plan (current key is on $1,000 Half-World).
HTTP 404ICCID_NOT_FOUND / PLAN_NOT_FOUNDRequested ICCID or planId does not exist.
HTTP 429RATE_LIMIT_EXCEEDEDExceeded plan throughput (600 RPM on $1k Yearly, 2,400 RPM on $2k Yearly).