amadeus

how to add extra bag to the flight create orders


I am testing the flight booking workflow on test env., I understand that if I want to move to production with it, I will need to sign a contract.

I know that the flight booking workflow steps are as follows:

https://github.com/amadeus4dev/amadeus-code-examples/blob/master/flight_create_orders/v1/post/Python%20SDK/flight_create_orders.py

 # Flight Offers Search to search for flights from MAD to ATH
    flight_search = amadeus.shopping.flight_offers_search.get(originLocationCode='MAD',
                                                              destinationLocationCode='ATH',
                                                              departureDate='2022-12-01',
                                                              adults=1).data

    # Flight Offers Price to confirm the price of the chosen flight
    price_confirm = amadeus.shopping.flight_offers.pricing.post(
        flight_search[0]).data

    # Flight Create Orders to book the flight
    booked_flight = amadeus.booking.flight_orders.post(
        flight_search[0], traveler).data

What I dont understand is, if I want to add extra bag while confirming the price in the 2nd step of the workflow.

This is what doesn't make sense to me, because in the code above, it shows that im passing the flight offer from the 1st step to the flight create orders, and this means the extra bag is not added in the order.

The code is working fine with the above 3 steps excluding the extra baggage.

Could anyone please explain or clarify what am i missing?


Solution

  • For Amadeus Self-Service APIs, There is one way of adding extra baggage which is "before" pricing step.

    1. Call Flight offer search API to get the flight offers
    2. Call Flight offer price API with 'include=bags' parameter to get price of baggage
    3. Call Flight offer price API including the baggage info to get real-time price
    4. Call Flight Create order API to book the flights with baggage

    Reference:

    If you are looking for advance ways of adding ancillary services such as after ticketing/booking, Enterprise APIs will help.