POST/v1/flights/order/cancel/:gdsprovider/:orderId

Cancel flight order

Requests cancellation of an existing flight order, optionally using a cancellation id from a pending cancellation flow.

Share
POST/v1/flights/order/cancel/:gdsprovider/:orderId

API console

Try it

Send a real request to the sandbox API and inspect the response.

Credentials

Log in to pick from your saved API keys instead of pasting them.

Path parameters

2 fields

GDS provider

Global Distribution System used to source flight content. Select 0 for the default provider.

Order ID

Identifier of the order returned when the booking was created.

Request body

cURL request

cURL
bash
curl -X POST 'https://api.sandbox.travelandz.com/v1/flights/order/cancel/0/:orderId' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY' \
  -H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE' \
  -H 'Content-Type: application/json' \
  -d '{"cancelId":"ore_0000B7awtcMBc20FXigs1Z","renewIfExpired":true}'

Add your credentials to send a request.

Response

Click "Try it!" to send a request and see the response here.

Requests cancellation of an existing flight order, optionally using a cancellation id from a pending cancellation flow.

Endpoint

MethodPathAuth
POST/v1/flights/order/cancel/:gdsprovider/:orderIdRequired API key
Required headers:
HeaderDescription
AuthorizationBearer <secret_key>. The secret is shown only once when the credential is created.
X-Travelandz-Id<public_key>:<profile_code>. The profile_code is the dp_-prefixed Developer Profile code shown in your dashboard. This binds the request to a profile and credential.
Content-TypeUse application/json for requests with a body.

Request Params Schema

gdsprovider
numberYes
orderId
stringYes

Request Body Schema

cancelId
stringNo
renewIfExpired
booleanNo
When cancelId is expired, set to true to create and confirm a new pending cancellation automatically.

Success Response

Returns the final public cancellation confirmation. Duffel responses include cancellation id, refund summary, confirmation date and liveMode.

Response Body Schema

message
stringYes
orderId
stringYes
cancellationId
stringNo
Present for Duffel public cancellations. Omitted in direct provider flows that do not expose a pending cancellation id.
refund
objectYes
refundto
stringYes
refundamount
stringYes
refundcurrency
stringYes
confirmedAt
string
Format: ISO 8601
No
Present for Duffel public cancellations after confirmation.
liveMode
booleanYes
True when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.

Operational Notes

  • cancelId is optional. When provided for Duffel, Travelandz fetches and validates that cancellation before confirming it.
  • If the supplied cancelId does not belong to the provided orderId, the API returns 400.
  • If the supplied cancelId is expired and renewIfExpired is not true, the API returns 400.
  • If the supplied cancelId is expired and renewIfExpired=true, Travelandz creates a new pending cancellation, persists it internally and confirms the new cancellation instead.
  • If cancelId is omitted for Duffel, Travelandz creates, persists and confirms a new pending cancellation automatically.
  • Direct cancellation can fail when the booking is already ticketing or no longer cancellable.

Example

bash
bash
curl -X POST https://api.sandbox.travelandz.com/v1/flights/order/cancel/0/order_123 \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
  -H "Content-Type: application/json" \
  -d '{"cancelId":"ore_123","renewIfExpired":true}'

Request Body - Example Value

json
json
{
  "cancelId": "ore_0000B7awtcMBc20FXigs1Z",
  "renewIfExpired": true
}

Responses

CodeDescription
200Flight order canceled successfully.
400Bad request – invalid payload.
401Unauthorized – invalid or missing credentials.
403Forbidden – invalid credentials.
500Internal server error

200 Response Body

Media type: application/json

json
json
{
  "message": "Order canceled successfully",
  "orderId": "ord_0000B7aw6DtypHDaOdA5hV",
  "cancellationId": "ore_0000B7awtcMBc20FXigs1Z",
  "refund": {
    "to": "balance",
    "amount": "221.89",
    "currency": "EUR"
  },
  "confirmedAt": "2026-06-22T15:50:48.458Z",
  "liveMode": false
}