0

I am having trouble with the migration of the Ruby SDK from Amadeus Flight Low-fare Search to Flight Offers Search

I'm currently using the Ruby SDK for my student project , and just got the notification about the migration of Amadeus Flight Low-fare Search to Flight Offers Search.

It looks like the SDK endpoint amadeus.shopping.flight_offers.get() is still going to Low-fare Search instead of Flight Offers.

I tried updating my parameters for the transition to Flight Offers Search as so:

response = amadeus.shopping.flight_offers.get(
      originLocationCode: origin,
      destinationLocationCode: destination,
      departureDate: departure_date,
      returnDate: return_date,
      adults: 1
    )

And received the following error:

Amadeus::ClientError ([400]
[origin] This field must be filled.
[destination] This field must be filled.):

And while the following request works, this is reaching the Low-fare Search instead of the Flight Offers Search:

response = amadeus.shopping.flight_offers.get(
      origin: origin,
      destination: destination,
      departureDate: departure_date,
      returnDate: return_date
    )

I've noticed that the documentation shows that amadeus.shopping.flight_offers.get is the namespaced client for /v1/shopping/flight-offers, while it looks like the Flight Offers endpoint is /v2/shopping/flight-offers.

Is there a different Ruby SDK endpoint I should be using to access the Flight Offers Search?

1 Answers1

0

The Ruby SDK was not fully updated. I just released a new version 5.0.0 adding the support for Flight Offers Search and Flight Choice Prediction v2 and removed the support of Flight Low-fare Search and Flight Choice Prediction v1. You need first to update your amadeus library:

gem install amadeus

You can then use the Flight Offers Search API:

amadeus.shopping.flight_offers_search.get(originLocationCode: 'NYC', destinationLocationCode: 'MAD', departureDate: '2020-10-01', adults: 1)
Anthony Roux
  • 1,421
  • 1
  • 8
  • 11