TravelCaster API - Flights - GetFlightAvailability operation

Back to Flights home.


Once connected to the TravelCaster API, you can search for fares for a specific itinerary, indicating origin, destination, flight date and the quantity of passengers travelling. In each fare, you will find at least one flight option for each queried flight leg. This gives you the ability to provide your customers with a wider choice of flight options for the same price, combining them freely.

The GetFlightAvailability operation returns a FlightRecommendation object, containing an array of flight fares with their corresponding flight options. The fares are already ordered, cheaper fares first. To call this operation you will need a valid token, obtained previously with the GetAccessToken operation. If your token is no longer valid, you will receive a 1210 error. See the Transaction Codes page for more information.

We recommend not to implement a system that automatically requests several GetFlightAvailability just to storing information, send a request when receives a request from the end user.
Usually, the provider has to implements Cache to support the multiple requests, which becomes in an increase of SellFailures (UC) at the BookingFlight (1507) time.

Request

JSON

http://endpoint/api/version/FlightService.json/GetFlightAvailability [POST]

url-encoded parameter: query ([FlightAvailabilityQuery])

returns: FlightRecommendation

Note: sending url-encoded parameter should look like this:

query=%3CFlightAvailabilityQuery%3E%3CToken%3E[...|...]%3C%2FFlightAvailabilityQuery%3E

WebService

http://endpoint/api/version/FlightService.asmx

operation: GetFlightAvailability

parameters: query ([FlightAvailabilityQuery])

returns: FlightRecommendation

Structure of the FlightAvailabilityQuery object

FlightAvailabilityQuery
 |
 |_ Token (string)
 |_ Legs (QueryLeg[])
 |  |
 |  |_ DepartureAirportCity (string - IATA 3-letter)
 |  |_ ArrivalAirportCity (string - IATA 3-letter)
 |  |_ FlightDate (string - ISO 8601 YYYY-MM-DD)
 |
 |_ Passengers (PaxOption[])
 |  |
 |  |_ Type (string - ADT, CHD, INF)
 |  |_ SubType (string - not used)
 |  |_ Count (int - 1+)
 |  |_ Age (int - not used)
 |
 |_ Airlines (string[] - optional - IATA 2-letter - MarketingCarrier)
 |_ ExcludedAirlines (string[] - optional - IATA 2-letter - MarketingCarrier)
 |_ CabinClasses (string[] - optional - 1-letter:  Y = Economy, B = Business, F = First, W = Premium Economy, null = all cabins) 
 |_ Currency (string - optional - ISO 3-letter)
 |_ Market (string - optional - IATA country 2-letter) 

Structure of the FlightRecommendation object

 FlightRecommendation
 |
 |_ Token (string)
 |_ TransactionID (string)
 |_ TransactionCode (string)
 |_ TransactionMessage (string)
 |
 |_ CacheID (string - internal use only)
 |_ RecommendationID (string)
 |_ Fares (FlightFare[])
    |
    |_ FareID (string)
    |_ FareAmount (double)
    |_ TaxAmount (double)
    |_ ServiceAmount (double)
    |_ CommissionAmount (double - informative amount)
    |_ TotalAmount (double - total payable amount)
    |_ PaxFares (PaxFare[] - one for each passenger type queried)
       |
       |_ PaxFareAmount (double)
       |_ PaxTaxAmount (double)
       |_ PaxCommissionAmount (double)
       |_ PaxTotalAmount (double)
       |_ PaxType (string)
       |_ PaxSubType (string)
       |_ Count (int)
       |_ PaxTaxDetail (FareTax[])
          |_ Code (string, as provided by the supplier)
          |_ Amount (decimal)
          |_ Currency (string - ISO 3-letter)
    |
    |_ Currency (string - ISO 3-letter code)
    |_ LastTicketingDate (string - ISO 8601 combined YYYY-MM-DDThh:mm:ss.fffZ)
    |_ ValidatingCarrier (string - IATA 2-letter code)
    |_ Legs (FlightLeg[])
       |
       |_ LegNumber (int - 1-based)
       |_ Options (FlightOption[])
          |
          |_ FlightOptionID (string)
          |_ OptionDuration (int - in minutes)
          |_ Segments (FlightSegment[])
             |
             |_ SegmentNumber (int)
             |_ Airline (string - IATA 2-letter code)
             |_ OperatingAirline (string  IATA 2-letter code)
             |_ FlightNumber (int)
             |_ BookingClasss (string - 1-letter)
             |_ CabinClass (string - 1-letter. Y=Economy, W=Premium Economy, B or C=Business, F=First)
             |_ Duration (int - segment duration in minutes)
             |_ Departure (FlightEvent)
                |
                |_ AirportCode (string - IATA 3-letter code)
                |_ Date (string - ISO 8601 YYYY-MM-DD format)
                |_ Time (string - HH:MM format)
             |
             |_ Arrival (FlightEvent)
                |
                |_ (same as Departure)
             |
             |_ Stops (FlightEvent)
                |
                |_ Date (string - ISO 8601 YYYY-MM-DDThh:mm format, arrival to stop in local time)
                |_ AirportCode (string - IATA 3-letter code)
                |_ Time (string - HH:MM format, expresses stop duration)
             |
             |_ Status (string)
             |_ Baggage (string - value in pieces or weight or both [1PC or 23K or 2PC-20K] )
             |_ FareBasis (string)
             |_ BrandName (string - Brand Name of the selected offer)
             |_ AvailStatus (int - avail quantity for the selected BookingClasss)
    |_ TaxDetail (FareTax[])
       |_ Code (string, as provided by the supplier)
       |_ Amount (decimal)
       |_ Currency (string - ISO 3-letter)
    |_ FareType (string [N]EG  [P]UB)    
    |_ FareCode (string - fare code for upsell-fare selection)
    |_ IataCountry (string - ISO 3166-1)
    |_ IataCurrency (string - ISO 3-letter code. The final chargable currency)
    |_ IataTotalAmount (decimal - TotalAmount in final currency)
    |_ MaxInstallments (int - Max posible Installments. Check FareConfirmation for full response)
    |_ BaseCurrency (string - ISO 3-letter code)
    |_ BaseCurrencyRatio (decimal)
    |_ FareSupplier (string -  GDS,LOW,NDC,AGG)
    |_ FareSupplierCode (string - point of sale detail)
    |_ Commission  (commission applied to the option)
       |_ Percentage (double)
       |_ Over (double - Overcommission) 
    |_ AllowedFOPs (string[]) - ALL, CASH, CARD, MULTIFOP
    |_ CancelPolicy (string - 
         NONE = Product can not be cancel.
         MDNT = Cancel up to POS Midnight.
         HS24 = Cancel up to 24hs after issue.
         MDNT8D = Cancel up to POS Midnight and the difference between first segment and issue ticket day must be greater than 8 days.)
    |_ FareFeatures (FareFeatureInfo[])
       |_ Code (string)
       |_ Value (string)
       |_ Description (string)
    
    ===New in API 1.6 - Revenue Information and Messaging===
    |_ ExtendedFareInfo (new container for revenue information)
       |_ NetFareAmount (decimal - base GDS fare amount + revenue calculations, including fee)
       |_ NetTaxAmount (decimal - base GDS tax amount + revenue calculations, including fee tax if applicable)
       |_ NetTotalAmount (decimal - total net amount)
       |_ AdditionalTaxes (AdditionalTax[] - additional taxes derived from revenue management)
          |_ Code (string)
          |_ Value (decimal)
          |_ Included (bool - indicates if the tax has been included in the price)
       |_ Fee (detailed fee information)
          |_ Amount (decimal - total fee amount)
          |_ PaxDetail 
             |_ PTC (string - passenger type)
             |_ AmountPerPax (decimal - fee amount per single pax of this PTC type)
       |_ Commission (detailed commission information)
          |_ Amount (decimal - total commission amount)
          |_ PaxDetail 
             |_ PTC (string - passenger type)
             |_ AmountPerPax (decimal - commission amount per single pax of this PTC type)
       |_ Over (detailed over information)
          |_ Amount (decimal - total over amount)
          |_ PaxDetail 
             |_ PTC (string - passenger type)
             |_ AmountPerPax (decimal - over amount per single pax of this PTC type)       
    |_ FareMessages (new container for custom fare informations)
       |_ Items (FareMessage[])
          |_ MessageType (string - message category, e.g. Baggage, TravelRequirement, it is defined by client, values can vary, can also be null)
          |_ Level (string - message level, e.g. warning, information, it is defined by client, values can vary, can also be null)
          |_ Text (string - message text)

Notes

  • You can choose to specify either airport or city using the IATA 3-letter code for the departure and arrival points.
  • Dates sent to and from the API are all string-based and in the YYYY-MM-DD ISO-8061 format.
  • For round-trip flight availabilities, just add a second QueryLeg object with the matching data.
  • You must add one PaxOption object for each passenger type to be queried, regardless of how many they are. If there are 2 adults and 1 child, you should have 2 PaxOption objects/nodes (2 ADT + 1 CHD).
  • Available passenger types are: ADT (adults), CHD (children, 2 - 11 years old) and INF (infants, 0 - 2 years old).
  • You can specify the query to be performed on specific airlines and/or cabin classes. Add one or more strings with the IATA 2-letter codes for the airlines, or the 1-letter code for the cabin class.
  • You can specify the query to exclude a list of airlines, setting the ExcludeAirlines parameter using airline's IATA 2-letter code. The ExcludeAirlines field is not considered if Airlines field is not empty.
  • You can specify a country code (IATA 2-letter) to limit the response to the selected market. This will return only offers to issue in local currency.

Change log

Date Affects versions Change detail
2023-09-20 1.6 New fields in FlightFare for revenue and messaging.

Download Postman Collection with full request/response data for JSON version.


Back to Flights home.


See change history for this file
Loading...