DELETE/v1/transfers/reservations/:reservationId

Cancel a transfer reservation

Cancel a reservation and read the refund outcome.

Share
DELETE/v1/transfers/reservations/:reservationId

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

1 field

Reservation ID

Reservation identifier returned when the booking was created. On the unified details endpoint, send only one of reservationId, confirmationNumber or searchId.

Query parameters

2 fields

Currency

Currency of the returned amounts. Must match the offer or reservation when one already exists.

Language

Legacy language field. Prefer the LANG or Accept-Language header.

cURL request

cURL
bash
curl -X DELETE 'https://api.sandbox.travelandz.com/v1/transfers/reservations/:reservationId?currency=USD' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY' \
  -H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE'

Add your credentials to send a request.

This request needs identifiers or tokens from an earlier call. Run the previous step first, then paste its values here.

Response

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

Cancel a reservation and read the refund outcome.

Authentication and headers

HeaderDescription
AuthorizationBearer <secret_key>. Keep the secret on the server and never write it to client logs.
X-Travelandz-Id<public_key>:<profile_code>, where the persisted profile code has the form dp_<12 alphanumeric>.
LANGPreferred locale header. Accept-Language is also supported.
Content-Typeapplication/json for requests with a JSON body.

Request

This endpoint takes no body. reservationId goes in the path. If you send currency, it must match the currency the reservation was charged in.

Request Params Schema

reservationId
stringYes
Reservation identifier returned when the booking was created.

Request Query Params Schema

currency
enum
EURUSDINRCHFJPYGBPAUDCADCNYSGDNZDMXN
No
Lowercase values are accepted and normalized. Defaults to USD on a new search and is inherited afterwards.
language
enum
en-USes-ESde-DEfr-FRpt-BRzh-CNit-IT
No
Legacy field. Prefer the LANG or Accept-Language header.

Success response

Returns whether the reservation was cancelled and whether a refund applies. The refund follows the cancellation policy that was shown on the offer.

cancelled: false and refunded: false are valid HTTP 200 outcomes, not errors. Always read both fields instead of relying on the status code.

Response Body Schema

cancelled
booleanYes
False is a valid HTTP 200 outcome.
refunded
booleanYes
False is a valid HTTP 200 outcome.
refundAmount
numberNo
Amount refunded to the traveller.
currency
enum
EURUSDINRCHFJPYGBPAUDCADCNYSGDNZDMXN
No
refundPercent
numberNo

Response examples

json
json
{
  "cancelled": true,
  "refunded": true,
  "refundAmount": 181.97,
  "currency": "USD",
  "refundPercent": 100
}

Errors

HTTPCodeMeaningRecommended action
400The body, query or path is invalid, or contains an unknown property.Fix the request using the message array.
400transfer_invalid_currencyThe currency is outside the supported list.Use a supported currency.
400transfer_invalid_languageThe requested language is not supported.Use one of the documented language values.
429transfer_provider_errorThe service is temporarily rate limited.Retry with exponential backoff.
502transfer_provider_errorThe request could not be completed.Do not assume success. Keep your identifiers and read the reservation when the operation could have been created.
400transfer_currency_mismatchThe currency does not match the offer, the quote or the reservation.Reuse the currency returned by the previous step, or omit the field to inherit it.
503The price could not be confirmed right now.Retry later. Do not book and do not charge the traveller.

Usage notes

When refunded is true, show refundAmount with the currency returned in the same response. Check the cancellation policy on the offer before the traveller books, so the refund outcome is never a surprise.

cURL example

bash
bash
curl --request DELETE \
  --url "https://api.sandbox.travelandz.com/v1/transfers/reservations/f390daff1fdf4cccb19b7abd825dc011?currency=USD" \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"