POST/v1/hotels/book

Book hotel

Creates a hotel booking for selected rooms using holder, guest, rate and stay data.

Share

Creates a hotel booking for selected rooms using holder, guest, rate and stay data.

Endpoint

MethodPathAuth
POST/v1/hotels/bookRequired 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 Parameters

No path or query params are required.

Request Body Schema

gdsprovider
numberYes
hotelCode
stringYes
holder
objectYes
holdername
stringYes
holderlastName
stringYes
holderemail
stringYes
holderlanguage
stringNo
holderphone
stringNo
rooms
arrayYes
rooms[]rateKey
stringYes
rooms[]roomName
stringYes
rooms[]roomBoard
stringYes
rooms[]cancellationPolicies
arrayYes
rooms[]cancellationPolicies[]amount
numberYes
rooms[]cancellationPolicies[]fromDate
string
Format: ISO 8601
Yes
rooms[]ratePrice
numberYes
rooms[]priceRangeCurrency
enum
EURUSDCNY
No
rooms[]priceRangeMinimum
numberNo
Minimum of the 25% of the original price of the booking
rooms[]priceRangeMaximum
numberNo
Maximum of the 100% of the original price of the booking.
rooms[]passengers
arrayYes
rooms[]passengers[]roomId
numberYes
rooms[]passengers[]title
enum
mrmsmrsmiss
Yes
rooms[]passengers[]type
enum
adultchild
Yes
rooms[]passengers[]name
stringYes
rooms[]passengers[]lastName
stringYes
rooms[]passengers[]nationality
string
Format: 2 digits
Yes
rooms[]passengers[]age
numberNo
rooms[]passengers[]gender
enum
fm
No
rooms[]checkIn
string
Format: YYYY-MM-DD
Yes
rooms[]checkOut
string
Format: YYYY-MM-DD
Yes
searchBody
objectYes
searchBodylanguage
enum
eneszh
No
Default en
searchBodygdsprovider
numberYes
searchBodyhotelCode
stringYes
searchBodycheckIn
string
Format: YYYY-MM-DD
Yes
searchBodycheckOut
string
Format: YYYY-MM-DD
Yes
searchBodycountryCode
string
Format: 2 digits
Yes
searchBodyguestNationality
string
Format: 2 digits
Yes
searchBodyminRatePrice
numberNo
searchBodymaxRatePrice
numberNo
searchBodyrooms
arrayYes
searchBodyrooms[]adults
numberYes
Minimum value: 1, Maximum value: 4
searchBodyrooms[]children
numberNo
Minimum value: 0, Maximum value: 4
searchBodyrooms[]childrenAges
arrayYes
searchBodyrooms[]childrenAges[]
number[]Yes
searchBodycurrency
enum
EURUSDCNY
No
Default EUR
checkIn
string
Format: YYYY-MM-DD
Yes
checkOut
string
Format: YYYY-MM-DD
Yes

Success Response

Returns booking reference, status, provider response and confirmation details when available.

Response Body Schema

bookingReference
stringYes
clientReference
stringYes
liveMode
booleanYes
True when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.

Errors

StatusCodeCase
400unable_to_execute_bookingProvider could not execute the booking.
400-Invalid payload or provider error.
401/403auth codesInvalid credentials.
500-Internal error.

Example

bash
bash
curl -X POST https://api.sandbox.travelandz.com/v1/hotels/book \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
  -H "Content-Type: application/json" \
  -d '<request_body_json>'