Air API (v2)

Download OpenAPI description
Languages
Servers
Mock server
https://developer.spotnana.com/_mock/openapi/airapi/
Staging URL
https://apis.spotnana.com/

Air

APIs to perform search, checkout and book an air pnr

Operations

Get air itineraries

Request

Get Air Itineraries available for the given search parameters

Bodyapplication/jsonrequired
travelersArray of objects(TravelerSearchInfo)required

Information about each of the travelers in the search request. This information is required.

travelers[].​travelerTypestring(PassengerType)required

Type of passenger

Enum"UNKNOWN_PASSENGER_TYPE""ADULT""CHILD""INFANT""INFANT_ON_LAP""YOUTH""SENIOR""TEEN"
travelers[].​travelerAgeobject(PassengerAge)

Age of the traveler

travelers[].​travelerInfoAirRequestTravelerInfo (object) or AirRequestTravelerInfo (object)(AirRequestTravelerInfo)
One of:

Wrapper over UserId object to be used as an identifier in a oneOf case

legsArray of objects(SearchLeg)required

The list of all legs for which search results need to be returned.

legs[].​originobject(AirportLocation)required

3 letter IATA airport or metropolitan code for the origin

legs[].​origin.​citystring

The code of a city used to identify a set of airports associated with it. For example, NYC or LON.

Example: "NYC"
legs[].​origin.​airportstring^[A-Z]{3}$

The airport code identifying a specific airport. For example, JFK or EWR.

Example: "JFK"
legs[].​origin.​multiAirportsobject(MultiAirports)

List of airports. All airports should belong to the same country.

legs[].​destinationobject(AirportLocation)required

3 letter IATA airport or metropolitan code for the destination

legs[].​destination.​citystring

The code of a city used to identify a set of airports associated with it. For example, NYC or LON.

Example: "NYC"
legs[].​destination.​airportstring^[A-Z]{3}$

The airport code identifying a specific airport. For example, JFK or EWR.

Example: "JFK"
legs[].​destination.​multiAirportsobject(MultiAirports)

List of airports. All airports should belong to the same country.

legs[].​dateobject(DateModel)required

Date in ISO 8601 standard.

legs[].​date.​iso8601string^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01...required
Example: "2017-07-21"
filtersArray of objects(Filter)

The list of filters to be applied in the search request.

sortOptionsArray of objects(SortOption)

The sort options to be used for ordering the itineraries.

legSearchParamsobject(LegSearchParams)
corporateInfoobject(CorporateInfo)

Corporate data to be collected during the search request workflow.

curl -i -X POST \
  https://developer.spotnana.com/_mock/openapi/airapi/v2/air/search-flights \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "travelers": [
      {
        "travelerType": "ADULT",
        "travelerAge": {
          "numYears": 22
        },
        "travelerInfo": {
          "userId": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          }
        }
      }
    ],
    "legs": [
      {
        "origin": {
          "city": "NYC",
          "airport": "JFK",
          "multiAirports": {
            "airports": [
              "JFK"
            ]
          }
        },
        "destination": {
          "city": "NYC",
          "airport": "JFK",
          "multiAirports": {
            "airports": [
              "JFK"
            ]
          }
        },
        "date": {
          "iso8601": "2017-07-21"
        }
      }
    ],
    "filters": [
      {
        "cabin": {
          "type": "DEFAULT",
          "cabin": "ECONOMY"
        },
        "maxNumStops": 0,
        "timeRange": {
          "timeRanges": [
            {
              "legIndex": 0,
              "departure": {
                "min": {},
                "max": {}
              },
              "arrival": {
                "min": {},
                "max": {}
              }
            }
          ]
        },
        "alliance": {
          "alliances": [
            "STAR_ALLIANCE"
          ],
          "airlines": [
            "string"
          ]
        },
        "fareRange": {
          "min": {
            "amount": 510,
            "currencyCode": "GBP",
            "convertedAmount": 715.42,
            "convertedCurrency": "USD",
            "otherCoinage": [
              {
                "coinageCode": "BREX_POINTS",
                "amount": 1000,
                "conversionRate": 0.01,
                "preferredCurrencyConversionRate": 0.01
              }
            ]
          },
          "max": {
            "amount": 510,
            "currencyCode": "GBP",
            "convertedAmount": 715.42,
            "convertedCurrency": "USD",
            "otherCoinage": [
              {
                "coinageCode": "BREX_POINTS",
                "amount": 1000,
                "conversionRate": 0.01,
                "preferredCurrencyConversionRate": 0.01
              }
            ]
          }
        },
        "airlinePref": {
          "airlinePrefs": [
            {
              "legIndex": 0,
              "airline": [
                "string"
              ]
            }
          ]
        },
        "fareType": "UNKNOWN",
        "changeable": "NO_CHANGEABLE_FILTER",
        "connectingAirports": {
          "legFilters": [
            {
              "legIndex": 0,
              "airportCodes": [
                "string"
              ]
            }
          ]
        },
        "seatPref": {
          "seatTypes": [
            "UNKNOWN"
          ],
          "minPitchInch": 0
        },
        "covid": {
          "vaccine": "NO_PREFERENCE",
          "covidTest": "NO_PREFERENCE",
          "faceMask": "NO_PREFERENCE",
          "temperatureCheck": "NO_PREFERENCE",
          "blockedAdjacentSeats": "NO_PREFERENCE"
        },
        "baggage": {
          "freeCheckedBag": true,
          "freeCarryOn": true
        },
        "flightNumber": {
          "flightNumber": {
            "num": "321",
            "airlineCode": "AA"
          }
        },
        "policyFilter": {
          "onlyInPolicy": true
        },
        "multiTicketFilter": {
          "hideMultiTicket": true
        },
        "fareCategoryFilter": {
          "fareCategories": [
            {
              "ngsCategory": "UNKNOWN_NGS_CATEGORY",
              "cabinViewCategory": "UNKNOWN_CABIN_CATEGORY"
            }
          ]
        },
        "corporateCodeFilter": {
          "corpAccountCodes": [
            "PPF03"
          ]
        },
        "unusedCreditFilter": {
          "hideWithoutCredits": true
        }
      }
    ],
    "sortOptions": [
      {
        "sortBy": "PRICE",
        "sortOrder": "ASCENDING",
        "shelfNumber": 0
      }
    ],
    "legSearchParams": {
      "searchId": "string",
      "selectedRateOptionId": "string",
      "legIndex": 0,
      "asyncRouteHappy": true,
      "pageNumber": 0,
      "pageSize": 0
    },
    "corporateInfo": {
      "preSearchAnswers": {
        "answers": [
          {
            "entityId": "string",
            "userInput": "string",
            "itemIds": [
              0
            ],
            "answers": [
              {
                "item": "string",
                "value": "string",
                "description": "string"
              }
            ],
            "customFieldType": "QUESTION",
            "questionDisplayText": "string",
            "question": {
              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
              "name": "string",
              "questionFormat": "CHECKBOX",
              "optionInfo": {
                "source": "MANUAL",
                "sourceMetadata": {},
                "totalNumOptions": 0,
                "options": [
                  null
                ]
              },
              "isRequired": true,
              "isDisabled": true,
              "includeInItinerary": true,
              "customFieldLocations": [
                "POLICY_APPROVAL_EMAIL"
              ],
              "matchConditions": {
                "travelerConditions": {
                  "workerTypes": [],
                  "countries": [],
                  "legalEntities": [],
                  "departments": [],
                  "costCenters": [],
                  "offices": []
                },
                "travelTypes": [
                  null
                ],
                "travelRegionTypes": [
                  null
                ],
                "tripUsageTypes": [
                  null
                ]
              },
              "questionType": {
                "preSearchQuestionType": "PURPOSE_OF_TRIP",
                "preCheckoutQuestionType": "OOP_REASON_CODE"
              }
            }
          }
        ],
        "userEntitiesResponseId": "string"
      }
    }
  }'

Responses

OK

Bodyapplication/json
searchIdstringrequired

The unique ID for this search response. This value must be passed on in the subsequent booking API calls.

Example: "ChBjZDg3ZjRjZmRmMTFmMWFiEhBjZDg3Z"
itineraryDetailsobject(ItineraryInfo)required

Describes the detailed itinerary information provided in the search response.

itineraryDetails.​itinerariesArray of objects(AirItin)
itineraryDetails.​flightDataArray of objects(FlightCommon)

The set of flights and their details that are contained in this response.

paginationParamsobject(PaginationResponseParams)

Pagination parameters for response.

metadataobject(AirMetadata)

Metadata associated with the air search response.

Response
application/json
{ "searchId": "ChBjZDg3ZjRjZmRmMTFmMWFiEhBjZDg3Z", "itineraryDetails": { "itineraries": [], "flightData": [] }, "paginationParams": { "numResults": 0, "numPages": 0 }, "metadata": { "airlineInfo": [], "applicableAlliances": [], "legBylegPricing": true, "enableFareCategories": [] } }

Get flight attributes

Request

Get Flight attributes, amenities and fare rules for the given search response id. Returns the full air search response along with attribute details.

Bodyapplication/jsonrequired
searchIdstringrequired

The unique ID for the search response for which the attributes are being requested.

Example: "ChBjZDg3ZjRjZmRmMTFmMWFiEhBjZDg3Z"
curl -i -X POST \
  https://developer.spotnana.com/_mock/openapi/airapi/v2/air/flight-attributes \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "searchId": "ChBjZDg3ZjRjZmRmMTFmMWFiEhBjZDg3Z"
  }'

Responses

OK

Bodyapplication/json
searchIdstringrequired

The unique ID for this search response. This value must be passed on in the subsequent booking API calls.

Example: "ChBjZDg3ZjRjZmRmMTFmMWFiEhBjZDg3Z"
itineraryDetailsobject(ItineraryInfo)required

Describes the detailed itinerary information provided in the search response.

itineraryDetails.​itinerariesArray of objects(AirItin)
itineraryDetails.​flightDataArray of objects(FlightCommon)

The set of flights and their details that are contained in this response.

paginationParamsobject(PaginationResponseParams)

Pagination parameters for response.

metadataobject(AirMetadata)

Metadata associated with the air search response.

Response
application/json
{ "searchId": "ChBjZDg3ZjRjZmRmMTFmMWFiEhBjZDg3Z", "itineraryDetails": { "itineraries": [], "flightData": [] }, "paginationParams": { "numResults": 0, "numPages": 0 }, "metadata": { "airlineInfo": [], "applicableAlliances": [], "legBylegPricing": true, "enableFareCategories": [] } }

Get selected itinerary

Request

Get the selected itinerary for the traveler in the search and checkout flow.

Bodyapplication/jsonrequired
searchIdstringrequired

The searchId returned in the corresponding air search API response.

Example: "ChBjZDg3ZjRjZmRmMTFm"
itineraryIdstringrequired

The itineraryId of the itinerary selected by the user in the corresponding air search API response.

Example: "IthBjZDg3ZjRjZmRmMTFm"
curl -i -X POST \
  https://developer.spotnana.com/_mock/openapi/airapi/v2/air/selected-itinerary \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "searchId": "ChBjZDg3ZjRjZmRmMTFm",
    "itineraryId": "IthBjZDg3ZjRjZmRmMTFm"
  }'

Responses

OK

Bodyapplication/json
itineraryobject(AirItin)required

Describes an itinerary containing legs and flights.

itinerary.​itineraryIdstringrequired

The unique ID for this itinerary.

Example: "kjdUjak8hX"
itinerary.​legsArray of objects(AirLegInfo)required
itinerary.​legs[].​idstringrequired

The unique ID for this leg.

Example: "leg_0"
itinerary.​legs[].​flightsArray of objects(FlightDetail)required

Details of the list of flights present in the leg.

itinerary.​legs[].​flights[].​idstringrequired

The unique ID for this flight in the itinerary.

Example: "flight_0"
itinerary.​legs[].​flights[].​flightDataFlightData (object) or FlightData (object)(FlightData)
One of:

Wrapper of flight reference to be used in oneOf.

itinerary.​legs[].​flights[].​cabinstring(Cabin)required

Flight cabin

Enum"UNKNOWN_CABIN""ECONOMY""PREMIUM_ECONOMY""BUSINESS""FIRST"
itinerary.​legs[].​flights[].​bookingCodestring

The airline's one-letter code for the associated fare

Example: "B"
itinerary.​legs[].​flights[].​seatAvailabilityinteger(int32)

The availability of seats on this flight

Example: 9
itinerary.​legs[].​flights[].​corpAccountCodestring

The account code is used to get corporate negotiated price

Example: "DFG"
itinerary.​legs[].​flights[].​carbonEmissionobject(CO2EmissionDetail)

CO2 emission details for the flight.

itinerary.​legs[].​flights[].​amenitiesArray of SeatAmenityWrapper (object) or WifiAmenityWrapper (object) or PowerAmenityWrapper (object) or EntertainmentAmenityWrapper (object) or BeverageAmenityWrapper (object) or AircraftAmenityWrapper (object) or LayoutAmenityWrapper (object) or FreshFoodAmenityWrapper (object) or CleaningAmenityWrapper (object) or MaskAmenityWrapper (object) or TemperatureAmenityWrapper (object) or PassengerCapacityAmenityWrapper (object) or BlockedAdjacentSeatsAmenityWrapper (object) or CovidTestingAmenityWrapper (object) or VaccineAmenityWrapper (object)(AirAmenity)

The amenities associated with the flight.

itinerary.​legs[].​flights[].​flightAttributesArray of objects(FlightAttribute)

The set of product attributes associated with the flight.

itinerary.​legs[].​travelerInfosArray of objects(TravelerLegInfo)required

Details of passenger(s) information for this leg.

itinerary.​legs[].​travelerInfos[].​travelerIdstringrequired

Unique identifier for the traveler in this response

Example: "adult_0"
itinerary.​legs[].​travelerInfos[].​travelerLegFareobject(FareAmount)

Fare amount including base fare and tax.

itinerary.​legs[].​travelerInfos[].​fareRulesobject(FareRules)

The rules and restrictions associated with the fare.

itinerary.​legs[].​totalLegFareobject(FareAmount)required

Fare amount including base fare and tax.

itinerary.​legs[].​totalLegFare.​baseobject(Money)required

Money object containing details such as the amount, the currency code, and the converted amount.

itinerary.​legs[].​totalLegFare.​base.​amountnumber(double)required

The numeric value for the amount of money.

Example: 510
itinerary.​legs[].​totalLegFare.​base.​currencyCodestringrequired

The 3-letter currency code for the money amount (defined using ISO 4217 standard).

Example: "GBP"
itinerary.​legs[].​totalLegFare.​base.​convertedAmountnumber(double)

The converted currency and amount that has been converted (if a currency conversion has been requested). For example, if the call requests that money be sent in a specified currency (because the frontend requested the backend to send money in the user's preferred currency).

Example: 715.42
itinerary.​legs[].​totalLegFare.​base.​convertedCurrencystring

The 3-letter currency code for the converted currency (defined using ISO 4217 standard).

Example: "USD"
itinerary.​legs[].​totalLegFare.​base.​otherCoinageArray of objects(OtherCoinage)

List of the dollar amount in other coinage systems like reward points, cryptocurrency etc.

itinerary.​legs[].​totalLegFare.​taxobject(Money)required

Money object containing details such as the amount, the currency code, and the converted amount.

itinerary.​legs[].​totalLegFare.​tax.​amountnumber(double)required

The numeric value for the amount of money.

Example: 510
itinerary.​legs[].​totalLegFare.​tax.​currencyCodestringrequired

The 3-letter currency code for the money amount (defined using ISO 4217 standard).

Example: "GBP"
itinerary.​legs[].​totalLegFare.​tax.​convertedAmountnumber(double)

The converted currency and amount that has been converted (if a currency conversion has been requested). For example, if the call requests that money be sent in a specified currency (because the frontend requested the backend to send money in the user's preferred currency).

Example: 715.42
itinerary.​legs[].​totalLegFare.​tax.​convertedCurrencystring

The 3-letter currency code for the converted currency (defined using ISO 4217 standard).

Example: "USD"
itinerary.​legs[].​totalLegFare.​tax.​otherCoinageArray of objects(OtherCoinage)

List of the dollar amount in other coinage systems like reward points, cryptocurrency etc.

itinerary.​legs[].​fareCategoryobject(FareCategory)required

Fare category of this leg. It describes the cabin class for this flight.

itinerary.​legs[].​fareCategory.​ngsCategorystring(NGSFareCategory)
Enum"UNKNOWN_NGS_CATEGORY""BASE""STANDARD""ENHANCED""PREMIUM""LUXURY""ULTRA_LUXURY"
itinerary.​legs[].​fareCategory.​cabinViewCategorystring(CabinViewFareCategory)
Enum"UNKNOWN_CABIN_CATEGORY""BASIC""ECONOMY""PREMIUM_ECONOMY""ECONOMY_PLUS""BUSINESS""FIRST"
itinerary.​legs[].​brandNamestring

The brand name advertised by the airline.

Example: "Economy Flex"
itinerary.​legs[].​brandCodestring

The brand code assigned by the airline corresponding brandName.

Example: "AADOM-MAIN"
itinerary.​legs[].​validatingAirlinestring

The airline code for the airline which is validating this booking and orchestrating the payment.

Example: "AA"
itinerary.​legs[].​rateTypestring(RateType)

Type of booked fare

Enum"RATE_TYPE_UNKNOWN""PUBLISHED""TMC_NEGOTIATED""COMPANY_NEGOTIATED"
itinerary.​legs[].​vendorProgramTypestring(VendorProgramType)

The type of the vendor program

Enum"UA_PASS_PLUS""GENERIC_PROGRAM_TYPE"
itinerary.​travelersArray of objects(TravelerDetail)required
itinerary.​travelers[].​travelerIdstringrequired

Unique identifier for the traveler in this response

Example: "adult_0"
itinerary.​travelers[].​travelerTypestring(PassengerType)required

Type of passenger

Enum"UNKNOWN_PASSENGER_TYPE""ADULT""CHILD""INFANT""INFANT_ON_LAP""YOUTH""SENIOR""TEEN"
itinerary.​travelers[].​travelerAgeobject(PassengerAge)

Age of the traveler

itinerary.​travelers[].​fareInfoobject(FareInfo)required

The detailed information about the fare (including tax and merchant fee details).

itinerary.​travelers[].​fareInfo.​totalFareobject(FareAmount)required

Fare amount including base fare and tax.

itinerary.​travelers[].​fareInfo.​totalFare.​baseobject(Money)required

Money object containing details such as the amount, the currency code, and the converted amount.

itinerary.​travelers[].​fareInfo.​totalFare.​taxobject(Money)required

Money object containing details such as the amount, the currency code, and the converted amount.

itinerary.​travelers[].​fareInfo.​taxBreakdownArray of objects(TaxBreakdown)

Details about of the tax amount in totalFare field.

itinerary.​travelers[].​fareInfo.​merchantFeeInfoobject(MerchantFeeInfo)

Describes the merchant fee applicable on the itinerary.

itinerary.​travelers[].​fareMetadataobject(FareMetadata)

Metadata about pax fare

itinerary.​fareInfoobject(FareInfo)

The detailed information about the fare (including tax and merchant fee details).

itinerary.​ticketTypestring(TicketType)required

The ticket issuance type for a given itinerary, whether single or multiple

Enum"SINGLE""MULTI"
itinerary.​policyInfosobject(PnrPolicyInfo)

Policy Info applicable for the associated itinerary

itinerary.​posInfoArray of objects(POSInfo)

The point of sales which offer the itinerary.

itinerary.​publicFareobject(FareAmount)

Fare amount including base fare and tax.

itinerary.​allowedFopRulesArray of objects(AllowedFopRule)

The payment method types applicable to the itinerary.

itinerary.​fareAttributesobject(FareAttributes)

The rules and attributes related to the fare.

Response
application/json
{ "itinerary": { "itineraryId": "kjdUjak8hX", "legs": [], "travelers": [], "fareInfo": {}, "ticketType": "SINGLE", "policyInfos": {}, "posInfo": [], "publicFare": {}, "allowedFopRules": [], "fareAttributes": {} } }

Get Airlines Information (Air)

Request

Returns airlines information for active marked airlines.

Query
includeInactivebooleanrequired

Include Airlines with inactive status along with active.

curl -i -X GET \
  'https://developer.spotnana.com/_mock/openapi/airapi/v2/air/airlines-info?includeInactive=true' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Bodyapplication/json
airlineInfoArray of objects(AirlineInfoComplete)required
airlineInfo[].​airlineCodestringrequired

Airline code

Example: "AA"
airlineInfo[].​airlineNamestringrequired

Airline name

Example: "American Airlines"
airlineInfo[].​countrystringrequired

Airline country

Example: "United States"
airlineInfo[].​twoLetterCountryCodestringrequired

Two letter country code

Example: "US"
airlineInfo[].​isActivebooleanrequired

Airline active status

Example: true
airlineInfo[].​loyaltyProgramNamestringrequired

Airline loyalty program name

Example: "AA Advantage"
airlineInfo[].​loyaltyProgramCodestringrequired

Airline loyalty program code

Example: "AA Adv"
airlineInfo[].​airlineTicketPrefixstringrequired

Airline ticket prefix

Example: "001"
Response
application/json
{ "airlineInfo": [ {} ] }

Get flight checkout details

Request

Get the flight checkout details associated with the selected itinerary.

Bodyapplication/jsonrequired
searchIdstringrequired

Search id returned in the corresponding air search API response.

Example: "ChBjZDg3ZjRjZmRmMTFm"
itineraryIdstringrequired

Value of the itineraryId for the itinerary selected by the user in the corresponding air search API response.

Example: "IthBjZDg3ZjRjZmRmMTFm"
curl -i -X POST \
  https://developer.spotnana.com/_mock/openapi/airapi/v2/air/flight-checkout \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "searchId": "ChBjZDg3ZjRjZmRmMTFm",
    "itineraryId": "IthBjZDg3ZjRjZmRmMTFm"
  }'

Responses

OK

Bodyapplication/json
checkoutResponseIdstringrequired

The unique ID which identifies this checkout response. This value must passed on in the subsequent booking API calls.

Example: "ChBjZDg3ZjRjZmRmMTFmMWFiEhBjZDg3Z"
baggageInfoobject(Ba