Search Workflows
You can combine the Search APIs into various workflows, determined by whether you want more upsells, and whether you want the initial Search to return offers for all legs of the itinerary ( a journey-based search) or only the first leg (a leg-based search). A leg-based search must be followed by a Next Leg Search to return offers on the subsequent leg of the itinerary. For a leg-based, multi-city itinerary you would send Next Leg Search again for the third leg, and so on for additional legs (not shown below).
To set whether the search is journey- or leg-based, send SearchRepresentation with the value Leg for a leg-based search or Journey for a journey-based search. If SearchRepresentation is not sent, the default is a journey-based response. This setting does not apply to one-way searches and is ignored if sent for one-way.
To request upsells in the initial Search response, send maxNumberOfUpsellsToReturn to return up to 4 upsells. For more, you can add the Flight Specific Search API to the workflow. Flight Specific Search is an optional request to return up to 99 upsells (up to as many as the carrier has filed), for any leg The flight or connecting flights between one origin and destination pair. For example, on a round-trip flight, LAX > MSP could be the first leg (aka outbound leg) and MSP > DEN > LAX could be the second leg (aka inbound leg). The JSON APIs use the term product for one leg of the itinerary. or offer
In the JSON Search APIs, an offer is a product available at a specific price under a set of terms and conditions. An offer includes the flight or connecting flights for one leg of the itinerary, plus a service level that includes the cabin class and any fare codes that may apply. At booking, the selected offer from the Search response - including the flight/s, service level, price, terms and conditions, and brand if applicable - is converted into a single Offer object that is subsequently returned for that booking. returned in a preceding Search or Next Leg Search.
Note that you can send Flight Specific Search any time in the workflow after the initial search, and you can send it multiple times. For example, in the last diagram below, you could send Flight Specific Search after Search, either in addition to or instead of sending it after Next Leg Search. Sending Flight Specific Search after the first search allows you consider upsells before requesting options in your Next Leg Search.
Related Content:Air Shopping Guide, JSON APIs Guide, Search API Reference
Each box in the diagram represents one API call in the workflow.