Skip to content

Room Selection Rules

Room selection logic comes into existence when end users perform a search for two or more than two rooms. If a user performs a search for two rooms then GetHotelRooms response will return room options for each requested room and it can be identified based on roomIndex attribute. There can be multiple rooms available in GetHotelRooms response, and it can be grouped according to roomIndex number for each room for a hotel. Here, each roomIndex group can have multiple room options. Users have to select a room option from each roomIndex group to form a room combination for booking. However, users can’t be able to select any room option freely from the roomIndex group. There are some restrictions on room selection based on third party supplier restriction.

Please refer below tag(s) which play a key role for selecting room options for multiple room booking

  • roomSelectRules
  • roomId
  • ruleInfo
  • fixedCombinations
  • roomCombinations

These room options can be selected for booking based on specified combinations returned to the Get More Rooms response. There are 2 types of room selection combinations provided in the API, and it can be identified based on fixedCombinations value.

  1. Fixed combination(fixedCombinations="true") - In fixed combination, room combinations are provided in GetHotelRoom response under roomCombinations tag.
  2. Flexible combination(fixedCombinations="false") - In a flexible combination, you can select any combination of rooms you want. However, ruleInfo attribute from the Room tag must be the same for the selected rooms option.

For both combinations, ruleInfo value must be the same for the selected rooms.

Room selection rules are provided in the RoomSelectRules tag. Rule tag contains the room selection rule. If the Rule contains value “==” then all selected rooms must have the same ruleInfo value which is provided in the room tag.

Please see diagram below:

Figure1

Rules for room selection

Fixed combination room selection rules (fixedCombo="true")

  1. If a user select / chooses a room whose fixedCombo value is true and roomId is present in the room combination (roomCombination tag) then all other rooms must be selected from roomCombination which has selected roomId. Refer below fixed combination example.
  2. All selected rooms ruleInfo(attribute given in Room tag e.g ruleInfo="76")

Flexible combination room selection rules (fixedCombo="false")

  1. If a user select / chooses a room whose fixedCombo value is false then any combination of rooms can be selected but all rooms fixedCombo values must be false.
  2. All selected rooms ruleInfo must be the same.(attribute given in Room tag e.g - ruleInfo="76")

Fixed combination example

If we search for 2 rooms then you may receive room combinations in GetHotelRoom response under roomCombinations tag. please refer below Json structure of room combinations provided. For successful booking you need to select the rooms according to the combination provided. Each roomCombination tag is a combination for rooms we can select for booking. roomCombination contains comma "," separate roomId attribute of room tag(Refer Room Details Json structure for attribute roomId). Below roomCombination Json structure is for 2 Room search.

Please refer to the Json structure for reference.

If a user chooses the first room(room index 1 / Room 1) whose value for fixedCombo is true and roomId is "38_1" which is present in one of the roomCombination then the next room (room index 2 / Room 2 ) must be selected from the combination given in GetHotelRoom response.In this case room 2 must be selected as room whose roomId is "38_4”.

Because [38_1,38_4] is the given combination for room selection.Then selected room roomKey must be provided in the preBook service for booking purposes.

Note - If you select rooms roomId does not matched with the combination provided in GetHotelRoom service then you will get error as "Error wrong room combination selected"

Room combinations Json structure -

      "roomCombinations": [
        [
          "38_1",
          "38_4"
        ],
        [
          "48_1",
          "48_4"
        ],
        [
          "58_1",
          "58_4"
        ]
      ]