The examples reuse the OAuth 1.0 signing from the Quick start. Replace
{sessionId} with your session.Move the guests across rooms
When the party does not fit in a single room, the room search can split it across rooms (for example 4 adults as 2 + 2). AddAlternativeGuests to X-AVP-Properties on GET /v2/{sessionId}/search/rooms:
AvailabilityWithAlternativeGuests, with one allocation entry per room. Only one split is returned:
Extend or reduce the stay
When a rate is blocked by a minimum or maximum stay, the room search can return it at a length that works. AddFetchExtendedStay (minimum-stay) or FetchReducedStay (maximum-stay) to X-AVP-Properties:
availabilityType on the room, and an availabilityInfo on the rate giving the required nights:
FetchReducedStay mirrors this with availabilityType: "ReducedStay" and reason: "MaxStay". On a rate blocked by a minimum stay, FetchExtendedStay takes precedence over AlternativeGuests.
Search the group’s other hotels
This path applies when the hotel belongs to a group (a multi-hotel booking engine). It picks up where the chosen hotel ran out, in two steps.- The chosen hotel is full. The room search at the selected hotel returns no availability.
- Open the search to the group. Set
selectedHotelIdtonullin the session context, centre aLocalisationfilter on the hotel’s area, then search the hotels nearby.
PATCH /v2/{sessionId}/session/filters/hotels, passing the latitude, longitude, and a radius in metres:
location.distance: order the results by that value in your interface to lead with the closest one.
Tips
- Ask for alternatives explicitly. The room search returns them only when you set the values on
X-AVP-Properties, and you can combine several in one call. - Know why it failed. Add
DetailedUnavailabilityTypeto see whether the block is on the room, the rate, both, or the guests, then pick the matching alternative. - Start at the same hotel. A room split or a shifted stay is a smaller change than a new hotel, so it converts better. Keep the nearby hotel as a fallback.
Related
Search rooms
Room search, alternative occupancies, and availability hints.
Filter hotels
Set the Localisation, Budget, Rating, and Amenities filters.