Caching
Introduction
The NDC API includes a distributed Offer-/Order-cache, which is necessary to enable the “shopping-cart” booking flow.
The cache replaces the need to send the complete data with every message with the simple usage of IDs.
Cache Flow
The NDC structure is fully relying on Offers and Orders. These items all have individual IDs to be referenced in following requests.
For example an IATA_AirShoppingRS returns several Offers that look like as follows (simplified):
<Offer>
<OfferID>OFb8295236-7a41-11ea-b330-bfbb959286d4</OfferID>
<OfferItem>
<OfferItemID>OFIb8295236-7a41-11ea-b330-bfbb959286d41</OfferItemID>
<Service>
<PaxRefID>PX1</PaxRefID>
<ServiceAssociations>
<PaxJourneyRefID>FL1</PaxJourneyRefID>
</ServiceAssociations>
<ServiceID>SV1</ServiceID>
</Service>
</OfferItem>
</Offer>
This structure shows the following data:
OfferID
OfferItemID
associated flight
For each IATA_AirShoppingRS this data is stored in the cache. So in a subsequent request (e.g. IATA_OfferPriceRQ), only the IDs have to be referenced (simplified):
<PricedOffer>
<SelectedOffer>
<OfferRefID>OFb8295236-7a41-11ea-b330-bfbb959286d4</OfferRefID>
<SelectedOfferItem>
<OfferItemRefID>OFIb8295236-7a41-11ea-b330-bfbb959286d41</OfferItemRefID>
<PaxRefID>PX1</PaxRefID>
</SelectedOfferItem>
</SelectedOffer>
</PricedOffer>
The NDC API now can retrieve the selected Offer from the cache and has the correct data to request the flight to the airline.
This provides a much more simplified shopping flow for the client, because only the selected IDs have to be stored and send in the following requests instead of the full data.
The Cache also enables the possibility to continue shopping based on previous Orders. In this case, the client has to retrieve the booking once to load the data of the booking into the cache. Please note, that after a booking is created, this will be done automatically. So after a create, no additional retrieve is required, as long as the following communication is done within the cache period.
Using an existing order, the user can shop for ancillaries based on the data of this order.
Samples for all this cache flows will be added to the NDC XML Samples.
Cache times
The NDC API features 3 different sections inside the cache: shopping, Offer and Order. These sections are seperated to enable the possibility of having different cache durations.
The duration of how long Offers/Orders will be cached, can be configured individually for each customer.
The default cache times are:
Shopping (Flight-, Seat- and Service-Offers): 20 Minutes
Offer (Offers returned by IATA_OfferPriceRS): 30 Minutes
Order (Orders returned by IATA_OrderViewRS): 30 Minutes