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
- Call
POST /v1/scanner/device-checkbefore payment. - Call
POST /v1/ordersafter payment succeeds. - Render
order.setup.iosUniversalLink& QR on your order page. - Call
POST /v1/esims/:iccid/topupwhen 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,
};
}REST Endpoint Reference
Sign in as Partner to run live requestsPOST
/api/v1/ordersProvision eSIM + Setup Bundle
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 401
UNAUTHORIZED / INVALID_API_KEYMissing, malformed, or revoked Authorization: Bearer rg_... header.HTTP 403
PLAN_REGION_RESTRICTEDRequested destination requires the $2,000 Worldwide plan (current key is on $1,000 Half-World).HTTP 404
ICCID_NOT_FOUND / PLAN_NOT_FOUNDRequested ICCID or planId does not exist.HTTP 429
RATE_LIMIT_EXCEEDEDExceeded plan throughput (600 RPM on $1k Yearly, 2,400 RPM on $2k Yearly).