POST/v1/hotels/book

Book hotel

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

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 Body Schema

PropertyTypeDetailsRequiredNotes
gdsprovidernumberYes-
hotelCodestringYes-
holderobjectYes-
holdername
stringYes-
holderlastName
stringYes-
holderemail
stringYes-
holderlanguage
stringNo-
holderphone
stringNo-
roomsarrayYes-
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
numberNoMinimum of the 25% of the original price of the booking
rooms[]priceRangeMaximum
numberNoMaximum 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-
searchBodyobjectYes-
searchBodylanguage
enum
eneszh
NoDefault 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
numberYesMinimum value: 1, Maximum value: 4
searchBodyrooms[]children
numberNoMinimum value: 0, Maximum value: 4
searchBodyrooms[]childrenAges
arrayYes-
searchBodyrooms[]childrenAges[]
number[]Yes-
searchBodycurrency
enum
EURUSDCNY
NoDefault EUR
checkInstring
Format: YYYY-MM-DD
Yes-
checkOutstring
Format: YYYY-MM-DD
Yes-

Success Response

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

Response Body Schema

PropertyTypeDetailsRequiredNotes
bookingReferencestringYes-
clientReferencestringYes-

Errors

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