Making an air booking
The steps below explain how to create a new air booking for a traveler. All APIs mentioned below are dependent on each other and the steps described in this section must be executed in the order specified.
| Step | Name | Endpoint | Details |
|---|---|---|---|
| 1. | Get air itineraries | /v2/air/search-flights | Search for available flights. Response will contain: searchId itineraryId paginationParameters metadata Other APIs will use: searchId itineraryId |
| 2. | Get flight attributes | /v2/air/flight-attributes | Retrieve flight attributes such as amenities and fare rules for every flight displayed on a search result. Request body requires: searchId Response will contain: searchId itineraryId paginationParameters metadata Other APIs will use: searchId itineraryId |
| 3. | Get selected itinerary | /v2/air/selected-itinerary | View one selected itinerary and its respective details. Request body requires: searchId itineraryId Response will contain: Itinerary details for the itineraryId provided in the request. |
| 4. | Get flight checkout details | /v2/air/flight-checkout | Get checkout related information for a selected itinerary from Step 3. Request body requires: searchId itineraryId Response will contain: checkoutResponseId, baggage information, ancillaries, other checkout parameters and supported payment options. Other APIs will use: checkoutResponseId |
| 5. | Get flight seat map | /v2/air/seat-map | View the seat map for the selected itinerary from Step 3. Request body requires: airItineraryId (an object wrapper containing both searchId and itineraryId from Step 1) and traveler information. Response will contain: seatMapResponseId travelerSeatMaps travelerId flightSeatMapIds seatMaps seatMapId Other APIs will use: seatMapResponseId |
| 6. | List trips (optional) | /v2/list-organisation-trips | During the checkout process, you can use the List Trips API to choose a trip name from the list of existing names or create a new trip name in the next step. Request body requires: organizationId updatedAt pnrType customFields Response will contain: tripId Other APIs will use: tripId |
| 7. | Create trip | /v2/trips | Trips act as a container to group one or more related PNRs (bookings). You must provide a unique value for the tripName parameter. If you’ve already picked an existing trip name in Step 6, you can skip this step. Request body requires: tripName tripDescription userId registrarId Response will contain: tripId Other APIs will use: tripId |
| 8. | Initiate booking | /v2/air/initiate-booking | Initiate the booking process for the new trip created in Step 7. Request body requires: checkoutResponseId from Step 4, seatMapResponseId from Step 5, traveler details, bookingCharges, and bookingContact. Response will contain: initiateBookingResponseId Other APIs will use: initiateBookingResponseId |
| 9. | Validate itinerary | /v2/air/revalidate-itinerary | To finalize a reservation, the travelers must indicate their preferred seat, number of checked and carry-on bags, and select whether they want any ancillaries such as travel insurance or priority boarding (applied as additional booking charges). Use this API to validate your itinerary. Request body requires: checkoutResponseId from Step 4, seatMapResponseId from Step 5, initiateBookingResponseId from Step 8, paymentSetupResponseId, paymentSourceId, tripId from Step 7, traveler details and booking charges.Note: Contact your Spotnana representative to obtain the paymentSourceId. Response will contain: bookingId, fare breakdown, leg prices, and policy details. Other APIs will use: bookingId |
| 10. | Create air pnr | /v2/air/create-pnr | Create a new air booking (PNR) for your trip. Request body requires: bookingId from Step 9, initiateBookingResponseId from Step 8, preBookAnswers generated using the Get Trip Details API Response will contain: pnrId sourcePnrId pnrStatus The pnrId generated by this API will be used in the exchange and cancel booking workflows. |