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 Parameters
No path or query params are required.
Request Body Schema
gdsproviderhotelCodeholderholdernameholderlastNameholderemailholderlanguageholderphoneroomsrooms[]rateKeyrooms[]roomNamerooms[]roomBoardrooms[]cancellationPoliciesrooms[]cancellationPolicies[]amountrooms[]cancellationPolicies[]fromDaterooms[]ratePricerooms[]priceRangeCurrencyrooms[]priceRangeMinimumMinimum of the 25% of the original price of the booking
rooms[]priceRangeMaximumMaximum of the 100% of the original price of the booking.
rooms[]passengersrooms[]passengers[]roomIdrooms[]passengers[]titlerooms[]passengers[]typerooms[]passengers[]namerooms[]passengers[]lastNamerooms[]passengers[]nationalityrooms[]passengers[]agerooms[]passengers[]genderrooms[]checkInrooms[]checkOutsearchBodysearchBodylanguageDefault en
searchBodygdsprovidersearchBodyhotelCodesearchBodycheckInsearchBodycheckOutsearchBodycountryCodesearchBodyguestNationalitysearchBodyminRatePricesearchBodymaxRatePricesearchBodyroomssearchBodyrooms[]adultsMinimum value: 1, Maximum value: 4
searchBodyrooms[]childrenMinimum value: 0, Maximum value: 4
searchBodyrooms[]childrenAgessearchBodyrooms[]childrenAges[]searchBodycurrencyDefault EUR
checkIncheckOutSuccess Response
Returns booking reference, status, provider response and confirmation details when available.
Response Body Schema
bookingReferenceclientReferenceliveModeTrue when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.
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. |
Example
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>'