Reference · step 6 of 9

POST/flights/book

{{base_url}}/flights/book

Save the passengers on the itinerary, then pay from the wallet and ticket (is_hold false) or hold the booking without payment (is_hold true).

Headers

Content-Typeapplication/json
AuthorizationBearer {{token}}
Body (4 notes)
  • pax_details: one per traveller, at least one. pax_type ADULT, CHILD or INFANT; title Mr, Mrs, Ms, Mstr, Miss; gender male or female; dates YYYY-MM-DD (values as the web frontend sends them; the validator names are passenger_type, passenger_title, gender, dateformat).
  • phone and email are required on every passenger; the first passenger's pair is stored as the customer contact.
  • gst_details is optional as a block; when present, all five fields are required and number must be a valid GSTIN.
  • passport_details is optional; send it when review's requirements say passport_applicable.
Reply (1 notes)
  • status is the payment status for a paid booking (SUCCESS; PENDING when the ticket is not yet issued) and ONHOLD for a hold.
Keys and what they mean
Request
keytypewhen presentimportancemeaning
itinerary_idstringrequiredmust readThe itinerary_id from reprice, before its valid_till.
is_holdbooleanoptional, default falsemust readfalse: book directly, paid at once from your balance or credit and ticketed. true: hold the seats without payment until pay_till (only when reprice said booking_requirements.is_hold true); then confirm-hold or release.
pax_details[]arrayrequired, one per passengermust readEvery passenger of the search, adults first: first_name, last_name, pax_type (ADULT, CHILD, INFANT), title, gender, dob, phone and email.
pax_details[].passport_detailsobjectwhen reprice says passport_mandatoryusefulpassport_number, passport_issue_date, passport_expiry_date, passport_issue_country, nationality.
pax_details[].ancillariesobjectoptionalusefulWhat this passenger buys: seat[], meal[], other[] (each with code, price, label, journey_index and segment_index) and baggage[] (code, price, label, journey_index; no segment_index). Codes come from ancillaries and seat map; an item on a flight not in the itinerary answers 400 with errors[] (rule scope).
gst_detailsobjectoptional; required when reprice says is_gst_mandatoryusefulThe company on the invoice: name, number (GSTIN), address, email, mobile.
Total: 6 keys
Reply
keytypewhen presentimportancemeaning
booking_idstringalwaysmust readYour booking's id. Send it to booking details, confirm-hold and release.
statusstringalwaysmust readONHOLD (held, pay before pay_till), SUCCESS (booked directly and paid), PENDING (the airline has not confirmed yet: read the booking details), or the booking's state.
pay_tilldatetimeon a holdmust readUntil when the hold can be confirmed; after it the airline releases the seats.
amountnumberalwaysmust readWhat the booking costs (INR); taken at once for a direct booking, at confirm-hold for a hold.
itinerary_idstringalwaysinformationalThe itinerary that was booked.
Total: 5 keys
Errors this call answers with (7)
HTTPcodemessagedetailwhen
4019001Authentication requiredInvalid token
4039002You do not have permission for this actionRole without bookings.create (Finance, Operation, Tech).
4003000Invalid request(the API's detail text)
4009003Some fields are missing or invalidSchema validation of the body (required fields, formats); errors[] lists them.
5033003A service the API depends on is unavailable(the API's text)the API answered 5xx or did not answer.
4093101Hold booking limit reached
5009000Something went wrongPayment or order errors that no translator knows.
Questions developers ask (2)
Is gst_details required?
Only when booking_requirements.is_gst_mandatory is true. When you send it, all five fields are required.
What is the difference between is_hold true and false?
false pays from your wallet and tickets at once. true holds the seats without payment until pay_till; confirm with confirm-hold or give them back with release.