I tried to follow this guide https://developers.amadeus.com/blog/add-baggage-amadeus-flight-booking-api on retrieving flight offer price.
After first request to the pricing endpoint I get:
"included": {
"bags": {
"1": {
"quantity": 1,
"name": "CHECKED_BAG",
"price": {
"amount": "1637",
"currencyCode": "NOK"
},
"bookableByItinerary": true,
"segmentIds": [
"3",
"21"
],
"travelerIds": [
"0",
"1"
]
},
"2": {
"quantity": 1,
"name": "CHECKED_BAG",
"price": {
"amount": "655",
"currencyCode": "NOK"
},
"bookableByItinerary": true,
"segmentIds": [
"3",
"21"
],
"travelerIds": [
"0",
"1"
]
}
}
},
To be honest I'm not sure how to interpret that. What do the "1"
and "2"
keys represent here? Are those for the first and the second flight offer that I sent in the request?
Anyway, after getting this response I'm assigning 1
to travelerPricings.fareDetailsBySegment.additionalServices.chargeableCheckedBags.quantity
to every segment (ids "3" and "21") in every flight offer (2 of them).
I was expecting to get different prices in a response for a second request, but I got the same thing and additional services are never mentioned in the second response to flight offers pricing.
Am I doing something wrong?
I also tried to add bags for just one segment and the same thing happened.
I'm looking for a JFK<->MAD flight (2020-10-20 -> 2020-10-30).
The “1” and “2” are the id’s of the bag offers. In this case the API returns the offer 1 with 1 bag for 1637 NOK and the offer 2 with 1 bag for 655 NOK. By the price difference it means that one bag is bigger than the other even though the airline hasn’t provided explicitly this information. The segmentId in each bag offer guarantees which bag offer can be applied to which segment. Now, in this case both bag offers have the same quantity = 1. In order to choose which bag offer you want to add in the flight (as both offers have the same quantity), you can manually update the price of the flight offer with the one of the bag you’ve selected, so the system will know which bag to add.
When the price returned after adding the bags to the flight offers is the same, it means the bag was not possible to be added. This can be linked to several things such as: this bag is not available to a specific segment, due to the test environment data and it's limitations the amount of bags is not available while confirming in the flight offers price, or specific airlines allow only one bag for each person, or even the specific flight reached the limit of bag capacity as there is not unlimited amount of space.