A login token instead of an API token
DEL-BOM · one way · 1 adult
The customer API takes only tokens made by generate-token. A token from the website login answers 401.
▸1. SearchPOST /flights/searchfailed 401
What this step returned(click to expand)
- Failed with HTTP 401: Authentication required (Invalid token)
- This reply is the sample: later steps of the case were not called with it.
Request body
HTTP 401 · 107 ms · complete request body (collapsible viewer)
{
"segments": [
{
"from": "DEL",
"to": "BOM",
"date": "2026-11-19"
}
],
"adult": 1,
"child": 0,
"infant": 0,
"cabin_class": 1
}Reply (failed, HTTP 401)
HTTP 401 · 107 ms · complete response body (collapsible viewer)
{
"code": 9001,
"message": "Authentication required",
"detail": "Invalid token",
"traceId": "78bdfcded8764217ee84c63bebb3964d"
}Keys and what they mean
Request
| key | type | when present | importance | meaning |
|---|---|---|---|---|
| segments[] | array | required, 1 to 6 | must read | The legs you search: one for one way, two for a return (second from the destination back), up to six for a multi-city trip. |
| segments[].from | string | required | must read | Departure airport, IATA code. |
| segments[].to | string | required | must read | Arrival airport, IATA code. |
| segments[].date | date | required | must read | Departure date, YYYY-MM-DD, local to the departure airport. |
| adult | integer | required, 1 to 9 | must read | Adults travelling. child and infant default to 0; an infant needs an adult. |
| cabin_class | integer | optional | useful | 1 economy (default), 2 premium economy, 3 business, 4 first. |
| detail | string | optional | useful | journey (default) or segment. segment adds segments[] inside every fare option with the fare attributes per flight. |
| include_fare_rules | boolean | optional, default true | informational | false leaves fare_rules out of the reply and off every fare; smaller reply. |
| Total: 8 keys | ||||
Reply
| key | type | when present | importance | meaning |
|---|---|---|---|---|
| search_id | string | always | informational | Id of this search, for support questions. |
| valid_till | datetime | always | must read | Until when an option_id and price_id of this reply can be sent to reprice. After it, search again. |
| fare_rules | object | unless include_fare_rules is false | useful | Every distinct fare rule of the reply keyed by id (fr_1, fr_2, …). Fares point at them; ids mean nothing outside this reply. |
| results[] | array | always | must read | One group per set of journeys the fares cover. Pick one option and one fare from each group until every journey of your request is covered. |
| results[].journey_indexes | array of integer | always | must read | Which journeys of your request this group's fares cover: [0] onward only, [1] return only, [0, 1] a combined fare for both. |
| results[].options[].option_id | string | always | must read | Names the flights of this option. Send it to reprice with the price_id of the chosen fare. |
| results[].options[].segments[] | array | always | must read | The flights of this option in order, each named by (journey_index, segment_index); segment_index restarts at 0 in every journey. |
| results[].options[].segments[].operating_airline_code | string | only on a codeshare | useful | The airline that flies the aircraft when it differs from airline_code, the airline selling the seat. Show it to the traveller. |
| results[].options[].fare_options[] | array | always | must read | The fares sold on exactly these flights. Each prices the whole option once; no amount appears anywhere else. |
| results[].options[].fare_options[].price_id | string | always | must read | Names this fare. Send it to reprice with the option_id. |
| results[].options[].fare_options[].adult | object | always | must read | What this fare gives an adult: fare (the price for the whole option), fare_ref, refundable_type, cabin_class, booking_class, fare_basis, baggage. child and infant appear only when requested. |
| results[].options[].fare_options[].adult.fare.total_fare | number | always | must read | What the traveller pays for one adult on this option, taxes included. |
| results[].options[].fare_options[].adult.fare.net_fare | number | always | must read | What you pay us for one adult: total_fare less your commission. |
| results[].options[].fare_options[].adult.baggage | object | when the airline states it | useful | Allowance included in the fare: hand and checkin, each {kg} and/or {pieces}. Absent = not stated. |
| results[].options[].fare_options[].fare_rules | object | when a rule is known at search | useful | Journey index → id in the top-level fare_rules. A missing index has no rule known at search; the reprice reply carries the final rules. |
| results[].options[].fare_options[].varies_by_segment | boolean | always | informational | true when a later flight of this fare differs from the first in cabin, meal, booking class, fare basis or baggage. Ask detail=segment to see them per flight. |
| Total: 16 keys | ||||
Errors this call answers with (3)
| HTTP | code | message | detail | when |
|---|---|---|---|---|
| 401 | 9001 | Authentication required | Invalid token | Missing, expired or foreign token; also when the API cannot be reached. |
| 400 | 5100 | Invalid search request | cabin_class must be 1 (economy), 2 (premium), 3 (business), or 4 (first) | errors[] has field cabin_class, rule one_of. Same for fare_types and the engine's own checks (dates, airport codes, pax counts). |
| 500 | 9000 | Something went wrong |
Questions developers ask (4)
- What do I send to reprice for a domestic return?
- Two items: one option and one fare from group [0] (onward) and one from group [1] (return). An international return has one group [0, 1] and one item.
- Why does commission not appear on my fares?
- Zero amounts are left out. commission appears only when a commission rule applies to your account; net_fare is then total_fare less it.
- How long can I use an option_id and price_id?
- Until valid_till of the search reply. After it, search again.
- What does varies_by_segment true mean?
- A later flight of the fare differs from the first in cabin, meal, booking class, fare basis or baggage. Send detail=segment to see every flight.