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
| Method | Path | Auth |
|---|---|---|
POST | /v1/hotels/book | Required API key |
| Header | Description |
|---|---|
Authorization | Bearer <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-Type | Use application/json for requests with a body. |
Request Body Schema
| Property | Type | Details | Required | Notes |
|---|---|---|---|---|
gdsprovider | number | Yes | - | |
hotelCode | string | Yes | - | |
holder | object | Yes | - | |
holdername | string | Yes | - | |
holderlastName | string | Yes | - | |
holderemail | string | Yes | - | |
holderlanguage | string | No | - | |
holderphone | string | No | - | |
rooms | array | Yes | - | |
rooms[]rateKey | string | Yes | - | |
rooms[]roomName | string | Yes | - | |
rooms[]roomBoard | string | Yes | - | |
rooms[]cancellationPolicies | array | Yes | - | |
rooms[]cancellationPolicies[]amount | number | Yes | - | |
rooms[]cancellationPolicies[]fromDate | string | Format: ISO 8601 | Yes | - |
rooms[]ratePrice | number | Yes | - | |
rooms[]priceRangeCurrency | enum | EURUSDCNY | No | - |
rooms[]priceRangeMinimum | number | No | Minimum of the 25% of the original price of the booking | |
rooms[]priceRangeMaximum | number | No | Maximum of the 100% of the original price of the booking. | |
rooms[]passengers | array | Yes | - | |
rooms[]passengers[]roomId | number | Yes | - | |
rooms[]passengers[]title | enum | mrmsmrsmiss | Yes | - |
rooms[]passengers[]type | enum | adultchild | Yes | - |
rooms[]passengers[]name | string | Yes | - | |
rooms[]passengers[]lastName | string | Yes | - | |
rooms[]passengers[]nationality | string | Format: 2 digits | Yes | - |
rooms[]passengers[]age | number | No | - | |
rooms[]passengers[]gender | enum | fm | No | - |
rooms[]checkIn | string | Format: YYYY-MM-DD | Yes | - |
rooms[]checkOut | string | Format: YYYY-MM-DD | Yes | - |
searchBody | object | Yes | - | |
searchBodylanguage | enum | eneszh | No | Default en |
searchBodygdsprovider | number | Yes | - | |
searchBodyhotelCode | string | Yes | - | |
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 | number | No | - | |
searchBodymaxRatePrice | number | No | - | |
searchBodyrooms | array | Yes | - | |
searchBodyrooms[]adults | number | Yes | Minimum value: 1, Maximum value: 4 | |
searchBodyrooms[]children | number | No | Minimum value: 0, Maximum value: 4 | |
searchBodyrooms[]childrenAges | array | Yes | - | |
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
| Property | Type | Details | Required | Notes |
|---|---|---|---|---|
bookingReference | string | Yes | - | |
clientReference | string | Yes | - |
Errors
| Status | Code | Case |
|---|---|---|
400 | unable_to_execute_booking | Provider could not execute the booking. |
400 | - | Invalid payload or provider error. |
401/403 | auth codes | Invalid credentials. |
500 | - | Internal error. |