Parsing ItineraryCost
FAB_BasketRS/CurrentBasket/Itinerary/ItineraryCost is a key response object. It contains details of the itinerary costs, including both totals and a breakdown.
Snippet example
<ItineraryCost TotalCost="536.77" CostingStage="confirmed" CostingAccuracy="100" BasedOn="Flight Only" PartyInfoCheck="3 adult(s), 0 infant(s), and no young people." DepositRequiredAtBooking="536.77" CostingValid="true" Currency="GBP">
<Component Supplier="XCE" CostingStage="confirmed" TotalCost="536.77" DepositRequiredAtBooking="536.77" UpdatedTime="20210721 1911" Currency="GBP" HostSystemRequiresPaymentCard="true">
<Detail Description="Outbound Adult Base Price" UnitCost="73.77" Quantity="3" ExtendedCost="221.31" Currency="GBP" PriceDescription="Adult Flight Outbound" PriceCode="Fl1Ad" FPC="basic.adult.flight.1">
<SourceCostDetail SourceUnitCost="73.77" SourceCurrency="GBP" UnitCost="73.77" UnitMarkup="0.0"/>
</Detail>
<Detail Description="Outbound Adult Tax" UnitCost="29.22" Quantity="3" ExtendedCost="87.66" Currency="GBP" PriceDescription="Flight Tax Outbound" PriceCode="TxFl1" FPC="tax.adult.flight.1">
<SourceCostDetail SourceUnitCost="29.22" SourceCurrency="GBP" UnitCost="29.22" UnitMarkup="0.0"/>
</Detail>
<Detail Description="Inbound Adult Base Price" UnitCost="76.81" Quantity="3" ExtendedCost="230.43" Currency="GBP" PriceDescription="Adult Flight Homebound" PriceCode="Fl2Ad" FPC="basic.adult.flight.2">
<SourceCostDetail SourceUnitCost="76.81" SourceCurrency="GBP" UnitCost="76.81" UnitMarkup="0.0"/>
</Detail>
<Detail Description="Inbound Adult Tax" UnitCost="14.18" Quantity="3" ExtendedCost="42.54" Currency="GBP" PriceDescription="Flight Tax Homebound" PriceCode="TxFl2" FPC="tax.adult.flight.2">
<SourceCostDetail SourceUnitCost="14.18" SourceCurrency="GBP" UnitCost="14.18" UnitMarkup="0.0"/>
</Detail>
<Detail Description="Promotional Discount" UnitCost="-45.17" Quantity="1" ExtendedCost="-45.17" Currency="GBP" PriceDescription="Discount" PriceCode="Sp" FPC="supplement.party.discount">
<SourceCostDetail SourceUnitCost="-45.17" SourceCurrency="GBP" UnitCost="-45.17" UnitMarkup="0.0"/>
</Detail>
<Detail Description="Estimated Supplier Booking Charge" UnitCost="0.0" Quantity="1" ExtendedCost="0.0" Currency="GBP" PriceDescription="Supplement" PriceCode="Sp" FPC="supplement.party.handling">
<SourceCostDetail SourceUnitCost="0.0" SourceCurrency="GBP" UnitCost="0.0" UnitMarkup="0.0"/>
</Detail>
An ItineraryCost is broken down into one or more Component costs. Each Component is then broken down into one or more Detail costs.
An example of a Component would be a flight (can have multiple segments if on the same PNR). An example of a Detail would be a fare.
Note
Note that this snippet only contains a singleComponent.Notes on parsing
- At a minimum you could just parse
ItineraryCost@TotalCostandTotalCost@Currency. - Alternatively/additionally you could parse
Component@TotalCostandComponent@Currencyto have a total per component. - If you wish to breakdown costs further you would likely use the following attributes:
Detail@Description- this text description is human readable so you could display to consumer. However, it can be inconsistent across suppliers so you may prefer to ignore it and instead rely onFPC.Detail@UnitCost- you could use this and combine withQuantityto get a cost for the Detail- Or just rely on
ExtendedCost
- Or just rely on
Detail@Quantity- useful when combined withUnitCostDetail@ExtendedCost- equivalent toUnitCostmultiplied byQuantityDetail@Currency- currency ofUnitCostandExtendedCostDetail@FPC- AnFPCencodes a number of pieces of useful information, see reference page for more info.- The “Type” part of the
FPCallows you to do a high level categorisation. E.g tax/fee/etc - The “Sub-Type 1” part of the
FPCindicates how the cost applies. E.g does it apply to adults/children/infants/passengers or the whole party. - The “Sub-Type 2” part of the
FPCcan be combined with the “Type” to support fine grain categorisation. E.g a baggage fee vs a flight tax. - Finally the
FPCmay have a.1or.2appended to indicate that the cost only applies to the outbound or inbound respectively.
- The “Type” part of the
Worked example from snippet
So using the above notes (and linked reference pages) we could parse the snippet FPCs like so:
basic.adult.flight.1basic+flight= Flight fare- Though as per reference page the fare may include fees/taxes if the supplier does not provide discrete values
adult= applies to one or more adults in the party- Can use
Quantityas an approximate indicator of how many adults it applies to. But note thatQuantitymay not equal the number of adults; this is particularly common when the FPC refers to a bag.
- Can use
.1= applies to the outbound flight only
basic.adult.flight.2- Same logic as previous FPC but
.2= applies to the inbound flight only
- Same logic as previous FPC but
tax.adult.flight.1tax+flight= Flight taxadult= applies to one or more adults in the party- Can use
Quantityas an approximate indicator of how many adults it applies to. But note thatQuantitymay not equal the number of adults; this is particularly common when the FPC refers to a bag.
- Can use
.1= applies to the outbound flight only
tax.adult.flight.2- Same logic as previous FPC but
.2= applies to the inbound flight only
- Same logic as previous FPC but
supplement.party.discountsupplement+discount= A discountparty= applies to the whole party- No
.1or.2= applies to all flights in the component
supplement.party.handlingsupplement+handling= A handling or card feeparty= applies to the whole party- No
.1or.2= applies to all flights in the component
Note
We can’t be certain that the same FPCs will return across multiple baskets, hence why this ‘dynamic’ parsing is appropriate.Last modified November 30, 2022