Skip to content
Blog

Hotel and flight booking API: one trip, two bookings

Tekravel Editorial
Written with the help of AI

The ticket reads "add hotels to the flight flow, one checkout, one total". It is a reasonable request from a product manager and it sounds like a day's work, because you already have flight search and you already have a payment page. Three weeks later the team is arguing about what should happen when the airline confirms and the hotel does not. A hotel and flight booking API is not one integration with two kinds of result. It is two integrations that share a basket.

The sooner the code admits that, the less of it gets rewritten. What follows is the part the integration guides skip: how the two halves differ, which one to commit first, and what a trip has to be in your data model.

The two halves do not behave alike

Both come back as JSON with a price and a reference, so they look alike on the wire. They are not alike in what they promise you once you have the reference.

QuestionFlightHotel
What you hold after bookingA reservation (PNR) that is not yet a ticketA confirmation that is usually already the thing you sold
How long the price is goodUntil the fare is re-priced at booking, which can differ from the searchUntil the rate expires, and a rate can change between availability and book
What confirms itTicketing, often against a time limitThe supplier's confirmation, sometimes instant, sometimes pending
How it is undoneA void if caught early, otherwise a refund under fare rules, often with a penaltyA cancellation under the rate's own policy, free until a cut-off on many rates
What changes the number lateFare, taxes, sometimes the currency of the fareTaxes and fees paid at the property, the board basis, the room actually allotted

You can disagree with a row, since suppliers differ, but not with the shape of it: one half has a ticketing step and the other has a cancellation window, and they do not line up in time. We covered the flight side of the sequence in flight booking API integration and the slow-supplier problem on the hotel side in hotel availability API client design. This piece starts where those end, at the join.

Which one do you book first?

Nobody tells you this is a design decision, and it is the one that sets what a failure costs.

Say a customer buys a flight and a hotel for the same dates. You send one booking and then the other. Three things can happen: both work, or one fails, or one fails after the other has succeeded. The first is a good day. The other two decide your support queue.

If you ticket the flight first and the hotel then refuses, you have a customer with a seat to a city and no room, who has already been charged, and a refund on a ticket that carries a penalty. If you book the hotel first and the flight then fails, you hold a room you can often cancel for free, so the repair is cheap. The reverse risk is real too, since a hotel rate that cannot be cancelled is the worse thing to hold, so read the cancellation terms on the rate before you let it go first.

This is a rule of thumb, not a law, and the point is that you should pick the order on purpose. Commit the half that is easier to undo before the half that is harder, check the price on both just before either commits, and write down what you do for each of the three outcomes. Reviewers rarely ask. Customers always find out.

One trip, two bookings

The shape that holds up is a trip record that owns two bookings, each with its own reference, its own status and its own terms. The customer sees one total. Your database sees two rows, and the total is a sum you compute, not a thing that exists at the supplier.

Keep the two statuses separate. "Confirmed" for the hotel and "ticketed" for the flight are not the same state, and a single status column that flattens them will, sooner or later, say "booked" over a half-booked trip.

Keep the two sets of change terms separate as well, and show them. A displayed total hides that moving the dates is a free edit on one half and a fee on the other. If your front end shows "change dates" as a single button, decide what it does when only one half can move, before a customer finds out for you. The same applies to markup: if you add yours per service, as most sellers do, the trip total is two markups, and a refund on one half needs to know which markup it is returning. Money is where a joined trip gets expensive, because the lines settle on different timelines, and a refund on a flight does not arrive when the hotel's cancellation does.

Where this platform sits

Plainly: the platform exposes flight and hotel APIs, and access starts as a conversation rather than a self-serve key. Services are switched on per tenant, so a tenant that sells hotels and not tours does not carry the tour surface. Nothing here promises a single call that books both halves atomically, and you should not design as if it did. Treat them as the two bookings they are, under a trip you own.

If you want to see the actual calls and terms before building around them, start from the travel APIs page and bring the order you intend to book in. If you are still deciding what free access gets you, free hotel booking API sets out the kinds of free.

What getting it wrong costs

The expensive version is the quiet one. A customer is ticketed to a city and the room is gone, and the first you hear of it is a message at night, from an airport. Cheaper but still real: a checkout that shows one reassuring total and then, after a price check, a second number the customer did not agree to; a refund that returns the flight and forgets the hotel; and a status that says "booked" while the supplier says otherwise.

None of that needs a clever fix. It needs the trip to be a real object, the order to be a decision somebody wrote down, and a re-check of both prices at the last moment before either one commits. Build that once and the checkout can look as simple as the ticket asked for.

Tekravel Editorial

Travel technology desk

The Tekravel travel-technology desk writes for the trade: agency owners, consolidators and the developers who integrate them. Every article is checked against the platform it describes before it is published.