Skip to Content
OpenRoam Docs

SDKs

Official OpenRoam client libraries for eight languages, generated from the API specification.

Private beta

The SDKs are in private beta and not on public package registries yet. OpenRoam sends you the release files to install. Before version 1.0 the API of the clients can change between minor versions.

OpenRoam publishes one client library per language, all generated from the same OpenAPI specification and released together under one version number.

LanguagePackage
TypeScript and JavaScript@openroam/sdk
Pythonopenroam
Gogithub.com/OpenRoamHQ/openroam-go
PHPopenroam/sdk
Javacom.openroam:openroam-sdk
.NETOpenRoam
Dartopenroam
Rubyopenroam

Every SDK:

  • names the Sandbox and Production environments and accepts any other base URL;
  • sends your key in X-Partner-Key;
  • creates an Idempotency-Key for each order and lets you pass your own;
  • raises one error type with the API's code, name, message, requestId and details;
  • has an opt-in retry layer for network errors, 429 and 502, 503 and 504, which repeats purchases with the same Idempotency-Key;
  • includes a helper that verifies webhook signatures.

TypeScript example

import { OpenRoam, OpenRoamError } from '@openroam/sdk';

const openroam = new OpenRoam({
  apiKey: process.env.OPENROAM_API_KEY,
  environment: 'sandbox', // the default is 'production'
});

const found = await openroam.esims.search({ countryCode: 'JP' });
const offer = found.items[0]?.offers[0];

if (offer) {
  const items = [{ publicId: offer.publicId, quantity: 1, inputs: {} }];
  const quote = await openroam.esims.quote({ currency: 'USD', items });

  try {
    const order = await openroam.esims.order(
      { currency: 'USD', items },
      { idempotencyKey: myPurchaseId }, // a UUID you stored for this purchase
    );
    console.log(order.id, order.status, quote.total);
  } catch (error) {
    if (error instanceof OpenRoamError && error.code === 16000) {
      // The wallet could not pay: top up, then repeat with the same idempotency key.
    }
    throw error;
  }
}

Each product is a property of the client: esims, airtime, utilities, giftCards, hotels and flights, plus orders, orderItems, wallets, account, currencies, countries and mobileNetworks. Buying is always search, quote, order.

Each SDK's README covers installation and its own examples.

On this page