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.

Notes on parsing

  • At a minimum you could just parse ItineraryCost@TotalCost and TotalCost@Currency.
  • Alternatively/additionally you could parse Component@TotalCost and Component@Currency to 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 on FPC.
    • Detail@UnitCost - you could use this and combine with Quantity to get a cost for the Detail
      • Or just rely on ExtendedCost
    • Detail@Quantity - useful when combined with UnitCost
    • Detail@ExtendedCost - equivalent to UnitCost multiplied by Quantity
    • Detail@Currency - currency of UnitCost and ExtendedCost
    • Detail@FPC - An FPC encodes a number of pieces of useful information, see reference page for more info.
      • The “Type” part of the FPC allows you to do a high level categorisation. E.g tax/fee/etc
      • The “Sub-Type 1” part of the FPC indicates 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 FPC can be combined with the “Type” to support fine grain categorisation. E.g a baggage fee vs a flight tax.
      • Finally the FPC may have a .1 or .2 appended to indicate that the cost only applies to the outbound or inbound respectively.

Worked example from snippet

So using the above notes (and linked reference pages) we could parse the snippet FPCs like so:

  • basic.adult.flight.1
    • basic + 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 Quantity as an approximate indicator of how many adults it applies to. But note that Quantity may not equal the number of adults; this is particularly common when the FPC refers to a bag.
    • .1 = applies to the outbound flight only
  • basic.adult.flight.2
    • Same logic as previous FPC but .2 = applies to the inbound flight only
  • tax.adult.flight.1
    • tax + flight = Flight tax
    • adult = applies to one or more adults in the party
      • Can use Quantity as an approximate indicator of how many adults it applies to. But note that Quantity may not equal the number of adults; this is particularly common when the FPC refers to a bag.
    • .1 = applies to the outbound flight only
  • tax.adult.flight.2
    • Same logic as previous FPC but .2 = applies to the inbound flight only
  • supplement.party.discount
    • supplement + discount = A discount
    • party = applies to the whole party
    • No .1 or .2 = applies to all flights in the component
  • supplement.party.handling
    • supplement + handling = A handling or card fee
    • party = applies to the whole party
    • No .1 or .2 = applies to all flights in the component

Last modified November 30, 2022