Test your integration

This page includes test scenarios for our Duffel test environment to make sure your integration works as planned. Use it to trigger different flows in your integration and ensure they are handled accordingly.

Airline Routes

Genuine airline routes and data cannot be guaranteed in test mode. Instead, we provide you with specific routes that allow you to test individual behaviours of our API.

These routes will be provided in the format of AIRPORT_IATA_CODE -> AIRPORT_IATA_CODE, since those are the codes you'll use to communicate with our API.

Offer Request API

NameEndpointOriginDestinationDescription
No FlightsCreate an offer requestRhode Island T.F. Green International Airport (PVD)Praia Nelson Mandela International Airport (RAI)No offers will be returned as a result of this request
Connecting FlightsCreate an offer requestLondon Heathrow Airport (LHR)Dubai International Airport (DXB)Offers returned will all have more than one segment, also known as a connecting flight
No Segment Passenger BaggagesCreate an offer requestBratislava Airport (BTS)Sir Seewoosagur Ramgoolam International Airport (MRU)Offers returned will have no baggages for all passengers across all segments

No Flights

Whenever you search for flights, there is always a chance of no results being found for that specific data or itinerary. In order to cover that scenario, you can specifically search for a one-way flight from Rhode Island T.F. Green International Airport (PVD) to Praia Nelson Mandela International Airport (RAI) which will be guaranteed to never return any offers back.

curl -X POST --compressed "https://api.duffel.com/air/offer_requests" \
-H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-H "Duffel-Version: beta" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-d '{
"data": {
"cabin_class": "economy",
"slices": [
{
"departure_date": "2021-02-09",
"destination": "RAI",
"origin": "PVD"
}
],
"passengers": [
{
"type": "adult"
}
]
}
}'

Connecting Flights

A single trip might be composed of multiple connecting flights, for example, if you are flying from London to New York you might find flights that make a stop-over in Frankfurt first. In order to cover this scenario, using the Duffel test environment, you can request a one-way flight from London Heathrow Airport (LHR) to Dubai International Airport (DXB) which will be guaranteed to return you flights with at least one stop-over flight in-between the origin and destination.

curl -X POST --compressed "https://api.duffel.com/air/offer_requests" \
-H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-H "Duffel-Version: beta" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-d '{
"data": {
"cabin_class": "economy",
"slices": [
{
"departure_date": "2021-02-09",
"destination": "DXB",
"origin": "LHR"
}
],
"passengers": [
{
"type": "adult"
}
]
}
}'

No Segment Passenger Baggages

When you book a flight, there is a possibility that the airline does not give you any baggage. In order to cover this scenario, you can search for a one-way flight from Bratislava Airport (BTS) to Sir Seewoosagur Ramgoolam International Airport (MRU) which will return no baggages for any passenger across all segments for the flight.

curl -X POST --compressed "https://api.duffel.com/air/offer_requests" \
-H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-H "Duffel-Version: beta" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-d '{
"data": {
"cabin_class": "economy",
"slices": [
{
"departure_date": "2021-02-09",
"destination": "MRU",
"origin": "BTS"
}
],
"passengers": [
{
"type": "adult"
}
]
}
}'

Offer API

NameEndpointOriginDestinationDescription
No Additional ServicesGet a single offerBratislava Airport(BTS)Abuja Airport (ABV)No services (e.g. additional baggage) will be included in this offer. In order to use this scenario return_available_services must be true.

No Additional Services

This scenario allows you to test your integration for when you've requested to see the services available for a particular offer and no services are found. Using the Duffel test environment, you can request a one-way flight from Bratislava Airport (BTS) to Abuja Airport (ABV) to test this scenario.

In order for this scenario to work, you'll need to provide as a query parameters the option return_available_services=true.

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