Create order with services

POST https://api.duffel.com/air/orders

Once you know what offer and service a user wants to book all you have to send request to the create order endpoint with 2 small changes to the payload.

You must add the attribute services to your request payload. This field should contain a list of services to be book along with the offer specified in the selected_offers field. Each service on the list here must contain the available service id ($SERVICE_ID_N) and the desired quantity. The payment amount ($TOTAL_AMOUNT) must be increased by the amount times quantity of each service you'd like to purchase. For example, if your offer total is 50 GBP and you include service A with quantity 2 and total_amount 10 GBP, the amount of the payment should now be 70 GBP.

Request Body

{"data"=>{"selected_offers"=>["{{OFFER_ID}}"], "payments"=>[{"type"=>"balance", "currency"=>"{{TOTAL_CURRENCY}}", "amount"=>"{{TOTAL_AMOUNT}}"}], "passengers"=>[{"phone_number"=>"+442080160508", "email"=>"tony@example.com", "born_on"=>"1980-07-24", "title"=>"mr", "gender"=>"m", "family_name"=>"Stark", "given_name"=>"Tony", "id"=>"{{PASSENGER_ID}}"}], "services"=>[{"quantity"=>1, "id"=>"{{SEAT_SERVICE_ID}}"}]}}

HEADERS

KeyDatatypeRequiredDescription
Duffel-Versionstring
Content-Typestring