Anifowose Tobi
Anifowose Tobi

Reputation: 23

Explanation of certain errors when building a flight booking engine with amadeus api

I have been using Amadeus api to design a flight booking system. Sometimes, it goes through and the flight booking works (note that i am in sandbox mode) while some times i run into errors some of which i can't explain. I can test it now and it works and in another ten minutes i test again and an error pops up. I would love to know meaning of the frequent ones i get and how to avoid them.

here is one

  "errors" : [ {
    "status" : 400,
    "code" : 34651,
    "title" : "SEGMENT SELL FAILURE",
    "detail" : "Could not sell segment 1",
    "source" : {
      "pointer" : "/data/flightOffers[0]/itineraries[0]/segments[0]"
    }
  } ]
}

here is another

  "errors" : [ {
    "code" : 4926,
    "title" : "INVALID DATA RECEIVED",
    "detail" : "No fare applicable",
    "status" : 400
  } ]
}```

Upvotes: 0

Views: 2505

Answers (3)

Shubham Mishra
Shubham Mishra

Reputation: 1

Please check your the below details: if you are giving oneway parameter that not passing the returnDate in the api then just check the departure date to be in the future

else if roundTrip then check both departure date and returnDate in the params of the api to be in the future to not get the error

Upvotes: 0

Arie Ahmad
Arie Ahmad

Reputation: 11

I got this error as well. You can try to request Price Offer and retry to generate Order again. And remember to not use the same price data as before.

Upvotes: 1

Anthony Roux
Anthony Roux

Reputation: 1481

INVALID DATA RECEIVED means that some of the data in your query is false. It can be that you sent a fare that does not match your class or the flight number is incorrect etc. This is common to all our APIs, it comes from the API backend validating your query.

SEGMENT SELL FAILURE this means that you were not able to book the seat you want in the inventory of the airline. Most of the time, it comes from the flight being full. In the test environment, you can perform many bookings without restrictions (no real payment), but the inventory is a copy of the real one, so if you book many seats, the inventory will be empty and you won't be able to book anymore. It can come from a wrong fare, or flight number as well. The good practice is to price right before booking (note that in test it can still happen as many bookings are going at the same time from other users). But with this message, it is the inventory that rejects you.

Upvotes: 1

Related Questions