e5d7af502419
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.
Path parameters
The hotel's numeric id (a positive integer), as carried by hotel search results (results[].hotelId) and embedded in a rate id.
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
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.
Checkout page language tag (e.g. en, ar). Defaults to en.
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.
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.
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.