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

Build a fare's wego.com booking link

Builds the wego.com booking deep-link for a chosen Book-on-Wego fare, with one fare option pre-selected PER LEG.

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

GET /v1/flights/fares/{fareId}/booking-link

Builds the wego.com booking deep-link for a chosen Book-on-Wego fare, with one fare option pre-selected PER LEG. A pure, stateless URL build from the caller-supplied search context - no upstream call, no booking, no payment. The caller passes back the trip/leg/passenger context.

Operation ID: getFareBookingLink

Parameters

Name In Type Required Constraints Description
fareId path string yes pattern ^[A-Za-z0-9._:~=-]{1,256}$ The Book-on-Wego fare id from a flight-search trip detail.
tripId query string yes pattern ^[A-Za-z0-9._~=-]+:[A-Za-z0-9._:~=-]+$; length *..256 The trip the fare belongs to, from a flight-search result. Shaped {searchId}:{tripCode}.
searchId query string no pattern ^[A-Za-z0-9._:~=-]{1,256}$ Optional cross-check. When supplied it must equal the tripId’s first :-segment; a mismatch is rejected.
fareOptionId query string yes pattern ^[A-Za-z0-9._:~=-]{1,256}(?:,[A-Za-z0-9._:~=-]{1,256}){0,7}$ The fare option(s) to pre-select, from GET /v1/flights/fares/{fareId}/options. Required: without it the booking page has no fare to open and dead-ends. When that read reported price.covers=leg, pass ONE id per trip leg as a comma-separated list, in any order: a single id then prices only its own leg while the page still presents the whole round trip. A whole-trip fare (price.covers=trip) takes exactly one id. At most 8, and no id twice.
from query string yes pattern ^[A-Z]{3}$ Origin airport or city code, as sent to the flight search.
to query string yes pattern ^[A-Z]{3}$ Destination airport or city code, as sent to the flight search.
fromCity query boolean | 0 | 1 | true | false no - Whether from is a city code rather than an airport code.
toCity query boolean | 0 | 1 | true | false no - Whether to is a city code rather than an airport code.
fromDate query string yes pattern ^\d{4}-\d{2}-\d{2}$ Outbound departure date, YYYY-MM-DD, as sent to the flight search.
toDate query string no pattern ^\d{4}-\d{2}-\d{2}$ Return date, YYYY-MM-DD. Omit for a one-way handoff.
cabin query economy | premium_economy | business | first no default "economy" Cabin class, as sent to the flight search.
adults query integer no 1..9; default 1 Adult passengers (1-9).
children query integer no 0..8; default 0 Child passengers (0-8).
infants query integer no 0..8; default 0 Infant passengers (0-8). Must not exceed adults.
siteCode query string no pattern ^[A-Z]{2}$ Wego market (point of sale) as a 2-letter code, e.g. AE. Optional: if omitted the API defaults to US. A client that knows the user’s market (the wego CLI derives it from the id_token) passes it as an explicit siteCode.
currency query string no pattern ^[A-Z]{3}$ Pricing currency as a 3-letter ISO 4217 code (e.g. AED). Optional: when omitted the built URL carries NO currency parameter – it is not defaulted to USD, so wego.com shows the market’s own default. Pass it to pin the handoff to a currency.
locale query string no length 1..35; default "en" Response language tag for the wego.com page (e.g. en, ar). Defaults to en.

Responses

Status Description
200 The booking handoff URL.
400 Invalid fare id or query 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 A wego.com booking deep-link with the chosen fare pre-selected.
expires boolean yes Always true: this link is bound to a live search and stops working with it, in about five to seven minutes. To send someone a link that lasts, use GET /v1/flights/search-link.

Example

FROM_DATE=$(date -u -v+60d +%F 2>/dev/null || date -u -d '+60 days' +%F)

curl -s -H "Authorization: Bearer $TOKEN" \
  "https://api.wego.com/v1/flights/fares/$FARE_ID/booking-link?tripId=$TRIP_ID&fareOptionId=$FARE_OPTION_ID&from=DXB&to=LHR&fromDate=$FROM_DATE"

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

Navigation

Type to search…

↑↓ navigate↵ selectEsc close