Create Order Cancellation
curl --request POST \
--url https://api.aisa.one/apis/v1/duffel/flights/order-cancellations/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"order_id": "ord_001"
}
}
'import requests
url = "https://api.aisa.one/apis/v1/duffel/flights/order-cancellations/create"
payload = { "data": { "order_id": "ord_001" } }
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_001'}})
};
fetch('https://api.aisa.one/apis/v1/duffel/flights/order-cancellations/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-cancellations/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_001'
]
]),
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-cancellations/create"
payload := strings.NewReader("{\n \"data\": {\n \"order_id\": \"ord_001\"\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-cancellations/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"order_id\": \"ord_001\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/duffel/flights/order-cancellations/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_001\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "ore_0000BAzrZ6yBtPriPLcjeX",
"order_id": "<string>",
"refund_amount": "<string>",
"refund_currency": "<string>",
"refund_to": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"confirmed_at": "2023-11-07T05:31:56Z"
}
}{
"data": {
"airline_credits": [
{
"amount": "90.80",
"amount_currency": "GBP",
"code": "1234567890123",
"id": "act_00009qzZWzjDipIkqpaUAj",
"issued_on": "2023-02-24",
"passenger_id": "pas_00009hj8USM7Ncg31cBCLL",
"type": "eticket",
"credit_amount": "90.80",
"credit_code": "1234567890123",
"credit_currency": "GBP",
"credit_name": "Duffel Travel Credit"
}
],
"confirmed_at": "2020-01-17T11:51:43.114803Z",
"created_at": "2020-04-11T15:48:11.642Z",
"expires_at": "2020-01-17T10:42:14Z",
"id": "ore_00009qzZWzjDipIkqpaUAj",
"live_mode": false,
"order_id": "xxx_00009hthhsUZ8W4LxQgkjo",
"refund_amount": "90.80",
"refund_currency": "GBP",
"refund_to": "arc_bsp_cash"
},
"meta": {
"limit": 123,
"before": "<string>",
"after": "<string>"
}
}Duffel Flights
Create Order Cancellation
Fetch the refund quote for an order
POST
https://api.aisa.one
/
apis
/
v1
/
duffel
/
flights
/
order-cancellations
/
create
Create Order Cancellation
curl --request POST \
--url https://api.aisa.one/apis/v1/duffel/flights/order-cancellations/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"order_id": "ord_001"
}
}
'import requests
url = "https://api.aisa.one/apis/v1/duffel/flights/order-cancellations/create"
payload = { "data": { "order_id": "ord_001" } }
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_001'}})
};
fetch('https://api.aisa.one/apis/v1/duffel/flights/order-cancellations/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-cancellations/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_001'
]
]),
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-cancellations/create"
payload := strings.NewReader("{\n \"data\": {\n \"order_id\": \"ord_001\"\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-cancellations/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"order_id\": \"ord_001\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/duffel/flights/order-cancellations/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_001\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "ore_0000BAzrZ6yBtPriPLcjeX",
"order_id": "<string>",
"refund_amount": "<string>",
"refund_currency": "<string>",
"refund_to": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"confirmed_at": "2023-11-07T05:31:56Z"
}
}{
"data": {
"airline_credits": [
{
"amount": "90.80",
"amount_currency": "GBP",
"code": "1234567890123",
"id": "act_00009qzZWzjDipIkqpaUAj",
"issued_on": "2023-02-24",
"passenger_id": "pas_00009hj8USM7Ncg31cBCLL",
"type": "eticket",
"credit_amount": "90.80",
"credit_code": "1234567890123",
"credit_currency": "GBP",
"credit_name": "Duffel Travel Credit"
}
],
"confirmed_at": "2020-01-17T11:51:43.114803Z",
"created_at": "2020-04-11T15:48:11.642Z",
"expires_at": "2020-01-17T10:42:14Z",
"id": "ore_00009qzZWzjDipIkqpaUAj",
"live_mode": false,
"order_id": "xxx_00009hthhsUZ8W4LxQgkjo",
"refund_amount": "90.80",
"refund_currency": "GBP",
"refund_to": "arc_bsp_cash"
},
"meta": {
"limit": 123,
"before": "<string>",
"after": "<string>"
}
}