POST/v1/hotels/book
Reservar hotel
Crea una reserva de hotel para habitaciones seleccionadas usando datos del titular, huéspedes, tarifas y estadía.
Crea una reserva de hotel para habitaciones seleccionadas usando datos del titular, huéspedes, tarifas y estadía.
Endpoint
| Método | Ruta | Auth |
|---|---|---|
POST | /v1/hotels/book | API key requerida |
| Header | Descripción |
|---|---|
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. |
Esquema del cuerpo de la petición
| Propiedad | Tipo | Detalles | Requerido | Notas |
|---|---|---|---|---|
gdsprovider | number | Sí | - | |
hotelCode | string | Sí | - | |
holder | object | Sí | - | |
holdername | string | Sí | - | |
holderlastName | string | Sí | - | |
holderemail | string | Sí | - | |
holderlanguage | string | No | - | |
holderphone | string | No | - | |
rooms | array | Sí | - | |
rooms[]rateKey | string | Sí | - | |
rooms[]roomName | string | Sí | - | |
rooms[]roomBoard | string | Sí | - | |
rooms[]cancellationPolicies | array | Sí | - | |
rooms[]cancellationPolicies[]amount | number | Sí | - | |
rooms[]cancellationPolicies[]fromDate | string | Format: ISO 8601 | Sí | - |
rooms[]ratePrice | number | Sí | - | |
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 | Sí | - | |
rooms[]passengers[]roomId | number | Sí | - | |
rooms[]passengers[]title | enum | mrmsmrsmiss | Sí | - |
rooms[]passengers[]type | enum | adultchild | Sí | - |
rooms[]passengers[]name | string | Sí | - | |
rooms[]passengers[]lastName | string | Sí | - | |
rooms[]passengers[]nationality | string | Format: 2 digits | Sí | - |
rooms[]passengers[]age | number | No | - | |
rooms[]passengers[]gender | enum | fm | No | - |
rooms[]checkIn | string | Format: YYYY-MM-DD | Sí | - |
rooms[]checkOut | string | Format: YYYY-MM-DD | Sí | - |
searchBody | object | Sí | - | |
searchBodylanguage | enum | eneszh | No | Default en |
searchBodygdsprovider | number | Sí | - | |
searchBodyhotelCode | string | Sí | - | |
searchBodycheckIn | string | Format: YYYY-MM-DD | Sí | - |
searchBodycheckOut | string | Format: YYYY-MM-DD | Sí | - |
searchBodycountryCode | string | Format: 2 digits | Sí | - |
searchBodyguestNationality | string | Format: 2 digits | Sí | - |
searchBodyminRatePrice | number | No | - | |
searchBodymaxRatePrice | number | No | - | |
searchBodyrooms | array | Sí | - | |
searchBodyrooms[]adults | number | Sí | Minimum value: 1, Maximum value: 4 | |
searchBodyrooms[]children | number | No | Minimum value: 0, Maximum value: 4 | |
searchBodyrooms[]childrenAges | array | Sí | - | |
searchBodyrooms[]childrenAges[] | number[] | Sí | - | |
searchBodycurrency | enum | EURUSDCNY | No | Default EUR |
checkIn | string | Format: YYYY-MM-DD | Sí | - |
checkOut | string | Format: YYYY-MM-DD | Sí | - |
Respuesta exitosa
Devuelve booking reference, status, provider response and confirmation details when available.
Esquema del cuerpo de la respuesta
| Propiedad | Tipo | Detalles | Requerido | Notas |
|---|---|---|---|---|
bookingReference | string | Sí | - | |
clientReference | string | Sí | - |
Errores
| Estado | Código | Caso |
|---|---|---|
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. |