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 -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
| Header | Description |
|---|---|
Authorization | Bearer <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>. |
LANG | Preferred locale header. Accept-Language is also supported. |
Content-Type | application/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
gdsprovider0.bookingTokenbookingToken of the selected offer.searchIdsearchId of the selected offer.resultIdresultId of the selected offer.selectedAmenitiesselectedAmenities[]currencyUSD on a new search and is inherited afterwards.languageLANG or Accept-Language header.Request example
Without amenities
{
"gdsprovider": 0,
"bookingToken": "opaque_offer_token_generated_by_travelandz",
"searchId": "73a5670b476649a985f0535db1077c05",
"resultId": "fe94b51ccd0623a9f1adabfbe0614d34",
"currency": "USD"
}With amenities
{
"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
finalPricefinalPriceamountfinalPricecurrencyselectedAmenitiesselectedAmenities[]keyselectedAmenities.selectedAmenities[]nameselectedAmenities[]descriptionselectedAmenities[]imageUrlselectedAmenities[]pngImageUrlselectedAmenities[]inputTypeselectedAmenities[]includedselectedAmenities[]selectableselectedAmenities[]selectedpricingTokenResponse examples
{
"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
| HTTP | Code | Meaning | Recommended action |
|---|---|---|---|
400 | The body, query or path is invalid, or contains an unknown property. | Fix the request using the message array. | |
400 | transfer_invalid_currency | The currency is outside the supported list. | Use a supported currency. |
400 | transfer_invalid_language | The requested language is not supported. | Use one of the documented language values. |
429 | transfer_provider_error | The service is temporarily rate limited. | Retry with exponential backoff. |
502 | transfer_provider_error | The request could not be completed. | Do not assume success. Keep your identifiers and read the reservation when the operation could have been created. |
400 | transfer_invalid_booking_token | The booking token has expired, was modified, or does not belong to this offer. | Search again and use the token of the newly selected offer. |
400 | transfer_invalid_amenities | The amenity keys are duplicated, empty, or unavailable for this offer. | Send unique keys taken from the offer or from the amenity catalog. |
400 | transfer_currency_mismatch | The 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. |
503 | The 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
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"
}'