For developers at TMCs, OTAs, host agencies, and superapps who have to actually ship a booking flow, not just read a slide about one.
A clean travel API integration looks simple from the outside: search, price, book, confirm, service. Under the hood, every travel API integration is a distributed-systems problem with money attached. Prices move between the quote and the sell, suppliers time out mid-transaction, confirmations arrive asynchronously, and a duplicate booking is not a bug you can shrug off. Getting a travel API integration right is what separates a demo from a product your travelers can trust with their money.
This guide walks the travel API integration end to end, from auth and search to webhooks and idempotency, and then addresses the decision that shapes everything downstream: whether your travel API integration should sit on one unified API or stitch together many supplier APIs yourself. It is written for engineering teams at TMCs, OTAs, host agencies, and superapps who have to actually ship a booking flow.
Auth, keys, and environments
Every integration starts at the trust boundary. Most modern travel APIs, including Xeni's, use token-based auth: you exchange a long-lived API key or client credential for a short-lived access token, then send that token as a bearer header on each request. Treat the API key as a production secret. Keep it in a secrets manager, never in client-side code or a mobile bundle, and rotate it on a schedule. If your product is a superapp or a white-label site where a browser or app talks to travel endpoints, proxy those calls through your backend so the credential never ships to the device.
Plan for two environments from day one: sandbox and production. Sandbox lets you exercise the full search-book-confirm-cancel lifecycle against test inventory and test payment instruments without moving real money or holding real seats. Build and test everything in sandbox, then flip a base URL and a key set for production. Xeni exposes a sandbox for exactly this, so your team can .
Search and pricing calls
The search call is where most of your latency and most of your product feel live. You send a structured request (origin and destination or a hotel geography, dates, occupancy, cabin or room requirements) and receive a set of priced options. Two rules matter here.
First, search prices are indicative, not contractual. In air especially, the fare you see in a search response can change by the time you try to sell it, because inventory and pricing are recomputed downstream. Build a two-step flow: search returns candidates, then a price-check or pre-book call re-validates the exact option the user selected and returns the firm, sellable price and any change since search. Surface a clear message when the price moves rather than silently booking the new number. For a deeper look at the air-specific mechanics, see the flight booking API guide.
Second, cache with intent. Search responses go stale fast, so cache aggressively for list views and pagination but never treat a cached price as bookable. Always re-price the selected option immediately before booking. Xeni's search and pricing endpoints span 2M+ hotels, 900+ airlines, plus cars and activities through one schema, so your search layer is not maintaining a different request and response shape per supplier.
Booking and confirmation
Booking is the call that spends money, so it deserves the most defensive code in your stack. A typical sequence is: re-price the selected option, collect payment (or reference a stored payment token), then submit the book request with the priced option, the traveler details, and a payment reference. The response either confirms with a booking reference and supplier locator, or returns a well-typed error you can act on.
The single most important habit here is separating submission from confirmation. Some bookings confirm synchronously in the API response. Others, particularly air and certain hotel and activity suppliers, confirm asynchronously: the API accepts your request, returns a pending status and a reference, and the final confirmation arrives seconds to minutes later. Your integration must handle a pending state gracefully. Do not tell the traveler "confirmed" until you have the confirmed status, and do not fire off a retry that creates a second booking while the first is still settling.
Webhooks and async events
Polling a pending booking works, but it is wasteful and slow. Webhooks are the better pattern: you register an endpoint, and the platform pushes an event when a booking confirms, a ticket issues, a supplier cancels, or a schedule changes. Your integration should:
- Verify every webhook using the signature or shared secret the platform provides, so an attacker cannot forge a "confirmed" event.
- Respond fast and process later. Acknowledge the webhook with a 200 immediately, then do the real work (updating your database, emailing the traveler) on a queue. Slow webhook handlers get retried and cause duplicate processing.
- Be idempotent on receipt. Platforms retry webhooks on any non-2xx or timeout, so the same event will sometimes arrive twice. Key your handler on the event ID and ignore repeats.
Schedule changes and supplier-initiated cancellations are not edge cases in travel, they are routine, so treat inbound events as a first-class part of the integration rather than an afterthought. Xeni pushes booking and status events and pairs them with operational alerts, so your ops team sees a failed or changed booking without a customer having to report it first.
Error handling, timeouts, and idempotency
This is the section that separates a demo from a production integration.
Timeouts
Travel calls can be slow because your request is fanning out to real suppliers. Set explicit, generous timeouts on booking calls and shorter ones on search. The dangerous case is a booking request that times out on your side: you do not know whether the booking succeeded. Never blindly retry it.
Idempotency
This is the guardrail against double-charging and double-booking. Send an idempotency key (a UUID you generate per booking attempt) on every write call. If a response never arrives and you retry with the same key, the platform returns the original result instead of creating a second booking. If your provider supports idempotency keys, use them on every mutating request without exception. If a call genuinely fails, reconcile before you retry: query the booking by your reference to learn its true state, then act.
Typed errors
Handle the difference between a retryable error and a terminal one, and route each accordingly:
- Retryable (a network blip, a 503, a supplier timeout): retry with exponential backoff, capped.
- Terminal (price no longer available, sold out, invalid passenger): surface it to the user, do not retry.
- Ambiguous (a write that timed out): reconcile by querying true booking state before you do anything else.
Log the supplier-level detail on every branch so support can trace a specific booking.
One unified API costs less to maintain
Illustrative annual engineering effort to build and maintain supplier connections. A unified API consolidates auth, schemas, webhooks, and supplier change management into one integration surface; direct integrations repeat that work per supplier.
One unified API vs many supplier APIs
Here is the architectural fork. You can integrate suppliers directly, one API at a time, or you can integrate one unified API that aggregates them. The tradeoff is real and worth stating plainly.
Direct supplier APIs give you the tightest control and, at very high volume on a single supplier, the best economics. The cost is integration surface. Every supplier has its own auth, its own request and response schemas, its own booking semantics, its own error taxonomy, its own sandbox, and its own breaking changes on its own timeline. Three suppliers is three of everything. A dozen is a standing team whose entire job is keeping connectors alive. This is also the classic tradeoff against the legacy networks, covered in travel API vs GDS, and if you are weighing the incumbents directly, Amadeus vs Sabre vs Travelport walks through how they differ on content and integration model.
A unified API collapses that surface to one. One auth flow, one search schema, one booking model, one webhook format, one sandbox. You add supplier breadth without adding integration work, because the aggregator absorbs each supplier's quirks and normalizes them behind a stable contract. For a TMC or OTA migrating off a rigid GDS, or a superapp that needs to launch travel in a quarter rather than a year, the unified path is usually the faster and cheaper route to breadth. The comparison guide best travel APIs breaks down how to evaluate providers, and if you are shortlisting vendors, the best travel API overview and the B2B travel platform page show what a single-contract stack actually covers.
A unified layer tends to win when you can check off several of these at once:
- You need multiple product lines (hotels, air, cars, activities) live in one release, not sequentially.
- Your team is small enough that maintaining per-supplier connectors would crowd out product work.
- You want breadth now and the option to add your own negotiated contracts later, without re-architecting.
- Speed to market matters more than squeezing the last basis point out of a single high-volume supplier.
If you are building the surrounding portal or agent-facing UI on top of that layer, B2B travel portal development covers how the integration and the front end fit together.
Xeni is built for this: REST APIs over 2M+ hotels, 900+ airlines, cars, and activities through one contract, with the option to bring your own negotiated supplier contracts into the same layer, or use Xeni supply, or both. You also choose the money model: Xeni as Merchant of Record so you skip standing up payments and fraud yourself, or bring your own payments as volume scales. That flexibility is the point of the travel API layer.
Sandbox, testing, and servicing
Testing. Beyond the happy path, script the failure modes explicitly in sandbox: price change between search and book, supplier timeout, async confirmation that lands minutes later, a duplicate submission with the same idempotency key, and a supplier-initiated cancellation delivered by webhook. If your test suite only covers the clean booking, you will meet these cases for the first time in production, with a customer's money in flight.
Servicing. A booking is not done at confirmation. Real integrations have to modify and cancel: change a date, add a passenger, cancel within a fare's rules, process a refund. Model these as first-class operations from the start, because retrofitting cancellation logic after launch is painful. Xeni's operations layer covers booking, confirmation, modification, and cancellation with the emails and alerts attached, so servicing is part of the platform rather than something you rebuild.
Go-live checklist
Before you flip production traffic on, confirm you have:
- Secrets in a manager, keys scoped, and a rotation plan.
- Two-step pricing: search then re-price before every book.
- Idempotency keys on every mutating call.
- Async handling: a real pending state, no premature "confirmed."
- Signed webhooks, fast-ack, idempotent processing on a queue.
- Timeout and retry policy that never blindly retries a booking.
- Reconciliation: a way to query true booking state after any ambiguous failure.
- Servicing paths: modify, cancel, and refund tested in sandbox.
- Observability: logs keyed to your booking reference and supplier locator, plus operational alerts.
- Failure drills run in sandbox: price move, timeout, duplicate, supplier cancel.
Global business travel spending has climbed back past its pre-pandemic peak (GBTA), online and API-led distribution keeps taking share from legacy channels (Phocuswright), and IATA's NDC standard continues to push airline retailing toward modern, content-rich APIs (IATA). The demand to sell travel through software is not the constraint. Shipping a reliable integration is, and that is a solved problem when the money-handling and supplier breadth sit behind one contract.
Frequently Asked Questions
Own your booking flow, on one integration
The hard part of selling travel in software was never the search box. It is handling money safely, absorbing supplier quirks, and servicing bookings after the sale, across breadth you can maintain. Xeni gives your engineers REST APIs, a sandbox, webhooks and operational alerts, and unified inventory behind one contract, with the choice of Merchant of Record or your own payments.



