Flight Availability

## Content - [Postman collection](#postman-collection) - [API Description](#api-description) - [API Parameters](#api-parameters) - [Input](#input-parameters) - [Output](#output-parameters) - [Error Codes](#error-codes) ## Postman collection Please download the postman collection environment and request for API Key to get started. Flight Availability API Collection - Local playground with examples of request/response pairs for each endpoint. Additionally it assist the developers to understand the logical flow for the endpoints. Flight Availability API Environment- Holds the credential information that allows invocation of the endpoints. You can request for the credentials for this specific API [here](/apps/myapps). Request for API key ## API Description | | | | ------------- | ---------------------- | | API Operation | flightavailability/get | | API Type | Query | | Description | Retrieves that current availability of inventory based on provided search criteria | The deepReferralLink is currently only available for single-leg flights in each segmentBound. Also, in order to use the deepReferralLink, one deepReferralLink from each segmentBound have to be combined with the shallowReferralLink (+ defaultAffiliateID). ## API Parameters ### HTTP Headers | Headers | Value | Description | | ------------------ | --------- | ---------------------------------------------------------------------------- | |Content-Type|application/json|| |apikey|*|An active SQ API Key for the FlightSearch Package| ### Input Parameters | Input Parameters | Data Type | Optional | Description | | ---------------------- | ----------- | -------- | ------------------------------------------------------------------------------------------ | |clientUUID|String|No|Should be unique per request. For debug purpose only.| |request|JSON Object|No|| |itineraryDetails|JSON Array|No|| |originAirportCode|String|No|3-letter IATA code – SIN, LHR. In upper case.| |destinationAirportCode|String|No|3-letter IATA code – SIN, LHR. In upper case.| |departureDate|String|No|Format: yyyy-MM-dd| |returnDate|String|Yes|Format: yyyy-MM-dd. For round trip only| |cabinClass|String|No|Cabin class: Y, J, F, S| |adultCount|Number|No|| |childCount|Number|Yes|| |infantCount|Number|Yes|| |flexibleDates|Boolean|Yes|true: calendar search; false: flight search (default)| |daterange|Number|Yes|For flexi-date search only ("true" above). 1 for a range of 3 days; 2 for a range of 5-days, 3 for a range of 7-days, while 0 for default.| |locale|String|Yes|Defaults to “en_UK”| |country|String|Yes|2 char IATA country code. Defaults to “SG”| ### Output Parameters | Output Parameters | Data Type | Description | | --------------------------- | ----------- | ----------------------------------------------------------------------------------- | |status|String|“SUCCESS” / “FAILURE”| |code|Number|200 if status is “SUCCESS”. Refer to Section 5 for possible error codes| |message|String|Error message if status is “FAILURE”| |clientUUID|String|| |response|JSON Object|| |sessionID|String|ERetail session ID| |pageTicket|String|| |resultType|String|F: flight seach; C: calendar search| |currency|JSON Object|| |code|String|Currency code, e.g. SGD| |name|String|| |precision|Number|Currency precision, e.g. 2| |tripType|String|O: One-way; R: Round trip; M: Multi-city| |shallowReferralLink|String|Referral Link to singaporeair.com (non-specific to any selection)| |defaultAffiliateID|String|Referral To be used with the above during testing phase (if an affiliate ID has not already been generated for the caller)| |defaultRecommendationID|Number|For flight search only| |recommendations|JSON Array|For flight search only| |recommendationID|Number|| |segmentBounds|JSON Array|| |segments|JSON Array|| |segmentID|Number|| |deepReferralLink|String|To be combined with shallowReferralLink to form a link to singaporeair.com which is specific to the flights selected by pax| |numOfLastSeats|Number|| |displayLastSeat|BOOL|| |legs|JSON Array|| |sellingClass|String|Selling class, e.g. W| |cabinClass|String|Cabin class, e.g. Y| |fareClass|String|Fare class, e.g. WLXGBO| |eligibleOCRecommendationIDs|JSON Array|Numerical JSON array| |fareFamily|String|Fare family for separate segment bound, e.g. FF31LON| |fareSummary|JSON Object|Fare summary for separate segment bound. See below “fareSummary for recommendation”| |fareFamily|String|Fare family for recommendation, e.g. FF31LON| |fareSummary|JSON Object|Fare summary for recommendation| |fareTotal|JSON Object|| |totalAmount|BigDecimal|| |amountWithoutTax|BigDecimal|| |tax|BigDecimal|| |fareDetailsPerAdult|JSON Object|See above “fareTotal”| |creditCardSurchargeFlag|BOOL|| |creditCardSurchargeValue|BigDecimal|| |flights|JSON Array|For flight search only| |originAirportCode|String|3-letter IATA code – SIN, LHR. In upper case.| |destinationAirportCode|String|| |departureDate|String|Format: yyyy-MM-dd| |segments|JSON Array|| |segmentID|Number|| |originAirportCode|String|| |destinationAirportCode|String|| |departureDateTime|String|Format: yyyy-MM-dd HH:mm:ss| |arrivalDateTime|String|Format: yyyy-MM-dd HH:mm:ss| |legs|JSON Array|| |flightNumber|String|E.g. 5739| |originAirportCode|String|| |destinationAirportCode|String|| |departureTerminal|String|E.g. 2, TN. It may be null.| |arrivalTerminal|String|| |departureDateTime|String|| |arrivalDateTime|String|| |codeShareFlight|BOOL|true for code share flight| |operatingAirline|JSON object|| |code|String|E.g. SQ| |name|String|E.g. Singapore Airlines| |marketingAirline|JSON object|See “operatingAirline”| |aircraft|JSON object|| |code|String|E.g. 77W| |name|String|E.g. Boeing 777-300ER| |stops|JSON Array|| |arrivalDateTime|String|| |departureDateTime|String|| |airportCode|String|| |layoverDuration|Number|Layover duration in seconds| |flightDuration|Number|Flight duration for current leg| |layoverDuration|Number|Layover duration between current and next leg| |tripDuration|Number|Trip duration in seconds| |fareFamilies|JSON Array|For flight search only| |fareFamily|String|Fare family, e.g. FF31LON| |fareFamilyCode|String|Fare family code, e.g. FF31| |fareFamilyName|String|Fare family name, e.g. Economy Flexi Saver| |cabinClass|String|Cabin class, e.g. Y| |cabinClassName|String|Cabin class name, e.g. Economy| |airports|JSON Array|For flight search only| |airportCode|String|| |airportName|String|| |cityCode|String|| |cityName|String|| |stateCode|String|| |stateName|String|| |countryCode|String|| |countryName|String|| |segments|JSON Array|For flexi-date search only| |originAirportCode|String|| |destinationAirportCode|String|| |fares|JSON Array|| |departureDate|String|Format: yyyy-MM-dd| |returnDate|String|Format: yyyy-MM-dd| |price|BigDecimal|Total adult price| |perAdultPrice|BigDecimal|Price per adult| |totalPrice|BigDecimal|Total price| |lowestPrice|BOOL|| ## Error Codes | Code | Details | | ---------- | ------------------------------------------------------------------------------------------- | | 9900 | The requested service is not available. | | 9998 | (Unhandled Exception) Unknown error occurs. Please contact CSL team for details. | | 9999 | (Unknown error) Unknown error occurs. Please contact CSL team for details. | | FAVASF0001 | Invalid request format | | FAVASF0002 | Invalid input | | FAVASF0003 | The itinerary details must be provided | | FAVASF0004 | Your input of airport code <%s> is invalid. | | FAVASF0005 | Your input of flight date <%s> is invalid. The format must be YYYY-MM-dd (e.g. 2017-07-01). | | FAVASF0006 | A return date must be provided for round trip. | | FAVASF0007 | A return date must be not earlier than departure date. | | FAVASF0008 | The provided cabin class <%s> is invalid. Only <%s> are allowed. | | FAVASF0009 | The infant count <%d> must be no more than adult count <%d>. | | FAVASF0010 | Maximum %d people allowed for flight booking with cabin class <%s>. | | FAVASF0011 | Maximum %d people allowed for flight booking. | | FAVASF0012 | corpDetails is required for Corp booking.. | | FAVASF0013 | corpCode is required for Corp Booking. | | FAVASF0014 | promoDeails is required for promotional booking. | | FAVASF0015 | Invalid or missing promo type. Only <%s> are allowed. | | FAVASF0016 | Invalid or missing selling class. | | FAVASF0017 | promoCode is required for non-Passthru promotional booking. | | FAVASF0018 | Invalid or missing minPax under promoDetails. | | FAVASF0019 | The destination airport code should be different with origin airport code. | | FAVASF0020 | The requested departure date <%s> is too soon. Please modify your dates and try again. | | FAVASF0021 | The requested departure date <%s> is too late. Please modify your dates and try again. | | FAVASF0022 | The input <%s> is required. | | FAVASF0050 | eRetail generic error | | FAVASF0051 | (eRetail) No flight available | | FAVASF0052 | (eRetail) Dep date too soon | | FAVASF0053 | (eRetail) Dep date too late | | FAVASF0054 | (eRetail) Intra city flight | | FAVASF0055 | (eRetail) Invalid OD | | FAVASF0056 | (eRetail) Timeout | | FAVASF0057 | (eRetail) System error. | | FAVASF0080 | (Unable to get eRetail response) Internal server error. Please contact CSL team for help. | | FAVASF0081 | (Invalid eRetail response) Internal server error. Please contact CSL team for help. | | FAVASF0082 | (No recommendation) There is no available routes for your search. |