← Back to Blog

How Travel Agencies Can Issue eSIMs Through the Truely API

Developer working on laptop displaying API documentation with travel booking interface in background

The itinerary confirmation email is the most-read communication a travel agency sends to a client. Open rates run between 70% and 90% — far higher than any newsletter or promotional campaign. It's also the moment when a traveler is most engaged with their upcoming trip details: flight number, hotel confirmation, transfer instructions.

Truely's B2B API puts an eSIM QR code in that email. The traveler gets their data plan delivered in the same communication where they get their flight. No separate app, no separate account, no separate purchase flow.

What the Integration Requires

The Truely API is a REST interface with JSON payloads. A basic integration requires four components on the agency's side:

First, a webhook listener that fires when a booking is confirmed. Most corporate travel management systems (Concur, Cytric, KDS) have webhook support that can trigger on booking confirmation events. For agencies using GDS-based systems, a backend script that polls the GDS for confirmed bookings and triggers the webhook works equally well.

Second, a mapping function that extracts the destination country or region from the booking record and maps it to Truely's plan catalog. Truely's API includes a /v1/plans endpoint that returns available plans for a given ISO 3166-1 country code, with pricing and duration options. A simple lookup table maps GDS destination codes to ISO country codes — this is typically 20–30 lines of code for the destinations a given agency covers most frequently.

Third, a call to the /v1/esim/issue endpoint with the traveler's email address, destination country code, plan duration, and the agency's API key. The response returns a QR code URL and a text activation code. The QR code is valid for 72 hours from issue time.

Fourth, template logic in the agency's email system to embed the QR code image and activation instructions in the confirmation email. Most email templating systems (Postmark, SendGrid, Iterable) support conditional content blocks — the eSIM section appears only if a QR code URL is present in the email data payload.

The API Call in Detail

Here's what a typical eSIM issuance request looks like:

POST /v1/esim/issue
Authorization: Bearer {api_key}
Content-Type: application/json

{
  "traveler_email": "j.chen@company.com",
  "destination": "JP",
  "plan_duration_days": 7,
  "plan_type": "unlimited",
  "notify_traveler": true,
  "notification_template": "booking_confirmation"
}

The response includes a qr_code_url pointing to a hosted QR code image, an activation_code text string for manual entry on devices that can't scan QR codes, a plan_id for reference in the agency's booking record, and a valid_until timestamp.

The notify_traveler flag can be set to false if the agency wants to handle the email delivery themselves rather than using Truely's notification system. Most agencies prefer to send a single consolidated email rather than having Truely send a separate notification alongside the agency's own confirmation.

Plan Selection Logic

For a single-country booking, plan selection is straightforward: the agency specifies the destination country code and the trip duration, Truely's API returns the matching plan. For multi-country itineraries — which represent a significant share of corporate travel — the logic requires slightly more thought.

Truely offers regional bundles that cover multiple countries under a single plan. An APAC bundle covers Singapore, Thailand, Malaysia, Indonesia, Japan, South Korea, Taiwan, and Hong Kong under one plan. A European bundle covers 30 EU and EEA countries. For a traveler with stops in Singapore and Bangkok on the same trip, the APAC regional bundle is more cost-efficient than two separate country plans.

Truely's API includes a /v1/plans/recommend endpoint that accepts a list of destination country codes and trip dates, and returns the optimal plan recommendation (single-country or regional bundle) with pricing. Integrating this recommendation logic into the booking flow takes approximately two additional API calls — one to get the recommendation, one to issue the eSIM for the recommended plan.

Pricing and Margins for Travel Agencies

Travel agencies access Truely's API at wholesale pricing — typically 20–35% below the consumer prices listed on Truely's public pricing page, depending on monthly volume commitments. The agency sets their own retail price when embedding the eSIM offer in their booking flow.

The markup model is flexible. Agencies can:

For corporate travel management companies handling enterprise accounts, the eSIM cost is typically billed to the corporate travel budget as a line item alongside hotel and flight charges. Truely's API supports cost-center tagging in the issuance request, which allows automatic allocation to the correct travel budget without manual reconciliation.

Handling Cancellations and Changes

When a booking is cancelled or the destination changes, the issued eSIM plan needs to be updated. Truely's API handles this through the /v1/esim/cancel and /v1/esim/transfer endpoints.

Cancellation before the eSIM has been installed (before the traveler scans the QR code) results in a full credit to the agency's account balance. Cancellation after installation but before travel start is handled case-by-case based on the plan terms. Changes in destination — for example, a Tokyo trip rerouted to Singapore — trigger a transfer: the existing eSIM plan is cancelled, a new one is issued for the updated destination, and a new QR code is sent to the traveler.

These API calls can be triggered by webhook events from the GDS or booking system when a change or cancellation record is created. Agencies with automated ticketing workflows typically connect these events in the same integration pass as the initial booking confirmation webhook.

What the Traveler Experiences

From the traveler's perspective, the experience is simple: their booking confirmation contains a section titled "Your Data Plan" with a QR code and brief installation instructions. They scan the QR code at any point before departure — on their commute, the night before the trip, at the airport gate — and the eSIM profile installs in under two minutes. When they land, data works automatically.

They don't need to download the Truely app. They don't need to create a Truely account. They don't need to know what an eSIM is or how it works. The QR code and two-sentence instructions in the booking confirmation are sufficient for the majority of travelers.

For the minority who have questions or encounter issues, Truely's support team is accessible via the QR code landing page — the URL embedded in the email includes a support link with the traveler's plan details pre-loaded, so they don't need to find a booking reference to get assistance.

Getting Access to the API

API access is available to travel agencies and corporate travel management companies with a minimum monthly volume of 50 eSIM issuances. The onboarding process involves a technical discovery call, a sandbox environment for integration testing, and a production access agreement that specifies volume commitments and pricing tiers.

The sandbox environment mirrors the production API with test QR codes that generate real-looking but non-functional eSIM profiles — useful for testing the email rendering and the agency-side webhook logic without using live plan credits. Integration typically takes two to four weeks from initial technical call to production deployment, with Truely's API team available for technical questions throughout the process.

Interested in API access for your agency?

Get in Touch