Reference · step 3 of 9
POST/flights/reprice
{{base_url}}/flights/reprice
Reprice the chosen fare(s) with the airline and return the itinerary: the final price, what the booking needs (passport, DOB, GST, hold allowed) and any price change.
Headers
| Content-Type | application/json |
| Authorization | Bearer {{token}} |
Body (1 notes)
- items: one entry per fare; a return sold as two one-way fares sends two items. option_id and price_id at top level are accepted for a single fare.
Reply (4 notes)
- booking_requirements.is_hold says whether POST /flights/book may be called with is_hold true; the other fields say what the booking must carry (GST, PAN, passport, dates of birth, name lengths, mandatory seat, meal or bag).
- results[] has one entry per item sent: the option's flights and the one fare, priced again, in the fare shape of search (detail=segment adds segments[] inside fare). fare_rules holds the rules those fares point at.
- valid_till is when the supplier's session for this itinerary ends (the API's review session, default 15 minutes); book before it.
- messages is absent when nothing changed; otherwise one entry per repriced option with type FARE_ALERT, the option_id, and the old and new value.
Keys and what they mean
Request
| key | type | when present | importance | meaning |
|---|---|---|---|---|
| items[] | array | required, one per group | must read | One item per search group you chose from: one for a one way or a combined return, two for a domestic return (one per direction). |
| items[].option_id | string | required | must read | The option_id from the search reply. |
| items[].price_id | string | required | must read | The price_id of the chosen fare of that option. An option_id or price_id not in a current search answers 400 with errors[] (search again). |
| Total: 3 keys | ||||
Reply
| key | type | when present | importance | meaning |
|---|---|---|---|---|
| itinerary_id | string | always | must read | Names the repriced itinerary. Send it to ancillaries, seat map and book. |
| valid_till | datetime | always | must read | Until when the itinerary_id can be booked. After it, book answers 410: reprice again. |
| results[] | array | always | must read | One entry per item sent: journey_indexes, option_id, the flights (segments) and the one fare, priced again. |
| results[].segments[] | array | always | must read | The flights in order, each named by (journey_index, segment_index); segment_index restarts at 0 in every journey. |
| results[].fare | object | always | must read | The fare in the shape of search: price_id, per passenger type (adult, child, infant) the fare_ref, refundable_type, cabin_class, booking_class, fare_basis, baggage and fare, and fare_rules ids. |
| price.total | object | always | must read | The price in the components of search: base_fare, yq, yr, airline_gst, booking_fee, commission, other_taxes, total_fare (what the traveller pays), net_fare (what you pay us), pax_count, and the baggage stated in the fare. For the whole booking. |
| price.adult (child, infant) | object | always (child, infant when requested) | useful | The price in the components of search: base_fare, yq, yr, airline_gst, booking_fee, commission, other_taxes, total_fare (what the traveller pays), net_fare (what you pay us), pax_count, and the baggage stated in the fare. For one passenger of that type. |
| booking_requirements | object | always | must read | What book must carry: is_gst_mandatory, pan_applicable, passport_mandatory, dob_applicable (adt, chd, inf), name lengths, and whether a seat, meal or bag is mandatory. |
| booking_requirements.is_hold | boolean | always | must read | true when this fare may be booked on hold (book with is_hold true); false: book directly, paid at once. |
| fare_rules | object | when known | useful | The cancellation and date-change rules the fares point at, keyed by id (fr_1, …): bands with allowed, amount or percent, the window (from, to) and the airline's text. |
| messages[] | array | only when the price changed | must read | One entry per repriced option whose price changed since search: type FARE_ALERT, option_id, old_value, new_value. Show the new price before booking. |
| Total: 11 keys | ||||
Errors this call answers with (6)
| HTTP | code | message | detail | when |
|---|---|---|---|---|
| 401 | 9001 | Authentication required | Invalid token | |
| 400 | 5100 | Invalid search request | option_id and price_id are required | Also 'each review item needs option_id and price_id'. |
| 404 | 5103 | Flight not found | option_id or price_id not in a stored search. | |
| 410 | 5102 | Search results have expired | ||
| 502 | 5001 | The airline or supplier could not complete the request | Reprice failed at the airline. | |
| 504 | 5002 | A supplier or service did not answer in time |
Questions developers ask (2)
- The price changed. What now?
- messages has a FARE_ALERT with old_value and new_value for that option_id. Show the new price to the traveller before booking; the itinerary is priced at the new value.
- Until when can I book?
- valid_till of the reprice reply: the airline's session for this itinerary. Book before it or reprice again.
Real captures of this call
- Domestic, one way, 1 adult · HTTP 200 · reply in the viewer
- Domestic, one way, 1 adult, 1 child, 1 infant · HTTP 200 · reply in the viewer
- Domestic, return, 1 adult · HTTP 200 · reply in the viewer
- Domestic, return, 1 adult, 1 child, 1 infant · HTTP 200 · reply in the viewer
- International, one way, 1 adult · HTTP 200 · reply in the viewer
- International, one way, 1 adult, 1 child, 1 infant · HTTP 200 · reply in the viewer
- International, return, 1 adult · HTTP 200 · reply in the viewer
- International, return, 1 adult, 1 child, 1 infant · HTTP 200 · reply in the viewer
- Price changed at reprice · HTTP 200 · reply in the viewer
- Fare attributes per flight (detail: segment) · HTTP 200 · reply in the viewer
- Search without fare rules (include_fare_rules: false) · HTTP 200 · reply in the viewer
- One airline only (preferred_airlines) · HTTP 200 · reply in the viewer
- Business cabin (cabin_class: 3) · HTTP 200 · reply in the viewer
- Three flights in one journey · HTTP 200 · reply in the viewer
- Bags and meals on a low-cost airline · HTTP 200 · reply in the viewer
- Seat map with paid and free seats · HTTP 200 · reply in the viewer
- Book on hold, plain · HTTP 200 · reply in the viewer
- Book on hold with GST details · HTTP 200 · reply in the viewer
- Book on hold with a seat, a meal and a bag, one flight · HTTP 200 · reply in the viewer
- Book on hold with ancillaries on a two-flight journey · HTTP 200 · reply in the viewer
- Direct booking (paid, no hold), plain · HTTP 200 · reply in the viewer
- Direct booking (paid, no hold) with GST details · HTTP 200 · reply in the viewer
- Direct booking (paid, no hold) with a seat, a meal and a bag, one flight · HTTP 200 · reply in the viewer
- Direct booking (paid, no hold) with ancillaries on a two-flight journey · HTTP 200 · reply in the viewer
- Hold, then confirm (pay) the hold · HTTP 200 · reply in the viewer
- Hold, then release the hold · HTTP 200 · reply in the viewer
- Reprice after the search expired · HTTP 404 · reply in the viewer