Orders

Once you've searched for flights by creating an offer request, and you've chosen which offer you want to book, you'll then want to create an order.

To create an order, you just need to provide the offer ID, payment details and some additional information on the passengers (e.g. their full name and date of birth).

base_amount
string
nullable

The base price of the order for all flights and services booked, excluding taxes

Example: "30.20"
base_currency
string
nullable

The currency of the base_amount, as an ISO 4217 currency code. It will match your organisation's billing currency unless you’re using Duffel as an accredited IATA agent, in which case it will be in the currency provided by the airline (which will usually be based on the country where your IATA agency is registered).

Example: "GBP"
booking_reference
string

The airline's reference for the order, sometimes known as a "passenger name record" (PNR) or "record locator". Your customers can use this to check in and manage their booking on the airline's website.

Example: "RZPNX8"
cancelled_at
datetime
nullable

The ISO 8601 datetime at which the order was cancelled, if it has been cancelled

Example: "2020-04-11T15:48:11.642Z"
conditions
object

The conditions associated with this order, describing the kinds of modifications you can make to it and any penalties that will apply to those modifications. This information assumes the condition is applied to all of the slices and passengers associated with this order - for information at the slice level (e.g. "what happens if I just want to change the first slice?") refer to the slices. If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API. In some cases, you may need to contact the Duffel support team or the airline directly.

created_at
datetime

The ISO 8601 datetime at which the order was created

Example: "2020-04-11T15:48:11.642Z"
documents
list

The documents issued for this order

id
string

Duffel's unique identifier for the order

Example: "ord_00009hthhsUZ8W4LxQgkjo"
live_mode
boolean

Whether the order was created in live mode. This field will be set to true if the order was created in live mode, or false if it was created in test mode.

Example: false
metadata
object

Metadata contains a set of key-value pairs that you can attach to an object. It can be useful for storing additional information about the object, in a structured format. Duffel does not use this information. You should not store sensitive information in this field.

Example: {"customer_prefs":"window seat"}
owner
object

The airline who owns the order

passengers
list

The passengers who are travelling

payment_status
object

The payment status for this order

services
list

The services booked along with this order

slices
list

The slices that make up the itinerary of this order. One-way journeys can be expressed using one slice, whereas return trips will need two.

synced_at
datetime

Airlines are always the source of truth for orders. The orders returned in the Duffel API are a view of those orders. This field is the ISO 8601 datetime at which the Order was last synced with the airline. If this datetime is in the last minute you can consider the order up to date.

Example: "2020-04-11T15:48:11.642Z"
tax_amount
string
nullable

The amount of tax payable on the order for all the flights booked

Example: "30.20"
tax_currency
string

The currency of the tax_amount, as an ISO 4217 currency code. It will match your organisation's billing currency unless you’re using Duffel as an accredited IATA agent, in which case it will be in the currency provided by the airline (which will usually be based on the country where your IATA agency is registered).

Example: "GBP"
total_amount
string

The total price of the order for all the flights and services booked, including taxes

Example: "90.80"
total_currency
string

The currency of the total_amount, as an ISO 4217 currency code. It will match your organisation's billing currency unless you’re using Duffel as an accredited IATA agent, in which case it will be in the currency provided by the airline (which will usually be based on the country where your IATA agency is registered).

Example: "GBP"

Retrieves a paginated list of all orders. The results may be returned in any order, unless a sorting parameter is provided.

Query Parameters

after
string

A cursor pointing to the previous page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
before
string

A cursor pointing to the next page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
limit
integer

The maximum number of records to return per page. Defaults to 50. May be set to any integer between 1 and 200. For more information on how to paginate through records, see the Pagination section.

Example: 1
Default value: 50
booking_reference
string

Filters orders by their booking reference.

The filter requires an exact match but is case insensitive.

Example: "RZPNX8"
awaiting_payment
boolean

Whether to filter orders that are awaiting payment or not. If not specified, all orders regardless of their payment state will be returned.

Example: false
sort
enum

By default, orders aren't returned in any specific order. This parameter allows you to sort the list of orders by the payment_required_by date. If you wish to sort in descending order, a - prefix will be needed (i.e. -payment_required_by).

Possible values: "payment_required_by"
owner_id[]
string[]

Filters the returned orders by owner.id. Values must be valid airline.ids. Check the Airline schema for details.

Example: ["arl_00009VME7DBKeMags5CliQ","arl_00009VME7DCOaPRQvNhcMu"]
origin_id[]
string[]

Filters the returned orders by origin. Values must be valid origin identifiers. Check the Order schema for details.

Orders will be included if any of their slices matches the given criteria.

Example: ["arp_lhr_gb","arp_jfk_us"]
destination_id[]
string[]

Filters the returned orders by destination. Values must be valid destination identifiers. Check the Order schema for details.

Orders will be included if any of their slices matches the given criteria.

Example: ["arp_lhr_gb","arp_jfk_us"]
departing_at
object

Filters the returned orders by departure datetime. Orders will be included if any of their segments matches the given criteria.

arriving_at
object

Filters the returned orders by arrival datetime. Orders will be included if any of their segments matches the given criteria.

created_at
object

Filters the returned orders by creation datetime.

passenger_name[]
string[]

Filters the returned orders by passengers' family_name and given_name.

Orders will be included if any of their passengers matches any of the given names. Matches are case insensitive, and include partial matches.

For example, ?passenger_name[]=roger will return orders for both Anna Rogers and Roger Smith.

Example: ["Earhart","Smith"]

Endpoint

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

Request

curl -X GET --compressed "https://api.duffel.com/air/orders?after=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&before=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&limit=1&booking_reference=RZPNX8&awaiting_payment=false&sort=payment_required_by&owner_id[]=arl_00009VME7DBKeMags5CliQ,arl_00009VME7DCOaPRQvNhcMu&origin_id[]=arp_lhr_gb,arp_jfk_us&destination_id[]=arp_lhr_gb,arp_jfk_us&departing_at=undefined&arriving_at=undefined&created_at=undefined&passenger_name[]=Earhart,Smith" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: beta" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"meta": {
"limit": 50,
"after": "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
},
"data": [
{
"total_currency": "GBP",
"total_amount": "90.80",
"tax_currency": "GBP",
"tax_amount": "30.20",
"synced_at": "2020-04-11T15:48:11.642Z",
"slices": [
{
"segments": [
{
"passengers": [
{
"seat": {
"name": "Exit row seat",
"disclosures": [
"Do not seat children in exit row seats",
"Do not seat passengers with special needs in exit row seats"
],
"designator": "14B"
},
"passenger_id": "passenger_0",
"cabin_class_marketing_name": "Economy Basic",
"cabin_class": "economy",
"baggages": [
{
"type": "checked",
"quantity": 1
}
]
}
],
"origin_terminal": "B",
"origin": {
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
}
},
"operating_carrier_flight_number": "4321",
"operating_carrier": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"marketing_carrier_flight_number": "1234",
"marketing_carrier": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"id": "seg_00009htYpSCXrwaB9Dn456",
"duration": "PT02H26M",
"distance": "424.2",
"destination_terminal": "5",
"destination": {
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
}
},
"departure_terminal": "B",
"departure_datetime": "2020-06-13T16:38:02",
"departing_at": "2020-06-13T16:38:02",
"arriving_at": "2020-06-13T16:38:02",
"arrival_terminal": "5",
"arrival_datetime": "2020-06-13T16:38:02",
"aircraft": {
"name": "Airbus Industries A380",
"id": "arc_00009UhD4ongolulWd91Ky",
"iata_code": "380"
}
}
],
"origin_type": "airport",
"origin": {
"type": "airport",
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"iata_city_code": "LON",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
},
"airports": [
{
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
}
}
]
},
"id": "sli_00009htYpSCXrwaB9Dn123",
"duration": "PT02H26M",
"destination_type": "airport",
"destination": {
"type": "airport",
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"iata_city_code": "NYC",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
},
"airports": [
{
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
}
}
]
},
"conditions": {
"change_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
}
},
"changeable": false
}
],
"services": [
{
"type": "baggage",
"total_currency": "GBP",
"total_amount": "15.00",
"segment_ids": [
"seg_00009hj8USM7Ncg31cB456"
],
"quantity": 1,
"passenger_ids": [
"pas_00009hj8USM7Ncg31cBCLL"
],
"id": "ser_00009UhD4ongolulWd9123"
}
],
"payment_status": {
"price_guarantee_expires_at": "2020-01-17T10:42:14.545Z",
"payment_required_by": "2020-01-17T10:42:14.545Z",
"awaiting_payment": true
},
"passengers": [
{
"type": "adult",
"title": "mrs",
"infant_passenger_id": "pas_00009hj8USM8Ncg32aTGHL",
"id": "pas_00009hj8USM7Ncg31cBCLL",
"given_name": "Amelia",
"gender": "f",
"family_name": "Earhart",
"born_on": "1987-07-24"
}
],
"owner": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"metadata": {
"customer_prefs": "window seat"
},
"live_mode": false,
"id": "ord_00009hthhsUZ8W4LxQgkjo",
"documents": [
{
"unique_identifier": "1252106312810",
"type": "electronic_ticket"
}
],
"created_at": "2020-04-11T15:48:11.642Z",
"conditions": {
"refund_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
},
"change_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
}
},
"cancelled_at": "2020-04-11T15:48:11.642Z",
"booking_reference": "RZPNX8",
"base_currency": "GBP",
"base_amount": "30.20"
}
]
}

Creates a booking with an airline based on an offer.

Orders are usually paid at the time of creation, but can be held and paid for at a later date if the offer supports it (see offer.payment_requirements.requires_instant_payment). To create an order and pay for it at the same time, specify a payments key. To hold the order and pay for it later, specify the type as hold, omit the payments and services keys, and complete payment after creating the order through the Create a payment endpoint.

When presenting an order confirmation to your customers (e.g. on screen or in an email), you should include the booking_reference and details of the full itinerary and show the full name of the operating carrier of each segment (slices[].segments[].operating_carrier.name) in order to comply with US regulations.

If you receive a 500 Internal Server Error when trying to create an order, it may have still been created on the airline’s side. Please contact Duffel support before trying the request again.

Validation errors

FieldCodeDescription
paymentspayments_not_allowed_for_order_typeYou’ve included a payments key for a hold order, but the key should be omitted.
servicesservices_not_allowed_for_order_typeYou’ve included services for a hold order, but they’re not currently supported.
typenot_valid_with_selected_offerThe type is not valid with selected offer because either requires_instant_payment is true or the payment_required_by is in the past.

Body parameters

metadata
object

Metadata contains a set of key-value pairs that you can attach to an object. It can be useful for storing additional information about the object, in a structured format. Duffel does not use this information. You should not store sensitive information in this field.

The metadata is a collection of key-value pairs, both of which are strings. You can store a maximum of 50 key-value pairs, where each key has a maximum length of 40 characters and each value has a maximum length of 500 characters.

Keys must only contain numbers, letters, dashes, or underscores.

Example: {"payment_intent_id":"pit_00009htYpSCXrwaB9DnUm2"}
passengers
list
required

The personal details of the passengers, expanding on the information initially provided when creating the offer request

payments
list
required

The payment details to use to pay for the order. This key should be omitted when the order’s type is hold.

selected_offers
string[]
required

The ids of the offers you want to book. You must specify an array containing exactly one selected offer.

Note that you can only book one offer per offer request.

Example: ["off_00009htyDGjIfajdNBZRlw"]
services
list

The services you want to book along with the first selected offer. This key should be omitted when the order’s type is hold, as we do not support services for hold orders yet.

type
enum

The type of order. You can only use hold with offers where payment_requirements.requires_instant_payment is false.

When booking an offer with type hold, do not specify payments or services keys.

Possible values: "instant" or "hold"

Endpoint

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

Request

curl -X POST --compressed "https://api.duffel.com/air/orders" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Duffel-Version: beta" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-d '{
"data": {
"type": "instant",
"services": [
{
"quantity": 1,
"id": "ase_00009hj8USM7Ncg31cB123"
}
],
"selected_offers": [
"off_00009htyDGjIfajdNBZRlw"
],
"payments": [
{
"type": "balance",
"currency": "GBP",
"amount": "30.20"
}
],
"passengers": [
{
"type": "adult",
"title": "mrs",
"phone_number": "+442080160509",
"infant_passenger_id": "pas_00009hj8USM8Ncg32aTGHL",
"identity_documents": [
{
"unique_identifier": "19KL56147",
"type": "passport",
"issuing_country_code": "GB",
"expires_on": "2025-04-25"
}
],
"id": "pas_00009hj8USM7Ncg31cBCLL",
"given_name": "Amelia",
"gender": "f",
"family_name": "Earhart",
"email": "amelia@duffel.com",
"born_on": "1987-07-24"
}
],
"metadata": {
"payment_intent_id": "pit_00009htYpSCXrwaB9DnUm2"
}
}
}'

Response

{
"data": {
"total_currency": "GBP",
"total_amount": "90.80",
"tax_currency": "GBP",
"tax_amount": "30.20",
"synced_at": "2020-04-11T15:48:11.642Z",
"slices": [
{
"segments": [
{
"passengers": [
{
"seat": {
"name": "Exit row seat",
"disclosures": [
"Do not seat children in exit row seats",
"Do not seat passengers with special needs in exit row seats"
],
"designator": "14B"
},
"passenger_id": "passenger_0",
"cabin_class_marketing_name": "Economy Basic",
"cabin_class": "economy",
"baggages": [
{
"type": "checked",
"quantity": 1
}
]
}
],
"origin_terminal": "B",
"origin": {
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
}
},
"operating_carrier_flight_number": "4321",
"operating_carrier": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"marketing_carrier_flight_number": "1234",
"marketing_carrier": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"id": "seg_00009htYpSCXrwaB9Dn456",
"duration": "PT02H26M",
"distance": "424.2",
"destination_terminal": "5",
"destination": {
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
}
},
"departure_terminal": "B",
"departure_datetime": "2020-06-13T16:38:02",
"departing_at": "2020-06-13T16:38:02",
"arriving_at": "2020-06-13T16:38:02",
"arrival_terminal": "5",
"arrival_datetime": "2020-06-13T16:38:02",
"aircraft": {
"name": "Airbus Industries A380",
"id": "arc_00009UhD4ongolulWd91Ky",
"iata_code": "380"
}
}
],
"origin_type": "airport",
"origin": {
"type": "airport",
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"iata_city_code": "LON",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
},
"airports": [
{
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
}
}
]
},
"id": "sli_00009htYpSCXrwaB9Dn123",
"duration": "PT02H26M",
"destination_type": "airport",
"destination": {
"type": "airport",
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"iata_city_code": "NYC",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
},
"airports": [
{
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
}
}
]
},
"conditions": {
"change_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
}
},
"changeable": false
}
],
"services": [
{
"type": "baggage",
"total_currency": "GBP",
"total_amount": "15.00",
"segment_ids": [
"seg_00009hj8USM7Ncg31cB456"
],
"quantity": 1,
"passenger_ids": [
"pas_00009hj8USM7Ncg31cBCLL"
],
"id": "ser_00009UhD4ongolulWd9123"
}
],
"payment_status": {
"price_guarantee_expires_at": "2020-01-17T10:42:14.545Z",
"payment_required_by": "2020-01-17T10:42:14.545Z",
"awaiting_payment": true
},
"passengers": [
{
"type": "adult",
"title": "mrs",
"infant_passenger_id": "pas_00009hj8USM8Ncg32aTGHL",
"id": "pas_00009hj8USM7Ncg31cBCLL",
"given_name": "Amelia",
"gender": "f",
"family_name": "Earhart",
"born_on": "1987-07-24"
}
],
"owner": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"metadata": {
"customer_prefs": "window seat"
},
"live_mode": false,
"id": "ord_00009hthhsUZ8W4LxQgkjo",
"documents": [
{
"unique_identifier": "1252106312810",
"type": "electronic_ticket"
}
],
"created_at": "2020-04-11T15:48:11.642Z",
"conditions": {
"refund_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
},
"change_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
}
},
"cancelled_at": "2020-04-11T15:48:11.642Z",
"booking_reference": "RZPNX8",
"base_currency": "GBP",
"base_amount": "30.20"
}
}

Retrieves an order by its ID

URL parameters

id
string
required

Duffel's unique identifier for the order

Example: "ord_00009hthhsUZ8W4LxQgkjo"

Endpoint

GET https://api.duffel.com/air/orders/{id}

Request

curl -X GET --compressed "https://api.duffel.com/air/orders/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: beta" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"data": {
"total_currency": "GBP",
"total_amount": "90.80",
"tax_currency": "GBP",
"tax_amount": "30.20",
"synced_at": "2020-04-11T15:48:11.642Z",
"slices": [
{
"segments": [
{
"passengers": [
{
"seat": {
"name": "Exit row seat",
"disclosures": [
"Do not seat children in exit row seats",
"Do not seat passengers with special needs in exit row seats"
],
"designator": "14B"
},
"passenger_id": "passenger_0",
"cabin_class_marketing_name": "Economy Basic",
"cabin_class": "economy",
"baggages": [
{
"type": "checked",
"quantity": 1
}
]
}
],
"origin_terminal": "B",
"origin": {
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
}
},
"operating_carrier_flight_number": "4321",
"operating_carrier": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"marketing_carrier_flight_number": "1234",
"marketing_carrier": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"id": "seg_00009htYpSCXrwaB9Dn456",
"duration": "PT02H26M",
"distance": "424.2",
"destination_terminal": "5",
"destination": {
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
}
},
"departure_terminal": "B",
"departure_datetime": "2020-06-13T16:38:02",
"departing_at": "2020-06-13T16:38:02",
"arriving_at": "2020-06-13T16:38:02",
"arrival_terminal": "5",
"arrival_datetime": "2020-06-13T16:38:02",
"aircraft": {
"name": "Airbus Industries A380",
"id": "arc_00009UhD4ongolulWd91Ky",
"iata_code": "380"
}
}
],
"origin_type": "airport",
"origin": {
"type": "airport",
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"iata_city_code": "LON",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
},
"airports": [
{
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
}
}
]
},
"id": "sli_00009htYpSCXrwaB9Dn123",
"duration": "PT02H26M",
"destination_type": "airport",
"destination": {
"type": "airport",
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"iata_city_code": "NYC",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
},
"airports": [
{
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
}
}
]
},
"conditions": {
"change_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
}
},
"changeable": false
}
],
"services": [
{
"type": "baggage",
"total_currency": "GBP",
"total_amount": "15.00",
"segment_ids": [
"seg_00009hj8USM7Ncg31cB456"
],
"quantity": 1,
"passenger_ids": [
"pas_00009hj8USM7Ncg31cBCLL"
],
"id": "ser_00009UhD4ongolulWd9123"
}
],
"payment_status": {
"price_guarantee_expires_at": "2020-01-17T10:42:14.545Z",
"payment_required_by": "2020-01-17T10:42:14.545Z",
"awaiting_payment": true
},
"passengers": [
{
"type": "adult",
"title": "mrs",
"infant_passenger_id": "pas_00009hj8USM8Ncg32aTGHL",
"id": "pas_00009hj8USM7Ncg31cBCLL",
"given_name": "Amelia",
"gender": "f",
"family_name": "Earhart",
"born_on": "1987-07-24"
}
],
"owner": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"metadata": {
"customer_prefs": "window seat"
},
"live_mode": false,
"id": "ord_00009hthhsUZ8W4LxQgkjo",
"documents": [
{
"unique_identifier": "1252106312810",
"type": "electronic_ticket"
}
],
"created_at": "2020-04-11T15:48:11.642Z",
"conditions": {
"refund_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
},
"change_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
}
},
"cancelled_at": "2020-04-11T15:48:11.642Z",
"booking_reference": "RZPNX8",
"base_currency": "GBP",
"base_amount": "30.20"
}
}

Some order fields are updateable. Each field that can be updated is detailed in the request object.

URL parameters

id
string
required

Duffel's unique identifier for the order

Example: "ord_00009hthhsUZ8W4LxQgkjo"

Body parameters

metadata
object

Metadata contains a set of key-value pairs that you can attach to an object. It can be useful for storing additional information about the object, in a structured format. Duffel does not use this information. You should not store sensitive information in this field.

The metadata is a collection of key-value pairs, both of which are strings. You can store a maximum of 50 key-value pairs, where each key has a maximum length of 40 characters and each value has a maximum length of 500 characters.

Keys must only contain numbers, letters, dashes, or underscores.

To clear this field, set it to an empty object ({}).

Example: {"payment_intent_id":"pit_00009htYpSCXrwaB9DnUm2"}

Endpoint

PATCH https://api.duffel.com/air/orders/{id}

Request

curl -X PATCH --compressed "https://api.duffel.com/air/orders/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: beta" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-d '{
"data": {
"metadata": {
"payment_intent_id": "pit_00009htYpSCXrwaB9DnUm2"
}
}
}'

Response

{
"data": {
"total_currency": "GBP",
"total_amount": "90.80",
"tax_currency": "GBP",
"tax_amount": "30.20",
"synced_at": "2020-04-11T15:48:11.642Z",
"slices": [
{
"segments": [
{
"passengers": [
{
"seat": {
"name": "Exit row seat",
"disclosures": [
"Do not seat children in exit row seats",
"Do not seat passengers with special needs in exit row seats"
],
"designator": "14B"
},
"passenger_id": "passenger_0",
"cabin_class_marketing_name": "Economy Basic",
"cabin_class": "economy",
"baggages": [
{
"type": "checked",
"quantity": 1
}
]
}
],
"origin_terminal": "B",
"origin": {
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
}
},
"operating_carrier_flight_number": "4321",
"operating_carrier": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"marketing_carrier_flight_number": "1234",
"marketing_carrier": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"id": "seg_00009htYpSCXrwaB9Dn456",
"duration": "PT02H26M",
"distance": "424.2",
"destination_terminal": "5",
"destination": {
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
}
},
"departure_terminal": "B",
"departure_datetime": "2020-06-13T16:38:02",
"departing_at": "2020-06-13T16:38:02",
"arriving_at": "2020-06-13T16:38:02",
"arrival_terminal": "5",
"arrival_datetime": "2020-06-13T16:38:02",
"aircraft": {
"name": "Airbus Industries A380",
"id": "arc_00009UhD4ongolulWd91Ky",
"iata_code": "380"
}
}
],
"origin_type": "airport",
"origin": {
"type": "airport",
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"iata_city_code": "LON",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
},
"airports": [
{
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
}
}
]
},
"id": "sli_00009htYpSCXrwaB9Dn123",
"duration": "PT02H26M",
"destination_type": "airport",
"destination": {
"type": "airport",
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"iata_city_code": "NYC",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
},
"airports": [
{
"time_zone": "America/New_York",
"name": "John F. Kennedy International Airport",
"longitude": -73.778519,
"latitude": 40.640556,
"id": "arp_jfk_us",
"icao_code": "KJFK",
"iata_country_code": "US",
"iata_code": "JFK",
"city_name": "New York",
"city": {
"name": "New York",
"id": "cit_nyc_us",
"iata_country_code": "US",
"iata_code": "NYC"
}
}
]
},
"conditions": {
"change_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
}
},
"changeable": false
}
],
"services": [
{
"type": "baggage",
"total_currency": "GBP",
"total_amount": "15.00",
"segment_ids": [
"seg_00009hj8USM7Ncg31cB456"
],
"quantity": 1,
"passenger_ids": [
"pas_00009hj8USM7Ncg31cBCLL"
],
"id": "ser_00009UhD4ongolulWd9123"
}
],
"payment_status": {
"price_guarantee_expires_at": "2020-01-17T10:42:14.545Z",
"payment_required_by": "2020-01-17T10:42:14.545Z",
"awaiting_payment": true
},
"passengers": [
{
"type": "adult",
"title": "mrs",
"infant_passenger_id": "pas_00009hj8USM8Ncg32aTGHL",
"id": "pas_00009hj8USM7Ncg31cBCLL",
"given_name": "Amelia",
"gender": "f",
"family_name": "Earhart",
"born_on": "1987-07-24"
}
],
"owner": {
"name": "British Airways",
"id": "aln_00001876aqC8c5umZmrRds",
"iata_code": "BA"
},
"metadata": {
"customer_prefs": "window seat"
},
"live_mode": false,
"id": "ord_00009hthhsUZ8W4LxQgkjo",
"documents": [
{
"unique_identifier": "1252106312810",
"type": "electronic_ticket"
}
],
"created_at": "2020-04-11T15:48:11.642Z",
"conditions": {
"refund_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
},
"change_before_departure": {
"penalty_currency": "GBP",
"penalty_amount": "100.00",
"allowed": true
}
},
"cancelled_at": "2020-04-11T15:48:11.642Z",
"booking_reference": "RZPNX8",
"base_currency": "GBP",
"base_amount": "30.20"
}
}