Duffel Links
What do you need to start?
Sign up for a Duffel account (it takes about 1 minute!)
tip
tip
Overview
Creating Links
sessions
endpoint, you will need to create a link for your user.
At creation, you will need to specify the brand customisation you want to use and the URLs
you would like us to direct your user to on completion. You will also have the option at this
point to specify a checkout currency and a markup you would like to be applied to the flights.note
Shell
curl -X POST --compressed "https://api.duffel.com/links/sessions" \-H "Accept-Encoding: gzip" \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Duffel-Version: v1" \-H "Authorization: Bearer $YOUR_ACCESS_TOKEN" \-d '{"data": {"reference": "USER_1","success_url": "https://www.starkindustries.com/success","failure_url": "https://www.starkindustries.com/failure","abandonment_url": "https://www.starkindustries.com/abandon","logo_url":"https://assets.starkindustries.com/logos/logo.svg","primary_color":"#000000","traveller_currency": "USD","markup_amount": "1.00","markup_currency": "USD","markup_rate": "0.01"}}'

A screenshot of the search page on Duffel Links
Success - Once an order has been successfully created, the user will be provided with details of the booking (itinerary and booking reference) and then prompted to return to the link provided as
success_url
in the link creation request. This will includeorder_id
andreference
query params where theorder_id
is the Duffel ID that corresponds to the order andreference
is the reference value provided in the link creation request. For example:https://www.starkindustries.com/success/?order_id=ord_0000ASPa29O14a2RheVaZE&reference=USER_1
Abandonment - If the user decides to abandon the checkout process by pressing the ‘Return’ button, the user will be redirected to the
abandonment_url
provided in the link creation request.Failure - If there is a failure that the Duffel Links session cannot mitigate, the user will be redirected to the
failure_url
provided in the link creation request.

A screenshot of the order confirmation page on Duffel Links