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-cancellations/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"order_id": "ord_001"
}
}'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": {
"confirmed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"id": "ore_0000BAzrZ6yBtPriPLcjeX",
"order_id": "<string>",
"refund_amount": "<string>",
"refund_currency": "<string>",
"refund_to": "<string>"
}
}{
"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": {
"after": "<string>",
"before": "<string>",
"limit": 123
}
}Changes & Cancellations
Create Order Cancellation
Fetch the refund quote for an order. refund_amount may be 0.00 (non-refundable) or null (not quoted).
POST
https://api.aisa.one
/
apis
/
v1
/
duffel
/
flights
/
order-cancellations
/
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-cancellations/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"order_id": "ord_001"
}
}'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": {
"confirmed_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"id": "ore_0000BAzrZ6yBtPriPLcjeX",
"order_id": "<string>",
"refund_amount": "<string>",
"refund_currency": "<string>",
"refund_to": "<string>"
}
}{
"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": {
"after": "<string>",
"before": "<string>",
"limit": 123
}
}Request contract
- Method and path: POST /apis/v1/duffel/flights/order-cancellations/create
- Availability: enabled
- Request URL template: https://api.aisa.one/apis/v1/duffel/flights/order-cancellations/create
- Runtime facts: d0ae990bcd8ea1a75abd7e4a4e47260a24ab01e5c2b9d2fcc0366eae9f069f96
{
"operationId": "post_duffel_order_cancellations_create",
"method": "POST",
"path": "/apis/v1/duffel/flights/order-cancellations/create",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"properties": {
"order_id": {
"description": "Duffel's unique identifier for the order",
"example": "ord_001",
"type": "string"
}
},
"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