Skip to main content
OnArrival

Build your travel integration with the OnArrival API.

Explore SDK examples, booking workflows and error handling. Request sandbox access to test the integration, then confirm the requirements for your production setup.

Quickstart

Search a flight in ~12 lines.

Stays, ground, activities and Travel Fintech take the same call shape. Learn the auth header and the offer model once; they don't change between products.

Install
npm i @onarrival/sdk
One SDK · every product
SDKoneflightsstaysgroundactivitiesfintechpayments
flights-quickstart.ts
import { OnArrival } from '@onarrival/sdk';

const client = new OnArrival({
  apiKey: process.env.ONARRIVAL_KEY,
  env: 'sandbox',
});

// Search across every connected supplier
const offers = await client.flights.search({
  from: 'BLR', to: 'LIS',
  depart: '2027-03-12',
  cabin: 'economy',
  pax: { adults: 1 },
});
Recipes

Build something real.

Use these examples to plan your integration. Confirm the supported calls and supplier conditions in the API reference.

01

Sell a flight + insurance bundle in one checkout

Shop live air inventory, price a CFAR policy against the exact offer, and settle both on one payment intent. One booking comes back.

flights.searchbundles.createfintech.quotepayments.capture
02

Rebook a disrupted passenger automatically

Subscribe to schedule changes and cancellations, then exchange the affected segment for the best protected alternative inside your own SLA. No agent in the loop.

disruption.subscribeflights.exchangewebhooks.deliver
03

Settle multi-currency payouts to suppliers

Capture the traveller in their currency, lock FX at booking, and reconcile each supplier leg to the cent against a double-entry ledger you can export nightly.

payments.capturefx.lockledger.settlewarehouse.sync
04

Embed a full trip: air, stay and ground

Air, stay and transfer share one offer schema, so you can search all three in parallel and compose the trip. The themed React checkout drops straight in.

flights.searchstays.searchground.searchbundles.create
Errors & idempotency

How the SDK handles the hard parts.

Travel infrastructure lives or dies on what happens when a supplier drops a connection mid-booking. One error shape, idempotency on every mutation, and failure modes you can rehearse in sandbox.

502 · the one error object
retryable
{
  "error": {
    "code": "supplier_connection_dropped",
    "primitive": "flights",
    "message": "Supplier closed the session before capture confirmed.",
    "retryable": true,
    "retry_after_ms": 1200,
    "idempotency_key": "ik_8f2c1a90b4e7",
    "booking_state": "pending",
    "request_id": "req_01HX9Z4ABCDEF",
    "docs": "https://www.onarrival.com/docs"
  }
}
01

Idempotency keys

Every mutating call takes an idempotency key. Replay a capture after a timeout and you get the original result back, never a second booking, never a double charge. Keys are retained 24h.

02

Typed errors

One error model across flights, stays, ground, activities and fintech. Same fields, same codes, same retryable flag, so your handler is written once and works everywhere.

03

Webhook replay

Missed an event during a deploy? Re-deliver any event or range from the dashboard or API. Signed, ordered, and deduplicated by event id so consumers stay exactly-once.

04

Sandbox parity

Trigger the failure modes on demand with magic inputs: dropped sessions, slow suppliers, declined cards, schedule changes. The errors you handle in sandbox are the errors you get in prod.

Full error reference
CLIENTik_8f2cdroppedretry · same keyorder×1ledger

Same fields on every product. Pass the same idempotency_key on retry and the capture resolves once. The second request returns the first result, not a second booking.

Reference

What's in the docs.

These are the sections the full API reference covers. Request sandbox credentials to test the examples.

Illustration: two builders at a workbench assemble a miniature travel network — a paper plane, a model train and a small hotel — one placing the last piece while the other reads an open manual.
Get started
Quickstart
Set up credentials and make your first test booking.
Authentication
API keys, OAuth flows for embedded partners, and per-tenant scoping.
Sandbox vs production
How sandbox supplier inventory works, and the path to going live.
Products
Flights API
Shop, offer, book, exchange, refund across NDC, GDS and LCC.
Hotels API
Hotel, apartment and serviced inventory with dedupe and best-rate.
Buses API
Intercity bus routes, seat selection and operator booking flows.
Experiences API
Tours, attraction tickets and activities, with product-specific confirmation terms.
Travel Fintech API
Eligible trip protection, policy binding and claims workflows.
Payments & ledger
Capture, settlement, FX-lock, virtual cards.
Embedded
React SDK
Drop-in components themed to your design system.
React Native
Native checkout for iOS and Android, sharing one backend.
Web components
Framework-agnostic embeds for non-React stacks.
Operate
Webhooks
Booking events with signed delivery, retries and replay support.
Warehouse sync
Stream events to BigQuery, Snowflake, Redshift, or your own S3.
Disruption hooks
Schedule changes, cancellations and rebooks as code.
Trust
SOC 2 Type II
Annual report, available under NDA.
GDPR + DPA
Per-tenant DPA, DSAR tooling, sub-processor registry.
Customer-managed keys
BYOK on Enterprise tier, with key-rotation hooks.
Start building
Request sandbox access for your travel integration.

Related reading

All field notes →