openroam / sdk
Official OpenRoam Partner API client: eSIMs, airtime, utility payments, gift cards, hotels and flights.
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.4.5 || ^8.0
- guzzlehttp/psr7: ^2.0 || ^3.0
- psr/http-client: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- overtrue/phplint: ^9.0
- phpunit/phpunit: ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-04 22:14:21 UTC
README
Official client for the OpenRoam Partner API: eSIMs, airtime, utility payments, gift cards, hotels and flights. PHP 8.1+.
Install
composer require openroam/sdk:0.1.0-rc.2
This is a release candidate: install it by its exact version, as above; a plain install does not pick it up. Before 1.0 the API can change between minor versions; every change is listed in the changelog.
Quick start
<?php require 'vendor/autoload.php'; $config = OpenRoam\Configuration::getDefaultConfiguration() ->setApiKey('X-Partner-Key', getenv('OPENROAM_API_KEY')) ->setHost(OpenRoam\Webhooks::SANDBOX_URL); // or PRODUCTION_URL $esims = new OpenRoam\Api\EsimsApi(new GuzzleHttp\Client(), $config); $result = $esims->esimsSearch(country_code: 'JP');
Every product has its own class (AirtimeApi, EsimsApi, GiftCardsApi, HotelsApi, FlightsApi, UtilityApi, OrdersApi, WalletsApi...) and each follows search, quote, order.
Webhooks
use OpenRoam\Webhooks; use OpenRoam\WebhookSignatureException; Webhooks::verify( secret: getenv('OPENROAM_WEBHOOK_SECRET'), timestamp: $_SERVER['HTTP_X_OPENROAM_TIMESTAMP'], eventId: $_SERVER['HTTP_X_OPENROAM_EVENT_ID'], signature: $_SERVER['HTTP_X_OPENROAM_SIGNATURE'], rawBody: file_get_contents('php://input'), // exactly as received ); // throws WebhookSignatureException when invalid or older than 5 minutes
Good to know
- Orders need an
Idempotency-Key(a new UUID per purchase). After a timeout or a5xx, retry with the same key and the same body: it never charges twice. - Amounts are
{ amount, currency }.priceis what OpenRoam charges you,valuewhat your customer receives. - Errors carry
code,name,message,requestIdanddetails; quoterequestIdwhen you contact support. - Full API documentation: https://openroam.com (partner portal). Support: support@openroam.com.
This SDK is generated from the OpenRoam Partner API description; webhooks is hand-written. MIT licensed.