Skip to content
This page is available in Markdown format. Markdown is recommended for AI consumption. See /api/hotels/get-hotel-rate-booking-link/index.md for this page, or/llms.txt for the full documentation index.

Build a hotel booking link

Returns the wego.com checkout URL for a chosen rate.

View as MarkdownView this page as plain text
Carries onwardwego.com URL
Settlesimmediately
Id expiresyes · 404 means search again

GET /v1/hotels/{hotelId}/rates/{rateId}/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.

Operation ID: getHotelRateBookingLink

Parameters

Name In Type Required Constraints Description
hotelId path integer yes 1..9007199254740991 The hotel’s numeric id (a positive integer), as carried by hotel search results (results[].hotelId) and embedded in a rate id.
rateId path string yes - 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.
searchId query string no pattern ^[A-Za-z0-9._:~=-]{1,256}$ 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.
locale query string no length 1..35; default "en" Checkout page language tag (e.g. en, ar). Defaults to en.
guests query string no pattern ^[1-9]\d*(:\d+)*$; length *..64 Optional. The adults and child ages to put on the checkout URL, written as the adult count then one age per child: 2:4:9 is 2 adults with children aged 4 and 9. It does not change what checkout charges, which comes from the search the rate id names, so a different value here, or none at all, opens the same stay at the same price.
countryCode query string no pattern ^[A-Z]{2}$ Optional. An ISO 3166-1 alpha-2 country code to put on the checkout URL, such as AE. On wego.com this names the country of the place searched, not the traveller’s. It does not choose which wego.com site the link opens (that is siteCode), and it does not change the price: the checkout page asks the traveller for their nationality on its own form.
siteCode query string no pattern ^[A-Z]{2}$ 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 copied onto the link and changes neither the host nor the price.

Responses

Status Description
200 The checkout URL, and the fact that it expires.
400 Invalid request parameters.
401 Missing or invalid bearer token.
429 Rate limit exceeded; retry after the Retry-After seconds.

200 body

Field Type Always present Description
bookingUrl string yes The wego.com hotel checkout URL for the rate.
expires boolean yes 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. To send someone a link that lasts, use the hotel’s pageUrl.

Example

curl -s -H "Authorization: Bearer $TOKEN" \
  "https://api.wego.com/v1/hotels/$HOTEL_ID/rates/$RATE_ID/booking-link"

FORM WG-REF · SEQ 004821The API and the ways in to it are early and may change.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close