How to create order with extra baggage/seat

倾然丶 夕夏残阳落幕 提交于 2021-02-11 12:18:51

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!