amadeus

9.1.0

Amadeus

The Amadeus client library for accessing the travel APIs.

Initialize using your credentials:

Alternatively, initialize the library using the environment variables AMADEUS_CLIENT_ID and AMADEUS_CLIENT_SECRET

new Amadeus(params: Object)
Parameters
params (Object = {})
Name Description
params.clientId string the API key used to authenticate the API
params.clientSecret string the API secret used to authenticate the API
params.logger Object (default console) a console -compatible logger that accepts log , error and debug calls.
params.logLevel string (default 'warn') the log level for the client, available options are debug , warn , and silent
params.hostname string (default 'production') the name of the server API calls are made to ( production or test )
params.host string? the full domain or IP for a server to make the API clal to. Only use this if you don't want to use the provided servers
params.ssl boolean (default true) wether to use SSL for this API call
params.port number (default 443) the port to make the API call to
params.customAppId string (default null) a custom App ID to be passed in the User Agent to the server.
params.customAppVersion string (default null) a custom App Version number to be passed in the User Agent to the server.
params.http Object (default https) an optional Node/HTTP(S)-compatible client that accepts a 'request()' call with an array of options.
Properties
client (Client) : The client for making authenticated HTTP calls
version (number) : The version of this API client
Static Members
location
direction
Instance Members
previous(response)
next(response)
first(response)
last(response)

Client

A convenient wrapper around the API, allowing for generic, authenticated and unauthenticated API calls without having to manage the serialization, desrialization, and authentication.

Generally you do not need to use this object directly. Instead it is used indirectly by the various namespaced methods for every API call.

For example, the following are the semantically the same.

new Client(options: Object)
Parameters
options (Object = {}) a list of options. See Amadeus .
Properties
clientId (string) : the API key used to authenticate the API
clientSecret (string) : the API secret used to authenticate the API
logger (Object) : the console -compatible logger used to debug calls
logLevel (string) : the log level for the client, available options are debug , warn , and silent . Defaults to 'silent'
host (string) : the hostname of the server API calls are made to
port (number) : the port the server API calls are made to
ssl (boolean) : wether an SSL request is made to the server
customAppId (string) : the custom App ID to be passed in the User Agent to the server
customAppVersion (string) : the custom App Version number to be passed in the User Agent to the server
http (Object) : the Node/HTTP(S)-compatible client used to make requests
version (number) : The version of this API client
Instance Members
get(path, params)
post(path, params)
delete(path, params)
debug()
warn()

ResponseError

The error that is passed to the Promise when the API call fails.

new ResponseError(response: Response)
Parameters
response (Response) the Response object containing the raw http response and the Request instance that made the API call.
Properties
response (Response) : the Response object containing the raw http response and the Request instance that made the API call.
code (string) : a unique code for this type of error. Options include NetworkError , ParserError , ResponseError , ServerError , AuthenticationError , NotFoundError and UnknownError from the Response 's parsed data

Request

A Request object containing all the compiled information about this request.

new Request(options: Object)
Parameters
options (Object)
Properties
host (string) : the host used for this API call
port (number) : the port for this API call. Standard set to 443.
ssl (boolean) : wether this API call uses SSL
scheme (string) : the scheme inferred from the SSL state
verb (string) : the HTTP method, for example GET or POST
path (string) : the full path of the API endpoint
params (Object) : the parameters to pass in the query or body
queryPath (string) : the path and query string used for the API call
bearerToken (string) : the authentication token
clientVersion (string) : the version of the Amadeus library
languageVersion (string) : the version of Node used
appId (string) : the custom ID of the application using this library
appVersion (string) : the custom version of the application using this library
headers (Object) : the request headers

Response

The response object returned for every API call.

new Response(http_response: Object, request: Request)
Parameters
http_response (Object) the response object returned from the Node/HTTP request
request (Request) the request object used to make this API call
Properties
statusCode (number) : the HTTP status code for the response, if any
body (string) : the raw body received from the API
result (Object) : the parsed JSON received from the API
data (Object) : the data attribute taken from the result
parsed (boolean) : wether the raw body has been parsed into JSON
request (Request) : the request object used to make this API call

Airline

A namespaced client for the /v1/airline endpoints

Access via the Amadeus object

new Airline(client: Client)
Parameters
client (Client)
Properties
predictions (predictions)

Destinations

A namespaced client for the /v1/airline/destinations endpoints

Access via the Amadeus object

new Destinations(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Airport

A namespaced client for the /v1/airport endpoints

Access via the Amadeus object

new Airport(client: Client)
Parameters
client (Client)
Properties
predictions (predictions)

DirectDestinations

A namespaced client for the /v1/airport/direct-destinations endpoints

Access via the Amadeus object

new DirectDestinations(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Predictions

A namespaced client for the /v1/airport/predictions endpoints

Access via the Amadeus object

new Predictions(client: Client)
Parameters
client (Client)
Properties
OnTime (predictions)

Predictions

A namespaced client for the /v1/travel/predictions/trip-purpose endpoints

Access via the Amadeus object

new Predictions(client: Client)
Parameters
client (Client)
Properties
tripPurpose (TripPurpose)
flightDelay (FlightDelay)

OnTime

A namespaced client for the /v1/airport/predictions/on-time endpoints

Access via the Amadeus object

new OnTime(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Analytics

A namespaced client for the /v1/location/analytics endpoints

Access via the Amadeus object

new Analytics(client: Client)
Parameters
client (Client)
Properties
CategoryRatedAreas (analytics)

ItineraryPriceMetrics

A namespaced client for the `/v1/analytics/itinerary-price-metrics

Access via the Amadeus object

new ItineraryPriceMetrics(client: Client)
Parameters
client (Client)
Instance Members
get(params)

FlightOrder

A namespaced client for the /v1/booking/flight-orders endpoints

Access via the Amadeus object

new FlightOrder(client: Client, orderId: any)
Parameters
client (Client)
orderId (any)
Instance Members
get()
delete()

FlightOrders

A namespaced client for the /v1/booking/flight-orders endpoints

Access via the Amadeus object

new FlightOrders(client: Client)
Parameters
client (Client)
Instance Members
post(params)

HotelBookings

A namespaced client for the /v1/booking/hotel-bookings endpoints

Access via the Amadeus object

new HotelBookings(client: Client)
Parameters
client (Client)
Instance Members
post(params)

EReputation

A namespaced client for the /v2/e-reputation endpoints

Access via the Amadeus object

new EReputation(client: Client)
Parameters
client (Client)
Properties
hotel_sentiments (hotelSentiments)

HotelSentiments

A namespaced client for the /v2/e-reputation/hotel-sentiments endpoints

Access via the Amadeus object

new HotelSentiments(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Location

A namespaced client for the /v1/location endpoints

Access via the Amadeus object

new Location(client: Client)
Parameters
client (Client)
Properties
analytics (analytics)
Instance Members
get(params)

Location

A namespaced client for the /v2/reference-data/locations/:location_id endpoints

Access via the Amadeus object

new Location(client: Client, locationId: any)
Parameters
client (Client)
locationId (any)
Properties
locationId (number)
Instance Members
get(params)

CategoryRatedAreas

A namespaced client for the /v1/location/analytics/category-rated-areas endpoints

Access via the Amadeus object

new CategoryRatedAreas(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Media

A namespaced client for the /v2/media endpoints

Access via the Amadeus object

new Media(client: Client)
Parameters
client (Client)
Properties
files (Files)

Files

A namespaced client for the /v2/media/files endpoints

Access via the Amadeus object

new Files(client: Client)
Parameters
client (Client)

Ordering

A namespaced client for the /v1/ordering endpoints

Access via the Amadeus object

new Ordering(client: Client)
Parameters
client (Client)
Properties
transferOrders (TransferOrders)
transferOrder (TransferOrder)

TransferOrder

A namespaced client for the /v1/ordering/transfer-orders/XXXXX endpoints

Access via the Amadeus object

new TransferOrder(client: Client, orderId: string)
Parameters
client (Client)
orderId (string)

TransferOrders

A namespaced client for the /v1/ordering/transfer-orders endpoints

Access via the Amadeus object

new TransferOrders(client: Client)
Parameters
client (Client)
Instance Members
post(body, offerId)

Transfers

A namespaced client for the /v1/ordering/transfer-orders/XXXXX/transfers endpoints

Access via the Amadeus object

new Transfers(client: Client, orderId: any)
Parameters
client (Client)
orderId (any)

Cancellation

A namespaced client for the /v1/ordering/transfer-orders/XXX/transfers/cancellation endpoints

Access via the Amadeus object

new Cancellation(client: Client, orderId: any)
Parameters
client (Client)
orderId (any)
Instance Members
post(body, confirmNbr)

Airlines

A namespaced client for the /v1/reference-data/airlines endpoints

Access via the Amadeus object

new Airlines(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Locations

A namespaced client for the /v2/reference-data/locations endpoints

Access via the Amadeus object

new Locations(client: Client)
Parameters
client (Client)
Properties
airports (Airports)
Instance Members
get(params)

Airports

A namespaced client for the /v2/reference-data/locations/airports endpoints

Access via the Amadeus object

new Airports(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Cities

A namespaced client for the /v2/reference-data/locations/cities endpoints

Access via the Amadeus object

new Cities(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Hotel

A namespaced client for the /v1/reference-data/locations/hotel endpoints

Access via the Amadeus object

new Hotel(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Hotels

A namespaced client for the /v1/reference-data/locations/hotels endpoints

Access via the Amadeus object

new Hotels(client: Client)
Parameters
client (Client)

byCity

A namespaced client for the /v1/reference-data/locations/hotels/by-city endpoints

Access via the Amadeus object

new byCity(client: Client)
Parameters
client (Client)
Instance Members
get(params)

byGeocode

A namespaced client for the /v1/reference-data/locations/hotels/by-geocode endpoints

Access via the Amadeus object

new byGeocode(client: Client)
Parameters
client (Client)
Instance Members
get(params)

byHotels

A namespaced client for the /v1/reference-data/locations/hotels/by-hotels endpoints

Access via the Amadeus object

new byHotels(client: Client)
Parameters
client (Client)
Instance Members
get(params)

PointOfInterest

A namespaced client for the /v1/reference-data/locations/pois endpoints

Access via the Amadeus object

new PointOfInterest(client: Client, poiId: any)
Parameters
client (Client)
poiId (any)
Instance Members
get()

bySquare

A namespaced client for the /v1/reference-data/locations/pois/by-square endpoints

Access via the Amadeus object

new bySquare(client: Client)
Parameters
client (Client)
Instance Members
get(params)
get(params)
get(params)

bySquare

A namespaced client for the /v1/safety/safety-rated-locations/by-square endpoints

Access via the Amadeus object

new bySquare(client: Client)
Parameters
client (Client)
Instance Members
get(params)
get(params)
get(params)

bySquare

A namespaced client for the /v1/shopping/activities/by-square endpoints

Access via the Amadeus object

new bySquare(client: Client)
Parameters
client (Client)
Instance Members
get(params)
get(params)
get(params)

PointsOfInterest

A namespaced client for the /v1/reference-data/locations/pois endpoints

Access via the Amadeus object

new PointsOfInterest(client: Client)
Parameters
client (Client)
Instance Members
get(params)

RecommendedLocations

A namespaced client for the /v1/reference-data/recommended-locations endpoints

Access via the Amadeus object

new RecommendedLocations(client: Client)
Parameters
client (Client)
Instance Members
get(params)

A namespaced client for the /v2/reference-data/urls/checkin-links endpoints

Access via the Amadeus object

new CheckinLinks(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Safety

A namespaced client for the /v1/safety endpoints

Access via the Amadeus object

new Safety(client: Client)
Parameters
client (Client)
Properties
safetyRatedLocations (SafetyRatedLocations)

SafetyRatedLocation

A namespaced client for the /v1/safety/safety-rated-locations endpoints

Access via the Amadeus object

new SafetyRatedLocation(client: Client, locationId: any)
Parameters
client (Client)
locationId (any)
Instance Members
get()

SafetyRatedLocations

A namespaced client for the /v1/safety/safety-rated-locations endpoints

Access via the Amadeus object

new SafetyRatedLocations(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Flights

A namespaced client for the /v2/schedule/flights endpoints

Access via the Amadeus object

new Flights(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Shopping

A namespaced client for the /v1/shopping, /v2/shopping and /v3/shopping endpoints

Access via the Amadeus object

new Shopping(client: Client)
Parameters
client (Client)
Properties
flightDestinations (FlightDestinations)
flightOffers (FlightOffers)
flightOffersSearch (FlightOffersSearch)
flightDates (FlightDates)
seatmaps (Seatmaps)
hotelOffers (HotelOfferSearch)
hotelOffers (HotelOffersSearch)
availability (Availability)
transferOffers (TransferOffers)
Instance Members
hotelOfferSearch(offerId?)
activity(activityId?)

Activities

A namespaced client for the /v1/shopping/activities endpoints

Access via the Amadeus object

new Activities(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Activity

A namespaced client for the /v1/shopping/activities/{activityId} endpoints

Access via the Amadeus object

new Activity(client: Client, activityId: any)
Parameters
client (Client)
activityId (any)
Instance Members
get()

FlightAvailabilities

A namespaced client for the /v1/shopping/availability/flight-availabilities endpoints

Access via the Amadeus object

new FlightAvailabilities(client: Client)
Parameters
client (Client)
Instance Members
post(params)

FlightDates

A namespaced client for the /v1/shopping/flight-dates endpoints

Access via the Amadeus object

new FlightDates(client: Client)
Parameters
client (Client)
Instance Members
get(params)

FlightDestinations

A namespaced client for the /v1/shopping/flight-destinations endpoints

Access via the Amadeus object

new FlightDestinations(client: Client)
Parameters
client (Client)
Instance Members
get(params)

FlightOffersSearch

A namespaced client for the /v2/shopping/flight-offers endpoints

Access via the Amadeus object

new FlightOffersSearch(client: Client)
Parameters
client (Client)
Instance Members
get(params)
post(params)

FlightOffers

A namespaced client for the /v1/shopping/flight-offers endpoints

Access via the Amadeus object

new FlightOffers(client: Client)
Parameters
client (Client)

FlightChoicePrediction

A namespaced client for the /v1/shopping/flight-offers/prediction endpoints

Access via the Amadeus object

new FlightChoicePrediction(client: Client)
Parameters
client (Client)
Instance Members
post(params)

Pricing

A namespaced client for the /v1/shopping/flight-offers/pricing endpoints

Access via the Amadeus object

new Pricing(client: Client)
Parameters
client (Client)
Instance Members
post(params, additionalParams)

Upselling

A namespaced client for the /v1/shopping/flight-offers/upselling endpoints

Access via the Amadeus object

new Upselling(client: Client)
Parameters
client (Client)
Instance Members
post(params)

HotelOfferSearch

A namespaced client for the /v3/shopping/hotel-offers/:offer_id endpoints

Access via the Amadeus object

new HotelOfferSearch(client: Client, offerId: any)
Parameters
client (Client)
offerId (any)
Properties
offerId (number)
Instance Members
get(params)

HotelOffersSearch

A namespaced client for the /v3/shopping/hotel-offers endpoints

Access via the Amadeus object

new HotelOffersSearch(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Seatmaps

A namespaced client for the /v1/shopping/seatmaps endpoints

Access via the Amadeus object

new Seatmaps(client: Client)
Parameters
client (Client)
Instance Members
get(params)
post(params)

TransferOffers

A namespaced client for the /v1/shopping/transfer-offers endpoints

Access via the Amadeus object

new TransferOffers(client: Client)
Parameters
client (Client)
Instance Members
post(params)

AirTraffic

A namespaced client for the /v1/travel/analytics/air-traffic endpoints

Access via the Amadeus object

new AirTraffic(client: Client)
Parameters
client (Client)

Booked

A namespaced client for the /v1/travel/analytics/air-traffic/booked endpoints

Access via the Amadeus object

new Booked(client: Client)
Parameters
client (Client)
Instance Members
get(params)

BusiestPeriod

A namespaced client for the /v1/travel/analytics/air-traffic/busiest-period endpoints

Access via the Amadeus object

new BusiestPeriod(client: Client)
Parameters
client (Client)
Instance Members
get(params)

Traveled

A namespaced client for the /v1/travel/analytics/air-traffic/traveled endpoints

Access via the Amadeus object

new Traveled(client: Client)
Parameters
client (Client)
Instance Members
get(params)

FlightDelay

A namespaced client for the /v1/travel/predictions/flight-delay endpoints

Access via the Amadeus object

new FlightDelay(client: Client)
Parameters
client (Client)
Instance Members
get(params)

TripPurpose

A namespaced client for the /v1/travel/predictions/trip-purpose endpoints

Access via the Amadeus object

new TripPurpose(client: Client)
Parameters
client (Client)
Instance Members
get(params)

TripParser

A namespaced client for the /v3/travel/trip-parser endpoints

Access via the Amadeus object

new TripParser(client: Client)
Parameters
client (Client)
Instance Members
post(params)
fromFile(fileContentsInUTF8Format)