POST/v1/transfers/pricing

Price a transfer

Confirm the final price of a selected offer and receive the token required to book it.

Share
POST/v1/transfers/pricing

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.

Request body

cURL request

cURL
bash
curl -X POST 'https://api.sandbox.travelandz.com/v1/transfers/pricing' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY' \
  -H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE' \
  -H 'Content-Type: application/json' \
  -d '{"gdsprovider":0,"bookingToken":"opaque_offer_token_generated_by_travelandz","searchId":"73a5670b476649a985f0535db1077c05","resultId":"fe94b51ccd0623a9f1adabfbe0614d34","selectedAmenities":["baby_seats","child_booster"],"currency":"USD"}'

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.

Confirm the final price of a selected offer and receive the token required to book it.

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

Send gdsprovider, the bookingToken of the selected offer, and its matching searchId and resultId. Add selectedAmenities with the amenity keys the traveller chose. If you send currency it must match the currency of the search; omit it to inherit it.

Request Body Schema

gdsprovider
enum
0
Yes
Transfer content selector. Currently 0.
bookingToken
stringYes
Copy the bookingToken of the selected offer.
searchId
stringYes
Must be the searchId of the selected offer.
resultId
stringYes
Must be the resultId of the selected offer.
selectedAmenities
arrayYes
selectedAmenities[]
string[]No
When sent, needs at least one unique, non-empty key available in the offer.
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.

Request example

Without amenities

json
json
{
  "gdsprovider": 0,
  "bookingToken": "opaque_offer_token_generated_by_travelandz",
  "searchId": "73a5670b476649a985f0535db1077c05",
  "resultId": "fe94b51ccd0623a9f1adabfbe0614d34",
  "currency": "USD"
}

With amenities

json
json
{
  "gdsprovider": 0,
  "bookingToken": "opaque_offer_token_generated_by_travelandz",
  "searchId": "73a5670b476649a985f0535db1077c05",
  "resultId": "fe94b51ccd0623a9f1adabfbe0614d34",
  "selectedAmenities": [
    "baby_seats",
    "child_booster"
  ],
  "currency": "USD"
}

Success response

Returns finalPrice, the normalized amenity selection, and an opaque pricingToken.

finalPrice.amount is the amount to charge the traveller. Never rebuild a price from the search response or from amenity data.

Response Body Schema

finalPrice
objectYes
finalPriceamount
numberYes
Amount to charge, rounded to two decimals.
finalPricecurrency
enum
EURUSDINRCHFJPYGBPAUDCADCNYSGDNZDMXN
Yes
selectedAmenities
arrayYes
selectedAmenities[]key
stringYes
Value to send in selectedAmenities.
selectedAmenities[]name
stringYes
Localized name.
selectedAmenities[]description
stringNo
selectedAmenities[]imageUrl
string
Format: URL
No
selectedAmenities[]pngImageUrl
string
Format: URL
No
selectedAmenities[]inputType
enum
booleannumeric
No
selectedAmenities[]included
booleanYes
True when the amenity is already part of the offer.
selectedAmenities[]selectable
booleanYes
True when the amenity can be added to this offer.
selectedAmenities[]selected
booleanYes
True when the amenity is part of the priced selection.
pricingToken
stringYes
Opaque value. Send it to booking or to a reservation change; never decode or modify it.

Response examples

json
json
{
  "finalPrice": {
    "amount": 181.97,
    "currency": "USD"
  },
  "selectedAmenities": [
    {
      "key": "baby_seats",
      "name": "Baby seats",
      "description": "Your vehicle will have a child safety seat to keep children under age 4 safe.",
      "imageUrl": "https://api.sandbox.travelandz.com/v1/assets/transfers/images/0/amenities/baby-seats.svg",
      "pngImageUrl": "https://api.sandbox.travelandz.com/v1/assets/transfers/images/0/amenities/baby-seats.png",
      "inputType": "numeric",
      "included": false,
      "selected": true,
      "selectable": true
    },
    {
      "key": "child_booster",
      "name": "Child booster",
      "description": "Your vehicle will have a child booster seat to keep children from age 4-8 safe.",
      "imageUrl": "https://api.sandbox.travelandz.com/v1/assets/transfers/images/0/amenities/child-booster.svg",
      "pngImageUrl": "https://api.sandbox.travelandz.com/v1/assets/transfers/images/0/amenities/child-booster.png",
      "inputType": "numeric",
      "included": false,
      "selected": true,
      "selectable": true
    }
  ],
  "pricingToken": "opaque_public_pricing_token_generated_by_travelandz"
}

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_invalid_booking_tokenThe booking token has expired, was modified, or does not belong to this offer.Search again and use the token of the newly selected offer.
400transfer_invalid_amenitiesThe amenity keys are duplicated, empty, or unavailable for this offer.Send unique keys taken from the offer or from the amenity catalog.
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

Pricing is required before every booking and before confirming every reservation change, even when no amenities are selected.

The pricingToken is opaque and belongs to the offer it was created for. Copy it into the next call without decoding or modifying it, and request pricing again if the offer expires.

cURL example

bash
bash
curl --request POST \
  --url "https://api.sandbox.travelandz.com/v1/transfers/pricing" \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
  -H "Content-Type: application/json" \
  --data '{
  "gdsprovider": 0,
  "bookingToken": "opaque_offer_token_generated_by_travelandz",
  "searchId": "73a5670b476649a985f0535db1077c05",
  "resultId": "fe94b51ccd0623a9f1adabfbe0614d34",
  "selectedAmenities": [
    "baby_seats",
    "child_booster"
  ],
  "currency": "USD"
}'