Skip to main content
Back to Blog
Integration

The Hotel-X Booking Flow: Search, Quote & Book

Travelgate's Hotel-X Pull Buyers API enforces a strict three-step sequence for every hotel reservation. Understanding why — and implementing it correctly — is the single most important integration decision you will make.

Stunning Club Engineering March 2026 9 min read
Three-step booking flow visualisation
01Search

Checks live availability from one or more suppliers for the requested dates, occupancy, and destination. Returns a list of options each with a unique optionRefId.

02Quote

Revalidates a specific option by its optionRefId — confirming the current price, updated cancellation policy, and payment type before any money changes hands.

03Book

Confirms the reservation with the supplier using the optionRefId returned by Quote, plus passenger details and payment information. Returns a booking reference.

Why Three Steps?

Hotel inventory is volatile. A rate returned by a search query can change — or the room can sell out entirely — within seconds of the search completing. The three-step flow exists to protect both the buyer and the supplier from transacting on stale data.

Search is a broad availability sweep — fast but not a contract. Quote is a point-in-time revalidation that confirms the current price and cancellation policy for a specific option. Only then should Book be called — and only with the optionRefId returned by the most recent Quote, not the one from Search.

Skipping Quote and booking directly from a Search result is the most common integration mistake. It results in price mismatches, unexpected cancellation terms, and failed bookings — all of which are avoidable.



Step 2 — Quote

Quote accepts the optionRefId from Search and calls the supplier to revalidate the current price and cancellation policy. It always returns a new optionRefId — this is the one that must be used in Book.

Quote is where DeltaPrice is enforced. If the revalidated price exceeds the Search price by more than the configured tolerance (typically 1–2%), the Quote is rejected and the buyer must be notified before proceeding. Never silently absorb a price increase between Quote and Book.

Quote also returns the definitive cancellation policy — deadlines, penalty amounts, and whether the booking is refundable, non-refundable, or conditional. This must be presented to the user explicitly and confirmed before Book is called.


Step 3 — Book

Book accepts the optionRefId from Quote, passenger details (lead guest name, email, and any supplier-required fields), payment type, and — where required — card details. It returns a booking reference from the supplier plus Travelgate's internal reference, and a status.

The status field is critical. A successful Book returns OK, but some suppliers return ON_REQUEST — meaning the booking has been received but is pending supplier confirmation. This is not an error. The booking must be held in a pending state and the user notified that confirmation is incoming.

Never retry a Book call that timed out without first checking BookingQuery to confirm whether the booking was created. Double-booking is a serious operational and financial problem that is entirely avoidable with this check.


Session State & optionRefId

The optionRefId chain — Search → Quote → Book — must be maintained in server-side session state. Never pass it through the browser or store it in localStorage. It is a transaction token, not a display identifier.

Search returnsoptionRefId A — store in session
User selects optionPass optionRefId A to Quote
Quote returnsoptionRefId B — replace A in session
User confirmsPass optionRefId B to Book
Book returnsbookingReference — store in DB, clear session

Edge Cases

01

ON_REQUEST status

Hold the booking, notify the user, poll BookingQuery periodically or configure a webhook to receive the supplier's confirmation. Do not show success UI until status changes to OK.

02

DeltaPrice rejection

Surface the price change to the user with the original and new price displayed. Give them the choice to accept and proceed or abandon and restart search. Never absorb the increase silently.

03

Book timeout

Call BookingQuery with the Travelgate reference before retrying. A timeout does not mean the booking failed — the supplier may have confirmed it after your connection dropped.

04

NO_RESULTS on Search

Widen the search: try adjacent dates, remove board-type filters, expand the destination radius, or try a Multi Search across additional supplier accesses.


Cancellation Flow

Cancellation uses BookingCancel with the booking reference. Before executing, always call BookingQuery to retrieve the current cancellation policy and calculate the live penalty — policies can change and the penalty shown at booking time may differ from today's.

Present the penalty to the user explicitly and require confirmation before calling BookingCancel. Log both the query response and the cancellation confirmation in your audit trail.


Summary

The three-step flow is not bureaucracy — it is the mechanism that makes reliable, accurate hotel booking possible across hundreds of suppliers with volatile inventory. Respect the sequence, maintain the optionRefId chain in server-side session state, handle ON_REQUEST and DeltaPrice explicitly, and always check BookingQuery before retrying a failed Book.

Every edge case in the Hotel-X integration is predictable and documented. The integration challenges arise not from the API being complex, but from shortcuts taken against its design intent.

See it in action

Tanya runs the full Search-Quote-Book flow in every conversation. Ask her to find a hotel and watch each step happen live.

Try with Tanya
The Hotel-X Booking Flow Explained: Search, Quote & Book | Stunning Club — Stunning Club