Reference example
# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/duffel/flights/order-change-requests/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"order_id": "ord_0000A3bQ8FJIQoEfuC07n6"
}
}'curl --request POST \
--url https://api.aisa.one/apis/v1/duffel/flights/order-change-requests/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"order_id": "ord_0000A3bQ8FJIQoEfuC07n6",
"private_fares": {
"UA": [
{
"corporate_code": "1234",
"tour_code": "578DFL"
}
]
},
"slices": {
"add": [
{
"cabin_class": "economy",
"departure_date": "2020-04-24",
"destination": "JFK",
"origin": "LHR"
}
],
"remove": [
{
"slice_id": "xxx_00009hthhsUZ8W4LxQgkjo"
}
]
}
}
}
'import requests
url = "https://api.aisa.one/apis/v1/duffel/flights/order-change-requests/create"
payload = { "data": {
"order_id": "ord_0000A3bQ8FJIQoEfuC07n6",
"private_fares": { "UA": [
{
"corporate_code": "1234",
"tour_code": "578DFL"
}
] },
"slices": {
"add": [
{
"cabin_class": "economy",
"departure_date": "2020-04-24",
"destination": "JFK",
"origin": "LHR"
}
],
"remove": [{ "slice_id": "xxx_00009hthhsUZ8W4LxQgkjo" }]
}
} }
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: {
order_id: 'ord_0000A3bQ8FJIQoEfuC07n6',
private_fares: {UA: [{corporate_code: '1234', tour_code: '578DFL'}]},
slices: {
add: [
{
cabin_class: 'economy',
departure_date: '2020-04-24',
destination: 'JFK',
origin: 'LHR'
}
],
remove: [{slice_id: 'xxx_00009hthhsUZ8W4LxQgkjo'}]
}
}
})
};
fetch('https://api.aisa.one/apis/v1/duffel/flights/order-change-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/order-change-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' => [
'order_id' => 'ord_0000A3bQ8FJIQoEfuC07n6',
'private_fares' => [
'UA' => [
[
'corporate_code' => '1234',
'tour_code' => '578DFL'
]
]
],
'slices' => [
'add' => [
[
'cabin_class' => 'economy',
'departure_date' => '2020-04-24',
'destination' => 'JFK',
'origin' => 'LHR'
]
],
'remove' => [
[
'slice_id' => 'xxx_00009hthhsUZ8W4LxQgkjo'
]
]
]
]
]),
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/order-change-requests/create"
payload := strings.NewReader("{\n \"data\": {\n \"order_id\": \"ord_0000A3bQ8FJIQoEfuC07n6\",\n \"private_fares\": {\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n },\n \"slices\": {\n \"add\": [\n {\n \"cabin_class\": \"economy\",\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\"\n }\n ],\n \"remove\": [\n {\n \"slice_id\": \"xxx_00009hthhsUZ8W4LxQgkjo\"\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/order-change-requests/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"order_id\": \"ord_0000A3bQ8FJIQoEfuC07n6\",\n \"private_fares\": {\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n },\n \"slices\": {\n \"add\": [\n {\n \"cabin_class\": \"economy\",\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\"\n }\n ],\n \"remove\": [\n {\n \"slice_id\": \"xxx_00009hthhsUZ8W4LxQgkjo\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/duffel/flights/order-change-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 \"order_id\": \"ord_0000A3bQ8FJIQoEfuC07n6\",\n \"private_fares\": {\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n },\n \"slices\": {\n \"add\": [\n {\n \"cabin_class\": \"economy\",\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\"\n }\n ],\n \"remove\": [\n {\n \"slice_id\": \"xxx_00009hthhsUZ8W4LxQgkjo\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"order_change_offers": [
{
"change_total_amount": "<string>",
"id": "<string>",
"new_total_amount": "<string>",
"penalty_total_amount": "<string>"
}
]
}
}{
"data": {
"created_at": "2020-01-17T10:12:14.545Z",
"id": "ocr_0000A3bQP9RLVfNUcdpLpw",
"live_mode": false,
"order_change_offers": [
{
"change_total_amount": "90.80",
"change_total_currency": "GBP",
"conditions": {
"change_before_departure": {
"allowed": true,
"penalty_amount": "100.00",
"penalty_currency": "GBP"
},
"refund_before_departure": {
"allowed": true,
"penalty_amount": "100.00",
"penalty_currency": "GBP"
}
},
"created_at": "2020-01-17T10:12:14.545Z",
"expires_at": "2020-01-17T10:42:14.545Z",
"id": "oco_0000A3vUda8dKRtUSQPSXw",
"live_mode": false,
"new_total_amount": "35.50",
"new_total_currency": "GBP",
"order_change_id": "oce_0000A4QasEUIjJ6jHKfhHU",
"penalty_total_amount": "10.50",
"penalty_total_currency": "GBP",
"private_fares": [
{
"corporate_code": "FLX53",
"tour_code": "578DFL",
"tracking_reference": "ABN:2345678",
"type": "corporate"
}
],
"refund_to": "original_form_of_payment",
"slices": {
"add": [
{
"destination": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"type": "airport",
"airports": [
{
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
}
],
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"destination_type": "airport",
"duration": "PT02H26M",
"fare_brand_name": "Basic",
"id": "xxx_00009hthhsUZ8W4LxQgkjo",
"origin": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"type": "airport",
"airports": [
{
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
}
],
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"origin_type": "airport",
"segments": [
{
"aircraft": {
"iata_code": "380",
"id": "arc_00009UhD4ongolulWd91Ky",
"name": "Airbus Industries A380"
},
"arriving_at": "2020-06-13T16:38:02",
"departing_at": "2020-06-13T16:38:02",
"destination": {
"city": {
"iata_code": "NYC",
"iata_country_code": "US",
"id": "cit_nyc_us",
"name": "New York"
},
"city_name": "New York",
"iata_city_code": "NYC",
"iata_code": "JFK",
"iata_country_code": "US",
"icao_code": "KJFK",
"id": "arp_jfk_us",
"latitude": 40.640556,
"longitude": -73.778519,
"name": "John F. Kennedy International Airport",
"time_zone": "America/New_York"
},
"destination_terminal": "5",
"distance": "424.2",
"duration": "PT02H26M",
"id": "xxx_00009hthhsUZ8W4LxQgkjo",
"marketing_carrier": {
"conditions_of_carriage_url": "https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage",
"iata_code": "BA",
"id": "arl_00001876aqC8c5umZmrRds",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg",
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg",
"name": "British Airways"
},
"marketing_carrier_flight_number": "1234",
"operating_carrier": {
"conditions_of_carriage_url": "https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage",
"iata_code": "BA",
"id": "arl_00001876aqC8c5umZmrRds",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg",
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg",
"name": "British Airways"
},
"operating_carrier_flight_number": "4321",
"origin": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"origin_terminal": "B",
"passengers": [
{
"baggages": [
{
"quantity": 1,
"type": "checked"
}
],
"cabin_class": "economy",
"cabin_class_marketing_name": "Economy Basic",
"passenger_id": "passenger_0",
"seat": {
"designator": "14B",
"disclosures": [
"Do not seat children in exit row seats",
"Do not seat passengers with special needs in exit row seats"
],
"name": "Exit row seat"
}
}
]
}
]
}
],
"remove": [
{
"destination": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"type": "airport",
"airports": [
{
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
}
],
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"destination_type": "airport",
"duration": "PT02H26M",
"fare_brand_name": "Basic",
"id": "xxx_00009hthhsUZ8W4LxQgkjo",
"origin": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"type": "airport",
"airports": [
{
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
}
],
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"origin_type": "airport",
"segments": [
{
"aircraft": {
"iata_code": "380",
"id": "arc_00009UhD4ongolulWd91Ky",
"name": "Airbus Industries A380"
},
"arriving_at": "2020-06-13T16:38:02",
"departing_at": "2020-06-13T16:38:02",
"destination": {
"city": {
"iata_code": "NYC",
"iata_country_code": "US",
"id": "cit_nyc_us",
"name": "New York"
},
"city_name": "New York",
"iata_city_code": "NYC",
"iata_code": "JFK",
"iata_country_code": "US",
"icao_code": "KJFK",
"id": "arp_jfk_us",
"latitude": 40.640556,
"longitude": -73.778519,
"name": "John F. Kennedy International Airport",
"time_zone": "America/New_York"
},
"destination_terminal": "5",
"distance": "424.2",
"duration": "PT02H26M",
"id": "xxx_00009hthhsUZ8W4LxQgkjo",
"marketing_carrier": {
"conditions_of_carriage_url": "https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage",
"iata_code": "BA",
"id": "arl_00001876aqC8c5umZmrRds",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg",
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg",
"name": "British Airways"
},
"marketing_carrier_flight_number": "1234",
"operating_carrier": {
"conditions_of_carriage_url": "https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage",
"iata_code": "BA",
"id": "arl_00001876aqC8c5umZmrRds",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg",
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg",
"name": "British Airways"
},
"operating_carrier_flight_number": "4321",
"origin": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"origin_terminal": "B",
"passengers": [
{
"baggages": [
{
"quantity": 1,
"type": "checked"
}
],
"cabin_class": "economy",
"cabin_class_marketing_name": "Economy Basic",
"passenger_id": "passenger_0",
"seat": {
"designator": "14B",
"disclosures": [
"Do not seat children in exit row seats",
"Do not seat passengers with special needs in exit row seats"
],
"name": "Exit row seat"
}
}
]
}
]
}
]
},
"updated_at": "2020-01-17T10:12:14.545Z"
}
],
"order_id": "ord_0000A3bQ8FJIQoEfuC07n6",
"slices": {
"add": [
{
"cabin_class": "economy",
"departure_date": "2020-04-24",
"destination": "LHR",
"origin": "LHR"
}
],
"remove": [
{
"slice_id": "xxx_00009hthhsUZ8W4LxQgkjo"
}
]
},
"updated_at": "2020-01-17T10:12:14.545Z"
},
"meta": {
"after": "<string>",
"before": "<string>",
"limit": 123
}
}Changes & Cancellations
Create Order Change Request
Fetch change offers for a paid order. New slices must keep the original cabin class.
POST
https://api.aisa.one
/
apis
/
v1
/
duffel
/
flights
/
order-change-requests
/
create
Reference example
# Fixed reference example. Playground inputs do not update this sample.
curl --request POST \
--url https://api.aisa.one/apis/v1/duffel/flights/order-change-requests/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"order_id": "ord_0000A3bQ8FJIQoEfuC07n6"
}
}'curl --request POST \
--url https://api.aisa.one/apis/v1/duffel/flights/order-change-requests/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"order_id": "ord_0000A3bQ8FJIQoEfuC07n6",
"private_fares": {
"UA": [
{
"corporate_code": "1234",
"tour_code": "578DFL"
}
]
},
"slices": {
"add": [
{
"cabin_class": "economy",
"departure_date": "2020-04-24",
"destination": "JFK",
"origin": "LHR"
}
],
"remove": [
{
"slice_id": "xxx_00009hthhsUZ8W4LxQgkjo"
}
]
}
}
}
'import requests
url = "https://api.aisa.one/apis/v1/duffel/flights/order-change-requests/create"
payload = { "data": {
"order_id": "ord_0000A3bQ8FJIQoEfuC07n6",
"private_fares": { "UA": [
{
"corporate_code": "1234",
"tour_code": "578DFL"
}
] },
"slices": {
"add": [
{
"cabin_class": "economy",
"departure_date": "2020-04-24",
"destination": "JFK",
"origin": "LHR"
}
],
"remove": [{ "slice_id": "xxx_00009hthhsUZ8W4LxQgkjo" }]
}
} }
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: {
order_id: 'ord_0000A3bQ8FJIQoEfuC07n6',
private_fares: {UA: [{corporate_code: '1234', tour_code: '578DFL'}]},
slices: {
add: [
{
cabin_class: 'economy',
departure_date: '2020-04-24',
destination: 'JFK',
origin: 'LHR'
}
],
remove: [{slice_id: 'xxx_00009hthhsUZ8W4LxQgkjo'}]
}
}
})
};
fetch('https://api.aisa.one/apis/v1/duffel/flights/order-change-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/order-change-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' => [
'order_id' => 'ord_0000A3bQ8FJIQoEfuC07n6',
'private_fares' => [
'UA' => [
[
'corporate_code' => '1234',
'tour_code' => '578DFL'
]
]
],
'slices' => [
'add' => [
[
'cabin_class' => 'economy',
'departure_date' => '2020-04-24',
'destination' => 'JFK',
'origin' => 'LHR'
]
],
'remove' => [
[
'slice_id' => 'xxx_00009hthhsUZ8W4LxQgkjo'
]
]
]
]
]),
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/order-change-requests/create"
payload := strings.NewReader("{\n \"data\": {\n \"order_id\": \"ord_0000A3bQ8FJIQoEfuC07n6\",\n \"private_fares\": {\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n },\n \"slices\": {\n \"add\": [\n {\n \"cabin_class\": \"economy\",\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\"\n }\n ],\n \"remove\": [\n {\n \"slice_id\": \"xxx_00009hthhsUZ8W4LxQgkjo\"\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/order-change-requests/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"order_id\": \"ord_0000A3bQ8FJIQoEfuC07n6\",\n \"private_fares\": {\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n },\n \"slices\": {\n \"add\": [\n {\n \"cabin_class\": \"economy\",\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\"\n }\n ],\n \"remove\": [\n {\n \"slice_id\": \"xxx_00009hthhsUZ8W4LxQgkjo\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/duffel/flights/order-change-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 \"order_id\": \"ord_0000A3bQ8FJIQoEfuC07n6\",\n \"private_fares\": {\n \"UA\": [\n {\n \"corporate_code\": \"1234\",\n \"tour_code\": \"578DFL\"\n }\n ]\n },\n \"slices\": {\n \"add\": [\n {\n \"cabin_class\": \"economy\",\n \"departure_date\": \"2020-04-24\",\n \"destination\": \"JFK\",\n \"origin\": \"LHR\"\n }\n ],\n \"remove\": [\n {\n \"slice_id\": \"xxx_00009hthhsUZ8W4LxQgkjo\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"order_change_offers": [
{
"change_total_amount": "<string>",
"id": "<string>",
"new_total_amount": "<string>",
"penalty_total_amount": "<string>"
}
]
}
}{
"data": {
"created_at": "2020-01-17T10:12:14.545Z",
"id": "ocr_0000A3bQP9RLVfNUcdpLpw",
"live_mode": false,
"order_change_offers": [
{
"change_total_amount": "90.80",
"change_total_currency": "GBP",
"conditions": {
"change_before_departure": {
"allowed": true,
"penalty_amount": "100.00",
"penalty_currency": "GBP"
},
"refund_before_departure": {
"allowed": true,
"penalty_amount": "100.00",
"penalty_currency": "GBP"
}
},
"created_at": "2020-01-17T10:12:14.545Z",
"expires_at": "2020-01-17T10:42:14.545Z",
"id": "oco_0000A3vUda8dKRtUSQPSXw",
"live_mode": false,
"new_total_amount": "35.50",
"new_total_currency": "GBP",
"order_change_id": "oce_0000A4QasEUIjJ6jHKfhHU",
"penalty_total_amount": "10.50",
"penalty_total_currency": "GBP",
"private_fares": [
{
"corporate_code": "FLX53",
"tour_code": "578DFL",
"tracking_reference": "ABN:2345678",
"type": "corporate"
}
],
"refund_to": "original_form_of_payment",
"slices": {
"add": [
{
"destination": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"type": "airport",
"airports": [
{
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
}
],
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"destination_type": "airport",
"duration": "PT02H26M",
"fare_brand_name": "Basic",
"id": "xxx_00009hthhsUZ8W4LxQgkjo",
"origin": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"type": "airport",
"airports": [
{
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
}
],
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"origin_type": "airport",
"segments": [
{
"aircraft": {
"iata_code": "380",
"id": "arc_00009UhD4ongolulWd91Ky",
"name": "Airbus Industries A380"
},
"arriving_at": "2020-06-13T16:38:02",
"departing_at": "2020-06-13T16:38:02",
"destination": {
"city": {
"iata_code": "NYC",
"iata_country_code": "US",
"id": "cit_nyc_us",
"name": "New York"
},
"city_name": "New York",
"iata_city_code": "NYC",
"iata_code": "JFK",
"iata_country_code": "US",
"icao_code": "KJFK",
"id": "arp_jfk_us",
"latitude": 40.640556,
"longitude": -73.778519,
"name": "John F. Kennedy International Airport",
"time_zone": "America/New_York"
},
"destination_terminal": "5",
"distance": "424.2",
"duration": "PT02H26M",
"id": "xxx_00009hthhsUZ8W4LxQgkjo",
"marketing_carrier": {
"conditions_of_carriage_url": "https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage",
"iata_code": "BA",
"id": "arl_00001876aqC8c5umZmrRds",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg",
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg",
"name": "British Airways"
},
"marketing_carrier_flight_number": "1234",
"operating_carrier": {
"conditions_of_carriage_url": "https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage",
"iata_code": "BA",
"id": "arl_00001876aqC8c5umZmrRds",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg",
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg",
"name": "British Airways"
},
"operating_carrier_flight_number": "4321",
"origin": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"origin_terminal": "B",
"passengers": [
{
"baggages": [
{
"quantity": 1,
"type": "checked"
}
],
"cabin_class": "economy",
"cabin_class_marketing_name": "Economy Basic",
"passenger_id": "passenger_0",
"seat": {
"designator": "14B",
"disclosures": [
"Do not seat children in exit row seats",
"Do not seat passengers with special needs in exit row seats"
],
"name": "Exit row seat"
}
}
]
}
]
}
],
"remove": [
{
"destination": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"type": "airport",
"airports": [
{
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
}
],
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"destination_type": "airport",
"duration": "PT02H26M",
"fare_brand_name": "Basic",
"id": "xxx_00009hthhsUZ8W4LxQgkjo",
"origin": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"type": "airport",
"airports": [
{
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
}
],
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"origin_type": "airport",
"segments": [
{
"aircraft": {
"iata_code": "380",
"id": "arc_00009UhD4ongolulWd91Ky",
"name": "Airbus Industries A380"
},
"arriving_at": "2020-06-13T16:38:02",
"departing_at": "2020-06-13T16:38:02",
"destination": {
"city": {
"iata_code": "NYC",
"iata_country_code": "US",
"id": "cit_nyc_us",
"name": "New York"
},
"city_name": "New York",
"iata_city_code": "NYC",
"iata_code": "JFK",
"iata_country_code": "US",
"icao_code": "KJFK",
"id": "arp_jfk_us",
"latitude": 40.640556,
"longitude": -73.778519,
"name": "John F. Kennedy International Airport",
"time_zone": "America/New_York"
},
"destination_terminal": "5",
"distance": "424.2",
"duration": "PT02H26M",
"id": "xxx_00009hthhsUZ8W4LxQgkjo",
"marketing_carrier": {
"conditions_of_carriage_url": "https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage",
"iata_code": "BA",
"id": "arl_00001876aqC8c5umZmrRds",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg",
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg",
"name": "British Airways"
},
"marketing_carrier_flight_number": "1234",
"operating_carrier": {
"conditions_of_carriage_url": "https://www.britishairways.com/en-gb/information/legal/british-airways/general-conditions-of-carriage",
"iata_code": "BA",
"id": "arl_00001876aqC8c5umZmrRds",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/BA.svg",
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/BA.svg",
"name": "British Airways"
},
"operating_carrier_flight_number": "4321",
"origin": {
"city_name": "London",
"iata_city_code": "LON",
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London",
"city": {
"airports": [
{
"iata_code": "LHR",
"iata_country_code": "GB",
"icao_code": "EGLL",
"id": "arp_lhr_gb",
"latitude": 64.068865,
"longitude": -141.951519,
"name": "Heathrow",
"time_zone": "Europe/London"
}
],
"iata_code": "LON",
"iata_country_code": "GB",
"id": "cit_lon_gb",
"name": "London"
}
},
"origin_terminal": "B",
"passengers": [
{
"baggages": [
{
"quantity": 1,
"type": "checked"
}
],
"cabin_class": "economy",
"cabin_class_marketing_name": "Economy Basic",
"passenger_id": "passenger_0",
"seat": {
"designator": "14B",
"disclosures": [
"Do not seat children in exit row seats",
"Do not seat passengers with special needs in exit row seats"
],
"name": "Exit row seat"
}
}
]
}
]
}
]
},
"updated_at": "2020-01-17T10:12:14.545Z"
}
],
"order_id": "ord_0000A3bQ8FJIQoEfuC07n6",
"slices": {
"add": [
{
"cabin_class": "economy",
"departure_date": "2020-04-24",
"destination": "LHR",
"origin": "LHR"
}
],
"remove": [
{
"slice_id": "xxx_00009hthhsUZ8W4LxQgkjo"
}
]
},
"updated_at": "2020-01-17T10:12:14.545Z"
},
"meta": {
"after": "<string>",
"before": "<string>",
"limit": 123
}
}Request contract
- Method and path: POST /apis/v1/duffel/flights/order-change-requests/create
- Availability: enabled
- Request URL template: https://api.aisa.one/apis/v1/duffel/flights/order-change-requests/create
- Runtime facts: d0ae990bcd8ea1a75abd7e4a4e47260a24ab01e5c2b9d2fcc0366eae9f069f96
{
"operationId": "post_duffel_order_change_requests_create",
"method": "POST",
"path": "/apis/v1/duffel/flights/order-change-requests/create",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"properties": {
"order_id": {
"description": "The order ID you wish to change",
"example": "ord_0000A3bQ8FJIQoEfuC07n6",
"type": "string"
},
"private_fares": {
"additionalProperties": true,
"description": "The private fare codes for this order change request. 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. The private fares for Order Change Requests work in much the same way as they do when searching for an offer request",
"example": {
"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.",
"properties": {
"add": {
"description": "The search criteria for slices which you wish to add to your order",
"items": {
"description": "The search criteria for a slice to be added",
"properties": {
"cabin_class": {
"description": "The cabin that the passengers want to travel in",
"enum": [
"first",
"business",
"premium_economy",
"economy"
],
"example": "economy",
"type": [
"string",
"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"
},
"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"
}
},
"type": "object"
},
"type": "array"
},
"remove": {
"description": "The slices that you wish to remove from your order",
"items": {
"description": "The slice ID for the slice to be removed",
"properties": {
"slice_id": {
"description": "Duffel's unique identifier for the resource",
"example": "xxx_00009hthhsUZ8W4LxQgkjo",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
},
"required": [
"order_id"
],
"title": "Body parameters",
"type": "object"
}
},
"required": [
"data"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"x-aisa-pricing": {
"cost_contract": "explicit_zero",
"customer_pricing": "fixed_success",
"default_request_estimate_usd": 0.005,
"estimate_source": "profile_seed",
"evidence_source": "request_snapshot"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Published reference price: $0.005 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.005
- Cost contract: explicit_zero
- Settlement evidence source: request_snapshot