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

Open one flight trip

Returns one trip's full itinerary and every fare on it (each kind-tagged), for the given tripId within its searchId. searchId is required – it comes from the search/results snapshot the tripId was read from.

View as MarkdownView this page as plain text
Carries onwardfareId
Settlesimmediately
Id expiresyes · 404 means search again

GET /v1/flights/trips/{tripId}

Returns one trip’s full itinerary and every fare on it (each kind-tagged), for the given tripId within its searchId. searchId is required – it comes from the search/results snapshot the tripId was read from.

Operation ID: getFlightTrip

Parameters

Name In Type Required Constraints Description
tripId path string yes pattern ^[A-Za-z0-9._:~=-]{1,256}$ The trip id from a search-results snapshot, shaped {searchId}:{tripCode}. It resolves only together with the searchId it came from, and both expire with the search.
searchId query string yes pattern ^[A-Za-z0-9._:~=-]{1,256}$ Required search context: the searchId the tripId was read from (it is the tripId’s first :-segment). A trip id resolves only with its own search, and both expire together.
currency query string no pattern ^[A-Z]{3}$; default "USD" Pricing currency as a 3-letter ISO 4217 code (e.g. AED). Optional; defaults to USD server-side. Not inherited from the search: a search created in one currency reads back in USD unless you pass currency on every read, so re-send the search’s currency to keep prices in it.
locale query string no length 1..35; default "en" Response language tag (e.g. en, ar). Optional; defaults to en server-side. Not inherited from the search – pass it on each read to keep results in that language.
view query default | detail no default "default" Response projection. default (agent shape): the full itinerary with every fare and per-flight segments. detail: the richer UI view-model (per-segment amenities, seat metadata, provider brand). Defaults to default.

Responses

Status Description
200 The full itinerary + all fares for the trip (agent default) or, with ?view=detail, the per-segment detail projection.
400 Invalid request body/query/path parameters.
401 Missing or invalid bearer token.
404 Unknown or expired trip. Ids are context-bound: a tripId resolves only with the searchId it came from, and retrying an expired one never recovers - create a new search and rethread.
429 Rate limit exceeded; retry after the Retry-After seconds.
502 The upstream flights service returned an invalid response.
503 The flights service is temporarily unavailable (upstream_unavailable) or rate-limited upstream (upstream_rate_limited); retry after the Retry-After seconds.

200 body (variant 1 of 2)

Field Type Always present Description
tripId string yes Opaque trip id, shaped {searchId}:{tripCode}; read it back with GET /v1/flights/trips/{tripId}.
featured best_value | cheapest | cheapest_direct no The single highest-priority featured label, best_value > cheapest > cheapest_direct. best_value ranks on the score of the trip’s CHEAPEST fare, the same statistic sort=score_desc orders by, so on a score_desc read it lands on the first result. cheapest and cheapest_direct break a price tie by that same score, then by leg-1 departure – cheapest keeps the LATER departure, cheapest_direct the EARLIER one. Under sort=score_desc the two picks are also MOVED toward positions 2 and 3, matching wego.com. Those positions are targets, not guarantees: a pick already at or above its target stays put, and cheapest_direct lands at position 2 when the first result is itself at the cheapest price.
stops number yes Trip-level stop count, the max across legs.
durationMinutes number yes Total trip duration in minutes, summed across legs.
outbound object yes The outbound leg.
from string yes Departure airport IATA code.
to string yes Arrival airport IATA code.
departsAt string yes Leg departure, ISO 8601 with offset.
arrivesAt string yes Leg arrival, ISO 8601 with offset.
durationMinutes number yes Total leg duration in minutes.
stops number yes Stops on this leg (0 is nonstop).
airlines string[] yes Raw IATA airline codes on the leg (unchanged). See airlinesDetail for display names.
airlinesDetail object[] no Index-aligned display names for airlines, resolved from the search snapshot’s airline dictionary – the same join the results cards use; the bare code is the fallback on a dictionary miss. Omitted when the leg carries no airline codes. Additive – raw airlines codes are unaffected.
operatingAirlines object[] no Carriers that fly a segment of this leg they do not market. airlines / airlinesDetail name the MARKETING carriers only, so on a leg sold by one airline every code here is a carrier absent from the ticket; on an interline leg sold by two, one of these may also market a different segment. Read this before telling a traveller who they fly – mileage accrual, lounge access and baggage rules follow the operating carrier. Distinct codes, folded from this leg’s own segments; pair it with segments[] to see which flight each one operates. PRESENT ONLY WHEN A SEGMENT PROVES A CODESHARE: absent means none was proven on this leg, never a promise that the marketing carrier operates every segment.
transportTypes FLIGHT | TRAIN | BUS | OTHER[] yes Distinct transport modes across this leg’s segments, in segment order. Always present and never empty: an all-flight leg reads [“FLIGHT”], so one read of this field replaces folding segments[] yourself. Anything else means part of this leg is not a plane, and segments[] says which part.
segments object[] no Per-segment identity (marketing/operating carrier, flight number, times, transport mode); omitted when upstream carries no segments for the leg. Previously reachable only via ?view=detail.
return object no The return leg; present only on a round trip.
from string yes Departure airport IATA code.
to string yes Arrival airport IATA code.
departsAt string yes Leg departure, ISO 8601 with offset.
arrivesAt string yes Leg arrival, ISO 8601 with offset.
durationMinutes number yes Total leg duration in minutes.
stops number yes Stops on this leg (0 is nonstop).
airlines string[] yes Raw IATA airline codes on the leg (unchanged). See airlinesDetail for display names.
airlinesDetail object[] no Index-aligned display names for airlines, resolved from the search snapshot’s airline dictionary – the same join the results cards use; the bare code is the fallback on a dictionary miss. Omitted when the leg carries no airline codes. Additive – raw airlines codes are unaffected.
operatingAirlines object[] no Carriers that fly a segment of this leg they do not market. airlines / airlinesDetail name the MARKETING carriers only, so on a leg sold by one airline every code here is a carrier absent from the ticket; on an interline leg sold by two, one of these may also market a different segment. Read this before telling a traveller who they fly – mileage accrual, lounge access and baggage rules follow the operating carrier. Distinct codes, folded from this leg’s own segments; pair it with segments[] to see which flight each one operates. PRESENT ONLY WHEN A SEGMENT PROVES A CODESHARE: absent means none was proven on this leg, never a promise that the marketing carrier operates every segment.
transportTypes FLIGHT | TRAIN | BUS | OTHER[] yes Distinct transport modes across this leg’s segments, in segment order. Always present and never empty: an all-flight leg reads [“FLIGHT”], so one read of this field replaces folding segments[] yourself. Anything else means part of this leg is not a plane, and segments[] says which part.
segments object[] no Per-segment identity (marketing/operating carrier, flight number, times, transport mode); omitted when upstream carries no segments for the leg. Previously reachable only via ?view=detail.
fares object[] yes Bookable fares for this trip, cheapest-first.
kind wego | airline | partner yes Fare source: wego (Book-on-Wego), airline (booked with the carrier) or partner (an OTA).
fareId string yes Opaque fare id; pass it to the fare-options and booking-link routes.
providerCode string yes Booking provider code (the OTA or airline selling this fare).
providerName string yes Booking provider display name.
price object yes Fare price. total/totalUsd are the whole-party amount, fee-inclusive, and are the authoritative figure for this fare. Search-time fares carry no per-passenger breakdown.
refundable boolean yes Whether this fare is refundable, as the provider states it.
hasFareOptions boolean yes Whether GET /v1/flights/fares/{fareId}/options can expand this fare into branded options.
handoffUrl string yes Deep link that hands the booking off to the provider or wego.com checkout for this fare.
metadata object yes What this read resolved currency and locale to, and how each was decided.
currencyCode string yes The currency this read ASKED upstream for, and the one every price on it is meant to be in. Read it beside currencyCodeSource before you show a number: a price computed in the wrong currency renders as a perfectly normal price, with no error and no odd shape to notice, so the response states which one rather than leaving it to be inferred. Where the operation also publishes a top-level currencyCode, that field reports the currency the prices actually came back in; the two agree unless upstream declined to reprice.
currencyCodeSource explicit | default yes How the API resolved currencyCode: explicit (the caller sent currency – including a value equal to the default) or default (USD, no currency sent). A default here is the one signal that the request never carried the currency you meant.
locale string yes The language tag this read asked upstream for – what any localized text on it was resolved in (room and board names, airline and airport names, review prose).
localeSource explicit | default yes How the API resolved locale: explicit (the caller sent locale – including a value equal to the default) or default (en, no locale sent). A default here explains text that came back in a language the caller did not ask for.

200 body (variant 2 of 2)

Field Type Always present Description
tripId string yes Opaque trip id, shaped {searchId}:{tripCode}; read it back with GET /v1/flights/trips/{tripId}.
stops number yes Trip-level stop count, the max across legs.
durationMinutes number yes Total trip duration in minutes, summed across legs.
legs object[] yes The trip’s legs with per-segment detail, outbound first.
direction depart | return yes Which leg this is: depart or return.
from object yes Departure airport for this leg.
to object yes Arrival airport for this leg.
departsAt string yes Leg departure, ISO 8601 with offset.
arrivesAt string yes Leg arrival, ISO 8601 with offset.
arrivalDayOffset number yes Calendar days the arrival lands after departure (the +1 badge).
overnight boolean yes The leg spans a night.
durationMinutes number yes Leg duration in minutes.
stops number yes Stops on this leg (0 is nonstop).
layoverMinutes number no Total layover across the leg’s stops, minutes.
segments object[] yes The individual flights that make up this leg.
fares object[] yes Bookable fares for this trip, cheapest-first.
kind wego | airline | partner yes Fare source: wego (Book-on-Wego), airline (booked with the carrier) or partner (an OTA).
fareId string yes Opaque fare id; pass it to the fare-options and booking-link routes.
provider object yes A booking provider resolved to code, name, logo and brand color.
price object yes Fare price for the whole party, fee-inclusive.
baggage object no Baggage allowance for this fare, when the provider states it.
refundable boolean yes Whether this fare is refundable, as the provider states it.
hasFareOptions boolean yes Whether GET /v1/flights/fares/{fareId}/options can expand this fare into branded options.
handoffUrl string yes Deep link to the provider or wego.com checkout for this fare.
metadata object yes What this read resolved currency and locale to, and how each was decided.
currencyCode string yes The currency this read ASKED upstream for, and the one every price on it is meant to be in. Read it beside currencyCodeSource before you show a number: a price computed in the wrong currency renders as a perfectly normal price, with no error and no odd shape to notice, so the response states which one rather than leaving it to be inferred. Where the operation also publishes a top-level currencyCode, that field reports the currency the prices actually came back in; the two agree unless upstream declined to reprice.
currencyCodeSource explicit | default yes How the API resolved currencyCode: explicit (the caller sent currency – including a value equal to the default) or default (USD, no currency sent). A default here is the one signal that the request never carried the currency you meant.
locale string yes The language tag this read asked upstream for – what any localized text on it was resolved in (room and board names, airline and airport names, review prose).
localeSource explicit | default yes How the API resolved locale: explicit (the caller sent locale – including a value equal to the default) or default (en, no locale sent). A default here explains text that came back in a language the caller did not ask for.

Example

curl -s -H "Authorization: Bearer $TOKEN" \
  "https://api.wego.com/v1/flights/trips/$TRIP_ID?searchId=$SEARCH_ID"

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

Navigation

Type to search…

↑↓ navigate↵ selectEsc close