Shopping
Overview
Assuming that John, Alice, and their Son Ben want to fly from Shanghai to Beijing. They’ll be leaving on 11th July (local time) and returning one day later on 12th July (local time). John and his family would like to fly business class.
What should we do?
-
Search for flights
-
Retrieve the search results
1. Search for flights
In our API, you request offers to search for flights.
Before requesting offers, you need the flight itinerary including
-
origin(s)
-
destination(s)
-
departure date(s)
-
information about the passengers.
So John’s family
-
has two journeys:
-
the outbound one from Shanghai to Beijing
-
the inbound one from Beijing to Shanghai
-
-
has only one itinerary consisting of the two journeys.
Why passenger info is needed in the API?
Airlines generally charge different fares for passengers at different ages.
When searching for flights, you need to indicate the age of passengers aged under 18. For adults, you can simply describe them using a PTC
: Adult
.
When creating a booking later, we must provide more information about the passengers such as their names and dates of birth.
What will I receive?
We will return a requesting offers object, echoing back your journeys
and passengers
.
We will use the SearchCriteriaToken
of the request to retrieve the search results.
Each passenger is given an PaxID
, which we will need to use to refer to that passenger when making a booking later.
2. Retrieve the search results
To get offers we can use the SearchCriteriaToken
of our request.
After requesting, you will get a list of offers based on the passenger’s eligibility and preferences.
Each offer is unique for its journey(s) and price. You need to show them to John in your user interface so he can choose which offer works best for him.
Shopping API reference
The offer requesting part is done, now you need to actually book a nice trip for John’s family.
please refer to Shopping Offer Service.
Where to go from here?
-
Learn how to book a trip (please refer to Booking)