Getting Started
Quickstart
Five calls, from an API key to a confirmed sandbox booking and back out again.
Everything below runs against sandbox. Sandbox bookings are always test
bookings: they never reach a live supplier endpoint and never cost anyone money. Swap in a gws_live_… key when you are ready, and read Sandbox and live first.
1. Confirm the Key and Its Mode
The cheapest call in the API. It tells you who the key belongs to and which mode it runs in.
If mode is not what you expected, stop here — a sandbox key never reaches live data,
but a live key most certainly reaches live suppliers.
2. Find a Property
There is nothing to sync first: hotels are available as soon as you ask. Take a propertyId from the response — that is the aggregator id search and booking use.
3. Search for Rates
One search, every source that holds the property. Each rate comes back with a rateKey — the thing you will book with.
Keep the rateKey and the price.sell figure. You need both for the next step,
and the key is good for about 30 minutes.
4. Book
Booking redeems the rate key. Idempotency-Key is required: it is what makes a
retried request safe. expectedPrice is your guard against a price that moved between
search and book — if the live total is higher, the call is rejected rather than quietly booked.
5. Cancel
simulation has no default: every cancel must say whether it is a preview or the
real thing. Send true first if you want the fee before committing.
A 200 carrying status: "CANCELLED" is the only answer that means the
booking is gone. Anything else is covered on the Cancel page.
Next
Read Request conventions for pagination, idempotency and rate limits, then Search for everything the search body can do — destinations, geo radius, filters and sorting.