How to build a flight booking flow
This guide takes a traveller from a route to an issued ticket. It combines five flight endpoints into one flow.
Before you start
- A
SessionId. See authentication. - The
air_low_fare_search,air_revalidate,air_book, andair_order_ticketpermissions.
Step 1: Search
Send the route, dates, cabin, and passenger mix. Keep the FareSourceCode of the itinerary the traveller picks.
curl -X POST https://api.hermeseus.com/api/Air/AirLowFareSearch \
-H "Content-Type: application/json" \
-d '{
"SessionId": "8f3c81d2-4a5b-4c6d-9e0f-1a2b3c4d5e6f",
"AdultCount": 1, "ChildCount": 0, "InfantCount": 0,
"PricingSourceType": "All", "RequestOption": "All",
"TravelPreference": { "CabinType": 3 },
"OriginDestinationInformations": [
{ "OriginLocationCode": "IST", "DestinationLocationCode": "DXB", "DepartureDateTime": "2026-10-12T00:00:00" }
]
}'For a snappy UI, use streaming search instead and paint results as they arrive.
Step 2: Revalidate
When the traveller confirms, re-price the fare. Book with the FareSourceCode this call returns, not the one from search.
curl -X POST https://api.hermeseus.com/api/Air/AirRevalidate \
-H "Content-Type: application/json" \
-d '{ "SessionId": "8f3c81d2-...", "FareSourceCode": "dHA6ODc0NTE6ZmwxMjM0OjMyNw==" }'If this returns Err0102003 or Err0102005, the fare is gone. Search again.
Step 3: Book
Send the passengers and a lead contact. You get a UniqueId and a TktTimeLimit. Nothing is charged yet.
curl -X POST https://api.hermeseus.com/api/Air/AirBook \
-H "Content-Type: application/json" \
-d '{
"SessionId": "8f3c81d2-...",
"FareSourceCode": "dHA6ODc0NTE6ZmwxMjM0OjMyNw==",
"TravelerInfo": {
"PhoneNumber": "+441234567890",
"Email": "traveller@example.com",
"AirTravelers": [
{ "PassengerType": 1, "Gender": 0, "DateOfBirth": "1990-05-14",
"PassengerName": { "PassengerFirstName": "Jane", "PassengerLastName": "Doe" } }
]
}
}'Step 4: Take payment, then issue the ticket
Charge the traveller through your own gateway. Then issue the ticket before TktTimeLimit. This is when the fare is charged to your office balance.
curl -X POST https://api.hermeseus.com/api/Air/AirOrderTicket \
-H "Content-Type: application/json" \
-d '{ "SessionId": "8f3c81d2-...", "UniqueId": "TP-2026-000512" }'Miss the deadline and the hold is released. You then start again from step 1.
Step 5: Confirm the ticket
Read the booking to show the traveller their e-ticket numbers and status.
curl -X POST https://api.hermeseus.com/api/Air/AirBookingData \
-H "Content-Type: application/json" \
-d '{ "SessionId": "8f3c81d2-...", "UniqueId": "TP-2026-000512" }'Handle the common failures
Err0101001at any step: the session expired. Re-authenticate and retry once.Err0102003orErr0102005at revalidate or book: the fare moved. Search again and show the new price.Err0103006at ticketing: the booking is not in a ticketable state. Read the booking and check the deadline.
Full field lists are on the flight reference pages.

