latestOpenAPI 3.1.02026-08-21211181.8 KB

e5d7af502419

Hotels

Build a hotel booking link

Returns the wego.com checkout URL for a chosen rate. Pure build: no upstream call, no booking, no payment – only 400/401/429.

get/v1/hotels/{hotelId}/rates/{rateId}/booking-link

Path parameters

hotelIdinteger required

The hotel's numeric id (a positive integer), as carried by hotel search results (results[].hotelId) and embedded in a rate id.

rateIdstring required

The rate's composed booking reference from GET /v1/hotels/{hotelId}/rates (rates[].id), forwarded verbatim. Grammar: {searchId}:hotels.wego.com:{hotelId}:{hash}:{idx} – checkout derives the search from the first segment, which is why the searchId query param is optional here. Opaque: do not construct or reorder it.

Query parameters

searchIdstring

Optional. The search the rate belongs to. When omitted it defaults to the rate id's first segment (exactly how the checkout page recovers it), so you rarely need to send it; when sent it must equal that segment or the request is rejected 400.

localestring

Checkout page language tag (e.g. en, ar). Defaults to en.

guestsstring

Optional packed occupancy token forwarded to checkout as guests. Grammar ^[1-9][0-9](:[0-9]+)$: the first segment is the adult count (>= 1), then one child age per following :-segment – e.g. 2:4:9 is 2 adults plus children aged 4 and 9. The checkout-URL twin of the create body's adults / childrenAges.

countryCodestring

Optional ISO 3166-1 alpha-2 code forwarded verbatim to checkout as its country_code (the guest's booking country). It does NOT pick the wego.com host – that is siteCode. Send countryCode for the traveller's country, siteCode for the Wego market/domain.

siteCodestring

Wego market (point of sale) as a 2-letter code, e.g. AE; defaults to US. It selects the wego.com CHECKOUT HOST/domain – distinct from countryCode, which is passed through to the page as the guest's booking country and does not change the host.

Response

The checkout URL, and the fact that it expires.

bookingUrlstring required

The wego.com hotel checkout URL for the rate.

expirestrue required

Always true: this link is search-scoped and stops working when the rate's search expires. A stale link loads an empty checkout page rather than erroring, so treat it as short-lived and re-price the rate to get a fresh one.