问题
I'm using self-service APIs, and I already get the extra baggage information from the flight offer price API, such as price, quantity , weight etc. But how to create order by adding the extra baggage? Do you have an exemple about this scenario?
Same question for seat. Once I get the seat map of flight offer, is it possible to create order by selecting available seat ? Thanks
回答1:
Add baggage information
You first need to include the include=bags
parameter in the path of Flight Offers Price API to get the bags information:
https://test.api.amadeus.com/v1/shopping/flight-offers/pricing?include=bags
As you mentioned you get that information so I suppose you have done this step already.
Now the bag catalog is be returned on the API response providing the price and quantity/weight and looks like:
"bags": {
"1": {
"quantity": 1,
"name": "CHECKED_BAG",
"price": {
"amount": "30.00",
"currencyCode": "EUR"
}
Once you have selected the bag you want, you can fill in the chargeableCheckedBags
part either the quantity or the weight (depending of what the airline you use) in the travelerPricings/fareDetailsBySegment/additionalServices and you add the bag per flight segment like the example below:
"fareDetailsBySegment": [
{
"segmentId": "1",
"cabin": "ECONOMY",
"fareBasis": "TNOBAGD",
"brandedFare": "GOLIGHT",
"class": "T",
"includedCheckedBags": {
"quantity": 0
},
"additionalServices": {
"chargeableCheckedBags": {
"quantity": 1
}
}
}
]
Select available seats with SeatMap API
You can go through this guide which contains examples and all the details for seat selection.
来源:https://stackoverflow.com/questions/63195597/how-to-create-order-with-extra-baggage-seat