curl --request POST \
--url https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"passengers": [
{
"type": "adult",
"family_name": "Earhart",
"given_name": "Amelia",
"loyalty_programme_accounts": [
{
"account_number": "12901014",
"airline_iata_code": "BA"
}
],
"user_id": "icu_0000A3t2sL46m5eDF45kWW"
}
],
"slices": [
{
"departure_date": "2020-04-24",
"destination": "JFK",
"origin": "LHR",
"arrival_time": {
"from": "09:45",
"to": "17:00"
},
"departure_time": {
"from": "09:45",
"to": "17:00"
}
}
],
"airline_credit_ids": [
"acd_00009hthhsUZ8W4LxQgkjo",
"acd_0000thhsUZ8W4LxQgkjo00"
],
"cabin_class": "economy",
"include_split_ticket": true,
"max_connections": 0,
"private_fares": {
"QF": [
{
"corporate_code": "FLX53",
"tracking_reference": "ABN:2345678"
}
],
"UA": [
{
"corporate_code": "1234",
"tour_code": "578DFL"
}
]
}
}
}
'import requests
url = "https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create"
payload = { "data": {
"passengers": [
{
"type": "adult",
"family_name": "Earhart",
"given_name": "Amelia",
"loyalty_programme_accounts": [
{
"account_number": "12901014",
"airline_iata_code": "BA"
}
],
"user_id": "icu_0000A3t2sL46m5eDF45kWW"
}
],
"slices": [
{
"departure_date": "2020-04-24",
"destination": "JFK",
"origin": "LHR",
"arrival_time": {
"from": "09:45",
"to": "17:00"
},
"departure_time": {
"from": "09:45",
"to": "17:00"
}
}
],
"airline_credit_ids": ["acd_00009hthhsUZ8W4LxQgkjo", "acd_0000thhsUZ8W4LxQgkjo00"],
"cabin_class": "economy",
"include_split_ticket": True,
"max_connections": 0,
"private_fares": {
"QF": [
{
"corporate_code": "FLX53",
"tracking_reference": "ABN:2345678"
}
],
"UA": [
{
"corporate_code": "1234",
"tour_code": "578DFL"
}
]
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
passengers: [
{
type: 'adult',
family_name: 'Earhart',
given_name: 'Amelia',
loyalty_programme_accounts: [{account_number: '12901014', airline_iata_code: 'BA'}],
user_id: 'icu_0000A3t2sL46m5eDF45kWW'
}
],
slices: [
{
departure_date: '2020-04-24',
destination: 'JFK',
origin: 'LHR',
arrival_time: {from: '09:45', to: '17:00'},
departure_time: {from: '09:45', to: '17:00'}
}
],
airline_credit_ids: ['acd_00009hthhsUZ8W4LxQgkjo', 'acd_0000thhsUZ8W4LxQgkjo00'],
cabin_class: 'economy',
include_split_ticket: true,
max_connections: 0,
private_fares: {
QF: [{corporate_code: 'FLX53', tracking_reference: 'ABN:2345678'}],
UA: [{corporate_code: '1234', tour_code: '578DFL'}]
}
}
})
};
fetch('https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'passengers' => [
[
'type' => 'adult',
'family_name' => 'Earhart',
'given_name' => 'Amelia',
'loyalty_programme_accounts' => [
[
'account_number' => '12901014',
'airline_iata_code' => 'BA'
]
],
'user_id' => 'icu_0000A3t2sL46m5eDF45kWW'
]
],
'slices' => [
[
'departure_date' => '2020-04-24',
'destination' => 'JFK',
'origin' => 'LHR',
'arrival_time' => [
'from' => '09:45',
'to' => '17:00'
],
'departure_time' => [
'from' => '09:45',
'to' => '17:00'
]
]
],
'airline_credit_ids' => [
'acd_00009hthhsUZ8W4LxQgkjo',
'acd_0000thhsUZ8W4LxQgkjo00'
],
'cabin_class' => 'economy',
'include_split_ticket' => true,
'max_connections' => 0,
'private_fares' => [
'QF' => [
[
'corporate_code' => 'FLX53',
'tracking_reference' => 'ABN:2345678'
]
],
'UA' => [
[
'corporate_code' => '1234',
'tour_code' => '578DFL'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create"
payload := strings.NewReader("{\n \"data\": {\n \"passengers\": [\n {\n \"type\": \"adult\",\n \"family_name\": \"Earhart\",\n \"given_name\": \"Amelia\",\n \"loyalty_programme_accounts\": [\n {\n \"account_number\": \"12901014\",\n \"airline_iata_code\": \"BA\"\n }\n ],\n \"user_id\": \"icu_0000A3t2sL46m5eDF45kWW\"\n }\n ],\n \"slices\": [\n {\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\",\n \"arrival_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n },\n \"departure_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n }\n }\n ],\n \"airline_credit_ids\": [\n \"acd_00009hthhsUZ8W4LxQgkjo\",\n \"acd_0000thhsUZ8W4LxQgkjo00\"\n ],\n \"cabin_class\": \"economy\",\n \"include_split_ticket\": true,\n \"max_connections\": 0,\n \"private_fares\": {\n \"QF\": [\n {\n \"corporate_code\": \"FLX53\",\n \"tracking_reference\": \"ABN:2345678\"\n }\n ],\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"passengers\": [\n {\n \"type\": \"adult\",\n \"family_name\": \"Earhart\",\n \"given_name\": \"Amelia\",\n \"loyalty_programme_accounts\": [\n {\n \"account_number\": \"12901014\",\n \"airline_iata_code\": \"BA\"\n }\n ],\n \"user_id\": \"icu_0000A3t2sL46m5eDF45kWW\"\n }\n ],\n \"slices\": [\n {\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\",\n \"arrival_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n },\n \"departure_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n }\n }\n ],\n \"airline_credit_ids\": [\n \"acd_00009hthhsUZ8W4LxQgkjo\",\n \"acd_0000thhsUZ8W4LxQgkjo00\"\n ],\n \"cabin_class\": \"economy\",\n \"include_split_ticket\": true,\n \"max_connections\": 0,\n \"private_fares\": {\n \"QF\": [\n {\n \"corporate_code\": \"FLX53\",\n \"tracking_reference\": \"ABN:2345678\"\n }\n ],\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"passengers\": [\n {\n \"type\": \"adult\",\n \"family_name\": \"Earhart\",\n \"given_name\": \"Amelia\",\n \"loyalty_programme_accounts\": [\n {\n \"account_number\": \"12901014\",\n \"airline_iata_code\": \"BA\"\n }\n ],\n \"user_id\": \"icu_0000A3t2sL46m5eDF45kWW\"\n }\n ],\n \"slices\": [\n {\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\",\n \"arrival_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n },\n \"departure_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n }\n }\n ],\n \"airline_credit_ids\": [\n \"acd_00009hthhsUZ8W4LxQgkjo\",\n \"acd_0000thhsUZ8W4LxQgkjo00\"\n ],\n \"cabin_class\": \"economy\",\n \"include_split_ticket\": true,\n \"max_connections\": 0,\n \"private_fares\": {\n \"QF\": [\n {\n \"corporate_code\": \"FLX53\",\n \"tracking_reference\": \"ABN:2345678\"\n }\n ],\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"cabin_class": "<string>",
"id": "orq_0000BAzrX1jsN0lVbavyvg",
"live_mode": true,
"offers": [
{
"expires_at": "2023-11-07T05:31:56Z",
"id": "off_0000BAzrX1wdbYyQFAuAoz",
"passenger_ids": [
"<string>"
],
"slices": [
{
"id": "<string>",
"segments": [
{
"arriving_at": "2023-11-07T05:31:56Z",
"departing_at": "2023-11-07T05:31:56Z",
"destination": {
"city_name": "<string>",
"iata_code": "<string>",
"id": "<string>",
"name": "<string>"
},
"flight_number": "<string>",
"id": "<string>",
"operating_carrier": {
"iata_code": "<string>",
"name": "<string>"
},
"origin": {
"city_name": "<string>",
"iata_code": "<string>",
"id": "<string>",
"name": "<string>"
}
}
]
}
],
"total_amount": "70.48",
"total_currency": "USD"
}
],
"passengers": [
{
"id": "pas_0000BAzrX1jsN0lVbavyvi",
"type": "<string>"
}
],
"slices": [
{
"departure_date": "2023-12-25",
"destination": "<string>",
"origin": "<string>"
}
]
}
}Create Flight Search
Search flights by route and passengers and receive priced offers with full segment details.
curl --request POST \
--url https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"passengers": [
{
"type": "adult",
"family_name": "Earhart",
"given_name": "Amelia",
"loyalty_programme_accounts": [
{
"account_number": "12901014",
"airline_iata_code": "BA"
}
],
"user_id": "icu_0000A3t2sL46m5eDF45kWW"
}
],
"slices": [
{
"departure_date": "2020-04-24",
"destination": "JFK",
"origin": "LHR",
"arrival_time": {
"from": "09:45",
"to": "17:00"
},
"departure_time": {
"from": "09:45",
"to": "17:00"
}
}
],
"airline_credit_ids": [
"acd_00009hthhsUZ8W4LxQgkjo",
"acd_0000thhsUZ8W4LxQgkjo00"
],
"cabin_class": "economy",
"include_split_ticket": true,
"max_connections": 0,
"private_fares": {
"QF": [
{
"corporate_code": "FLX53",
"tracking_reference": "ABN:2345678"
}
],
"UA": [
{
"corporate_code": "1234",
"tour_code": "578DFL"
}
]
}
}
}
'import requests
url = "https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create"
payload = { "data": {
"passengers": [
{
"type": "adult",
"family_name": "Earhart",
"given_name": "Amelia",
"loyalty_programme_accounts": [
{
"account_number": "12901014",
"airline_iata_code": "BA"
}
],
"user_id": "icu_0000A3t2sL46m5eDF45kWW"
}
],
"slices": [
{
"departure_date": "2020-04-24",
"destination": "JFK",
"origin": "LHR",
"arrival_time": {
"from": "09:45",
"to": "17:00"
},
"departure_time": {
"from": "09:45",
"to": "17:00"
}
}
],
"airline_credit_ids": ["acd_00009hthhsUZ8W4LxQgkjo", "acd_0000thhsUZ8W4LxQgkjo00"],
"cabin_class": "economy",
"include_split_ticket": True,
"max_connections": 0,
"private_fares": {
"QF": [
{
"corporate_code": "FLX53",
"tracking_reference": "ABN:2345678"
}
],
"UA": [
{
"corporate_code": "1234",
"tour_code": "578DFL"
}
]
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
passengers: [
{
type: 'adult',
family_name: 'Earhart',
given_name: 'Amelia',
loyalty_programme_accounts: [{account_number: '12901014', airline_iata_code: 'BA'}],
user_id: 'icu_0000A3t2sL46m5eDF45kWW'
}
],
slices: [
{
departure_date: '2020-04-24',
destination: 'JFK',
origin: 'LHR',
arrival_time: {from: '09:45', to: '17:00'},
departure_time: {from: '09:45', to: '17:00'}
}
],
airline_credit_ids: ['acd_00009hthhsUZ8W4LxQgkjo', 'acd_0000thhsUZ8W4LxQgkjo00'],
cabin_class: 'economy',
include_split_ticket: true,
max_connections: 0,
private_fares: {
QF: [{corporate_code: 'FLX53', tracking_reference: 'ABN:2345678'}],
UA: [{corporate_code: '1234', tour_code: '578DFL'}]
}
}
})
};
fetch('https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'passengers' => [
[
'type' => 'adult',
'family_name' => 'Earhart',
'given_name' => 'Amelia',
'loyalty_programme_accounts' => [
[
'account_number' => '12901014',
'airline_iata_code' => 'BA'
]
],
'user_id' => 'icu_0000A3t2sL46m5eDF45kWW'
]
],
'slices' => [
[
'departure_date' => '2020-04-24',
'destination' => 'JFK',
'origin' => 'LHR',
'arrival_time' => [
'from' => '09:45',
'to' => '17:00'
],
'departure_time' => [
'from' => '09:45',
'to' => '17:00'
]
]
],
'airline_credit_ids' => [
'acd_00009hthhsUZ8W4LxQgkjo',
'acd_0000thhsUZ8W4LxQgkjo00'
],
'cabin_class' => 'economy',
'include_split_ticket' => true,
'max_connections' => 0,
'private_fares' => [
'QF' => [
[
'corporate_code' => 'FLX53',
'tracking_reference' => 'ABN:2345678'
]
],
'UA' => [
[
'corporate_code' => '1234',
'tour_code' => '578DFL'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create"
payload := strings.NewReader("{\n \"data\": {\n \"passengers\": [\n {\n \"type\": \"adult\",\n \"family_name\": \"Earhart\",\n \"given_name\": \"Amelia\",\n \"loyalty_programme_accounts\": [\n {\n \"account_number\": \"12901014\",\n \"airline_iata_code\": \"BA\"\n }\n ],\n \"user_id\": \"icu_0000A3t2sL46m5eDF45kWW\"\n }\n ],\n \"slices\": [\n {\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\",\n \"arrival_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n },\n \"departure_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n }\n }\n ],\n \"airline_credit_ids\": [\n \"acd_00009hthhsUZ8W4LxQgkjo\",\n \"acd_0000thhsUZ8W4LxQgkjo00\"\n ],\n \"cabin_class\": \"economy\",\n \"include_split_ticket\": true,\n \"max_connections\": 0,\n \"private_fares\": {\n \"QF\": [\n {\n \"corporate_code\": \"FLX53\",\n \"tracking_reference\": \"ABN:2345678\"\n }\n ],\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"passengers\": [\n {\n \"type\": \"adult\",\n \"family_name\": \"Earhart\",\n \"given_name\": \"Amelia\",\n \"loyalty_programme_accounts\": [\n {\n \"account_number\": \"12901014\",\n \"airline_iata_code\": \"BA\"\n }\n ],\n \"user_id\": \"icu_0000A3t2sL46m5eDF45kWW\"\n }\n ],\n \"slices\": [\n {\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\",\n \"arrival_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n },\n \"departure_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n }\n }\n ],\n \"airline_credit_ids\": [\n \"acd_00009hthhsUZ8W4LxQgkjo\",\n \"acd_0000thhsUZ8W4LxQgkjo00\"\n ],\n \"cabin_class\": \"economy\",\n \"include_split_ticket\": true,\n \"max_connections\": 0,\n \"private_fares\": {\n \"QF\": [\n {\n \"corporate_code\": \"FLX53\",\n \"tracking_reference\": \"ABN:2345678\"\n }\n ],\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"passengers\": [\n {\n \"type\": \"adult\",\n \"family_name\": \"Earhart\",\n \"given_name\": \"Amelia\",\n \"loyalty_programme_accounts\": [\n {\n \"account_number\": \"12901014\",\n \"airline_iata_code\": \"BA\"\n }\n ],\n \"user_id\": \"icu_0000A3t2sL46m5eDF45kWW\"\n }\n ],\n \"slices\": [\n {\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\",\n \"arrival_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n },\n \"departure_time\": {\n \"from\": \"09:45\",\n \"to\": \"17:00\"\n }\n }\n ],\n \"airline_credit_ids\": [\n \"acd_00009hthhsUZ8W4LxQgkjo\",\n \"acd_0000thhsUZ8W4LxQgkjo00\"\n ],\n \"cabin_class\": \"economy\",\n \"include_split_ticket\": true,\n \"max_connections\": 0,\n \"private_fares\": {\n \"QF\": [\n {\n \"corporate_code\": \"FLX53\",\n \"tracking_reference\": \"ABN:2345678\"\n }\n ],\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"cabin_class": "<string>",
"id": "orq_0000BAzrX1jsN0lVbavyvg",
"live_mode": true,
"offers": [
{
"expires_at": "2023-11-07T05:31:56Z",
"id": "off_0000BAzrX1wdbYyQFAuAoz",
"passenger_ids": [
"<string>"
],
"slices": [
{
"id": "<string>",
"segments": [
{
"arriving_at": "2023-11-07T05:31:56Z",
"departing_at": "2023-11-07T05:31:56Z",
"destination": {
"city_name": "<string>",
"iata_code": "<string>",
"id": "<string>",
"name": "<string>"
},
"flight_number": "<string>",
"id": "<string>",
"operating_carrier": {
"iata_code": "<string>",
"name": "<string>"
},
"origin": {
"city_name": "<string>",
"iata_code": "<string>",
"id": "<string>",
"name": "<string>"
}
}
]
}
],
"total_amount": "70.48",
"total_currency": "USD"
}
],
"passengers": [
{
"id": "pas_0000BAzrX1jsN0lVbavyvi",
"type": "<string>"
}
],
"slices": [
{
"departure_date": "2023-12-25",
"destination": "<string>",
"origin": "<string>"
}
]
}
}Request contract
- Method and path: POST /apis/v1/duffel/flights/offer-requests/create
- Availability: enabled
- Request URL template: https://api.aisa.one/apis/v1/duffel/flights/offer-requests/create
- return_offers: query; optional
- supplier_timeout: query; optional
- view: query; optional
- Runtime facts: d0ae990bcd8ea1a75abd7e4a4e47260a24ab01e5c2b9d2fcc0366eae9f069f96
{
"operationId": "post_duffel_offer_requests_create",
"method": "POST",
"path": "/apis/v1/duffel/flights/offer-requests/create",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "When set to `true`, the offer request resource returned will include _all_ the `offer`s returned by the airlines.\nIf set to `false`, the offer request resource won't include any `offer`s. To retrieve the associated offers later, use the [List Offers](/docs/api/offers/get-offers) endpoint, specifying the `offer_request_id`. You should use this option if you want to take advantage of the pagination, sorting and filtering that the [List Offers](/docs/api/offers/get-offers) endpoint provides.\n",
"in": "query",
"name": "return_offers",
"required": false,
"schema": {
"default": true,
"example": false,
"type": "boolean"
}
},
{
"description": "The maximum amount of time in milliseconds to wait for each airline search to complete. This timeout applies to the [response time](/docs/api/overview/response-times) of the call to the airline and includes some additional overhead added by Duffel.\nValue should be between 2 seconds and 60 seconds. Any values outside the range will be ignored and the default `supplier_timeout` will be used.\nIf a value is set, the response will only include offers from airline searches that completed within the given time.\nIf a value is not set, the response will only include offers from airline searches that completed within the default `supplier_timeout` value of 20 seconds.\nWe recommend setting `supplier_timeout` lower than the timeout on the HTTP request you send to Duffel API as that will allow us to respond with the offers we received before your request times out with an empty response.\n",
"in": "query",
"name": "supplier_timeout",
"required": false,
"schema": {
"default": 20000,
"example": 10000,
"type": "integer"
}
},
{
"description": "The format of the response. When set to `offers` (the default), the response includes a flat list of offers.\nWhen set to `itineraries`, offers are grouped into a hierarchical structure of slices, itineraries, and brands,\nwith shared data (airlines, places, aircraft) in top-level reference maps.\n",
"in": "query",
"name": "view",
"required": false,
"schema": {
"default": "offers",
"enum": [
"offers",
"itineraries"
],
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"properties": {
"airline_credit_ids": {
"description": "The list of airline credit IDs that Duffel received as input.",
"example": [
"acd_00009hthhsUZ8W4LxQgkjo",
"acd_0000thhsUZ8W4LxQgkjo00"
],
"items": {
"example": "acd_0000thhsUZ8W4LxQgkjo00",
"type": "string"
},
"type": "array"
},
"cabin_class": {
"description": "The cabin that the passengers want to travel in",
"enum": [
"first",
"business",
"premium_economy",
"economy"
],
"example": "economy",
"type": [
"string",
"null"
]
},
"include_split_ticket": {
"description": "When set to `true` and the search has more than one slice, additional one-way searches will be fired per slice to find split-ticket candidates. These results are only included in the response when `view` is set to `itineraries`. Please get in touch with the Duffel support team at <help@duffel.com> to access this feature.",
"example": true,
"type": "boolean"
},
"max_connections": {
"default": 1,
"description": "The maximum number of connections within any slice of the offer. For example 0 means a direct flight which will have a single segment within each slice and 1 means a maximum of two segments within each slice of the offer.",
"example": 0,
"maximum": 2,
"minimum": 0,
"type": "integer"
},
"passengers": {
"description": "The passengers who want to travel. If you specify an `age` for a passenger, the `type` may differ for the same passenger in different offers due to airline's different rules. e.g. one airline may treat a 14 year old as an adult, and another as a young adult. You may only specify an `age` or a `type` – not both.",
"items": {
"oneOf": [
{
"description": "A passenger specified by their type",
"properties": {
"family_name": {
"description": "The passenger's family name. Only `space`, `-`, `'`, and letters from the [`ASCII`](https://www.unicode.org/charts/PDF/U0000.pdf), [`Latin-1 Supplement`](https://www.unicode.org/charts/PDF/U0080.pdf) and [`Latin Extended-A`](https://www.unicode.org/charts/PDF/U0100.pdf) (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters.\n\nThis is only required if you're also including loyalty programme accounts.\n",
"example": "Earhart",
"type": "string"
},
"given_name": {
"description": "The passenger's given name. Only `space`, `-`, `'`, and letters from the [`ASCII`](https://www.unicode.org/charts/PDF/U0000.pdf), [`Latin-1 Supplement`](https://www.unicode.org/charts/PDF/U0080.pdf) and [`Latin Extended-A`](https://www.unicode.org/charts/PDF/U0100.pdf) (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters.\n\nThis is only required if you're also including loyalty programme accounts.\n",
"example": "Amelia",
"type": "string"
},
"loyalty_programme_accounts": {
"description": "The loyalty programme accounts for this passenger",
"items": {
"properties": {
"account_number": {
"description": "The passenger's account number for this loyalty programme account",
"example": "12901014",
"type": "string"
},
"airline_iata_code": {
"description": "The IATA code for the airline that this loyalty programme account belongs to",
"example": "BA",
"type": "string"
}
},
"title": "Loyalty Programme Account",
"type": "object"
},
"type": "array"
},
"type": {
"description": "The type of the passenger. If the passenger is aged 18 or over, you should specify a `type` of `adult`. If a passenger is aged under 18, you should specify their `age` instead of a `type`. A passenger can have only a type or an age, but not both.",
"enum": [
"adult",
"child",
"infant_without_seat"
],
"example": "adult",
"type": "string"
},
"user_id": {
"description": "The ID of the customer user that associates with this passenger.\n",
"example": "icu_0000A3t2sL46m5eDF45kWW",
"type": "string"
}
},
"required": [
"type"
],
"title": "Offer Request Body Passenger With Type",
"type": "object"
},
{
"description": "A passenger specified by their age",
"properties": {
"age": {
"description": "The age of the passenger on the `departure_date` of the final slice. e.g. if you are searching for a round trip and the passenger is 15 years old at the time of the outbound flight, but they then have their birthday and are 16 years old for the inbound flight, you must set the age to 16. You should specify an `age` for passengers who are under 18 years old. A passenger can have only a type or an age, but not both. You can optionally pass age with fare_type though.",
"example": 14,
"maximum": 130,
"minimum": 0,
"type": "integer"
},
"family_name": {
"description": "The passenger's family name. Only `space`, `-`, `'`, and letters from the [`ASCII`](https://www.unicode.org/charts/PDF/U0000.pdf), [`Latin-1 Supplement`](https://www.unicode.org/charts/PDF/U0080.pdf) and [`Latin Extended-A`](https://www.unicode.org/charts/PDF/U0100.pdf) (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters.\n\nThis is only required if you're also including loyalty programme accounts.\n",
"example": "Earhart",
"type": "string"
},
"given_name": {
"description": "The passenger's given name. Only `space`, `-`, `'`, and letters from the [`ASCII`](https://www.unicode.org/charts/PDF/U0000.pdf), [`Latin-1 Supplement`](https://www.unicode.org/charts/PDF/U0080.pdf) and [`Latin Extended-A`](https://www.unicode.org/charts/PDF/U0100.pdf) (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters.\n\nThis is only required if you're also including loyalty programme accounts.\n",
"example": "Amelia",
"type": "string"
},
"loyalty_programme_accounts": {
"description": "The loyalty programme accounts for this passenger",
"items": {
"properties": {
"account_number": {
"description": "The passenger's account number for this loyalty programme account",
"example": "12901014",
"type": "string"
},
"airline_iata_code": {
"description": "The IATA code for the airline that this loyalty programme account belongs to",
"example": "BA",
"type": "string"
}
},
"title": "Loyalty Programme Account",
"type": "object"
},
"type": "array"
},
"user_id": {
"description": "The ID of the customer user that associates with this passenger.\n",
"example": "icu_0000A3t2sL46m5eDF45kWW",
"type": "string"
}
},
"required": [
"age"
],
"title": "Offer Request Body Passenger With Age",
"type": "object"
},
{
"description": "A passenger specified by their fare type. This is used for leisure private fares.",
"properties": {
"age": {
"description": "The age of the passenger on the `departure_date` of the final slice. e.g. if you are searching for a round trip and the passenger is 15 years old at the time of the outbound flight, but they then have their birthday and are 16 years old for the inbound flight, you must set the age to 16. You should specify an `age` for passengers who are under 18 years old. A passenger can have only a type or an age, but not both. You can optionally pass age with fare_type though.",
"example": 14,
"maximum": 130,
"minimum": 0,
"type": "integer"
},
"family_name": {
"description": "The passenger's family name. Only `space`, `-`, `'`, and letters from the [`ASCII`](https://www.unicode.org/charts/PDF/U0000.pdf), [`Latin-1 Supplement`](https://www.unicode.org/charts/PDF/U0080.pdf) and [`Latin Extended-A`](https://www.unicode.org/charts/PDF/U0100.pdf) (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters.\n\nThis is only required if you're also including loyalty programme accounts.\n",
"example": "Earhart",
"type": "string"
},
"fare_type": {
"description": "The fare type of the passenger. If the passenger is aged less than 18, you should pass in age as well.",
"enum": [
"accompanying_adult",
"contract_bulk",
"contract_bulk_child",
"contract_bulk_infant_with_seat",
"contract_bulk_infant_without_seat",
"frequent_flyer",
"group_inclusive_tour",
"group_inclusive_tour_child",
"humanitarian",
"individual_inclusive_tour_child",
"marine",
"seat_only",
"student",
"teacher",
"tour_operator_inclusive",
"tour_operator_inclusive_infant",
"unaccompanied_child",
"visiting_friends_and_family"
],
"example": "student",
"type": "string"
},
"given_name": {
"description": "The passenger's given name. Only `space`, `-`, `'`, and letters from the [`ASCII`](https://www.unicode.org/charts/PDF/U0000.pdf), [`Latin-1 Supplement`](https://www.unicode.org/charts/PDF/U0080.pdf) and [`Latin Extended-A`](https://www.unicode.org/charts/PDF/U0100.pdf) (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters.\n\nThis is only required if you're also including loyalty programme accounts.\n",
"example": "Amelia",
"type": "string"
},
"loyalty_programme_accounts": {
"description": "The loyalty programme accounts for this passenger",
"items": {
"properties": {
"account_number": {
"description": "The passenger's account number for this loyalty programme account",
"example": "12901014",
"type": "string"
},
"airline_iata_code": {
"description": "The IATA code for the airline that this loyalty programme account belongs to",
"example": "BA",
"type": "string"
}
},
"title": "Loyalty Programme Account",
"type": "object"
},
"type": "array"
},
"user_id": {
"description": "The ID of the customer user that associates with this passenger.\n",
"example": "icu_0000A3t2sL46m5eDF45kWW",
"type": "string"
}
},
"required": [
"fare_type"
],
"title": "Offer Request Body Passenger With Fare Type",
"type": "object"
}
]
},
"type": "array"
},
"private_fares": {
"additionalProperties": true,
"description": "The private fare codes for this offer request. You can pass in multiple airlines with their specific private fare codes. The key is the airline's IATA code that provided the private fare code. The `corporate_code` and `tour_code` are provided to you by the airline and the `tracking_reference` is to identify your business by the airlines.",
"example": {
"QF": [
{
"corporate_code": "FLX53",
"tracking_reference": "ABN:2345678"
}
],
"UA": [
{
"corporate_code": "1234",
"tour_code": "578DFL"
}
]
}
},
"slices": {
"description": "The [slices](/docs/api/overview/key-concepts) that make up this offer request. One-way journeys can be expressed using one slice, whereas return trips will need two.",
"items": {
"properties": {
"arrival_time": {
"description": "The inclusive time range for the arrival of the slice",
"properties": {
"from": {
"description": "The local time in the format `hh:mm` of the destination airport at or after which the slice should arrive. Defaults to `00:00` when only `to` is provided",
"example": "09:45",
"format": "hh:mm",
"type": [
"string",
"null"
]
},
"to": {
"description": "The local time in the format `hh:mm` of the destination airport at or before which the slice should arrive. Defaults to `23:59` when only `from` is provided",
"example": "17:00",
"format": "hh:mm",
"type": [
"string",
"null"
]
}
},
"title": "ArrivalTime",
"type": [
"object",
"null"
]
},
"departure_date": {
"description": "The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the passengers want to depart",
"example": "2020-04-24",
"format": "date",
"type": "string"
},
"departure_time": {
"description": "The inclusive time range for the departure of the slice",
"properties": {
"from": {
"description": "The local time in the format `hh:mm` of the origin airport at or after which the slice should depart. Defaults to current time at airport when only `to` is provided or `from` value is in the past",
"example": "09:45",
"format": "hh:mm",
"type": [
"string",
"null"
]
},
"to": {
"description": "The local time in the format `hh:mm` of the origin airport at or before which the slice should depart. Defaults to `23:59` when only `from` is provided",
"example": "17:00",
"format": "hh:mm",
"type": [
"string",
"null"
]
}
},
"title": "DepartureTime",
"type": [
"object",
"null"
]
},
"destination": {
"description": "The 3-letter IATA code for the city or airport where this slice ends",
"example": "JFK",
"type": "string"
},
"origin": {
"description": "The 3-letter IATA code for the city or airport where this slice starts",
"example": "LHR",
"type": "string"
}
},
"required": [
"departure_date",
"destination",
"origin"
],
"title": "Offer Request Body Slice",
"type": "object"
},
"type": "array"
}
},
"required": [
"slices",
"passengers"
],
"title": "Body parameters",
"type": "object"
}
},
"required": [
"data"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"x-aisa-pricing": {
"cost_contract": "fixed_success",
"customer_pricing": "fixed_success",
"default_request_estimate_usd": 0.02,
"estimate_source": "profile_seed",
"evidence_source": "request_snapshot"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Published reference price: $0.02 USD per successful request. Account-specific pricing and final settlement may differ. Published reference values are not an account-specific quote or a settled charge. For endpoints supporting X-AISA-Cost-Mode: quote, obtain a free quote for your exact request before execution; reconcile the settled cost with response metadata and Usage Logs. USD amounts use 1,000,000 integer micro-USD per dollar.- Default request reference estimate (USD): 0.02
- Cost contract: fixed_success
- Settlement evidence source: request_snapshot
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
When set to true, the offer request resource returned will include all the offers returned by the airlines.
If set to false, the offer request resource won't include any offers. To retrieve the associated offers later, use the List Offers endpoint, specifying the offer_request_id. You should use this option if you want to take advantage of the pagination, sorting and filtering that the List Offers endpoint provides.
false
The maximum amount of time in milliseconds to wait for each airline search to complete. This timeout applies to the response time of the call to the airline and includes some additional overhead added by Duffel.
Value should be between 2 seconds and 60 seconds. Any values outside the range will be ignored and the default supplier_timeout will be used.
If a value is set, the response will only include offers from airline searches that completed within the given time.
If a value is not set, the response will only include offers from airline searches that completed within the default supplier_timeout value of 20 seconds.
We recommend setting supplier_timeout lower than the timeout on the HTTP request you send to Duffel API as that will allow us to respond with the offers we received before your request times out with an empty response.
10000
The format of the response. When set to offers (the default), the response includes a flat list of offers.
When set to itineraries, offers are grouped into a hierarchical structure of slices, itineraries, and brands,
with shared data (airlines, places, aircraft) in top-level reference maps.
offers, itineraries Body
Show child attributes
Show child attributes
Response
Successful response