Last updated

Rooms API validation rules

The Rooms API create and update requests are subject to validation against a set of rules listed below.

Generic validation rules

Validation rules in the table below apply to any unit created or updated using Rooms API.

Validation ruleRelated fieldsError description if violated
Unit type ID provided must exist in meta and be activeconfiguration.unit_type_idUnit type is inactive or does not exist
Unit type must be allowed for a propertyconfiguration.unit_type_idUnit type not allowed for selected property type
Unit name ID provided must exist in metaunit_name_idUnit name does not exist
Smoking policy is one of SMOKING, NONSMOKING, SMOKING_AND_NONSMOKINGsmoking_policy
Number of units must be between 0 and 32000number_of_unitsNumber of units is invalid
Size value must be between 0 and 9999.99size.valueSize value must be between 0 and 9999.99
Size unit must be of type SQM or SQFTsize.unit
At least one bed should be added to each bed configuration provided in the requestconfiguration.rooms[*].bed_configurationsAt least 1 bed should be added to each bed configuration
Bed type IDs provided in the request must exist in meta and be activeconfiguration.rooms[*].bed_configurations[*].beds[*].bed_type_idBed type is inactive or does not exist
Bed types IDs should not be repeated within a single bed configurationconfiguration.rooms[*].bed_configurations[*].beds[*].bed_type_idBed types should not be repeated within a single bed configuration
Exactly one default bed configuration is mandatory for each room providedconfiguration.rooms[*].bed_configurations[*].is_default_configurationExactly 1 default bed configuration is mandatory
Number of beds must be between 1 and 255configuration.rooms[*].bed_configurations[*].beds[*].bed_countNumber of beds must be between 1 and 255
Maximum overall number of guests is between 1 and 50occupancy.max_guests
Maximum number of adults is between 1 and 50occupancy.max_adults
Maximum number of children is between 1 and 49occupancy.max_children
Maximum number of adults cannot exceed the maximum number of guestsoccupancy.max_guests, occupancy.max_adultsMaximum number of guests must be greater than or equal to number of adults and less than or equal to sum of adults and children
Maximum number of children must be less than maximum number of guestsoccupancy.max_guests, occupancy.max_childrenNumber of children must be less than maximum number of guests
Maximum number of guests cannot exceed the maximum number of adults and children combinedoccupancy.max_guests, occupancy.max_adults, occupancy.max_childrenMaximum number of guests must be greater than or equal to number of adults and less than or equal to sum of adults and children
Maximum number of extra beds provided must be between 0 and 100extra_beds_configuration.extra_beds
Maximum number of cribs provided must be between 0 and 100extra_beds_configuration.cribs

Validation rules specific for multi-room units

A multi-room unit is any unit which type has is_multi_room = false flag in meta.

Validation rules in the table below apply to multi-room units only.

Validation ruleRelated fieldsError description if violated
Room types provided must be of types BEDROOM_SUBROOM or LIVING_ROOM_SUBROOMconfiguration.rooms[*].typeRoom type is not allowed for selected (multi-room) unit type
At least one bedroom must be providedconfiguration.roomsAt least 1 room of type BEDROOM_SUBROOM is mandatory for selected (multi-room) unit type
Number of bedrooms must be between 1 and 20configuration.roomsNumber of BEDROOM_SUBROOM rooms must be between 1 and 20
Number of living rooms must be between 1 and 5configuration.roomsNumber of LIVING_ROOM_SUBROOM rooms must be between 1 and 5
Valid number of bed confgiurations is provided: exactly one for BEDROOM_SUBROOM, not more than one for LIVING_ROOM_SUBROOMconfiguration.rooms[*].bed_configurationsRoom type BEDROOM_SUBROOM must have exactly 1 bed configuration; room type LIVING_ROOM_SUBROOM can not have more than 1 bed configuration

Validation rules specific for mono-room units

A mono-room unit is any unit which type has is_multi_room = false flag in meta.

Validation rules in the table below apply to mono-room units only.

Validation ruleRelated fieldsError description if violated
Room type provided must be of type GUEST_ROOMconfiguration.rooms[*].typeRoom type is not allowed for selected (mono-room) unit type
Exactly one room of type GUEST_ROOM must be providedconfiguration.roomsSelected (mono-room) room unit type must have exactly 1 room of type GUEST_ROOM
At least one bed configuration is providedconfiguration.rooms[*].bed_configurationsRoom type GUEST_ROOM must have at least 1 bed configuration

Rules and validations specific for certain unit types

Validation rules in the table below apply only to specific unit types such as Single, Dormitory Room and Bed in Dormitory.

Validation ruleRelated fieldsError description if violated
For unit type 10 (Single) maximum number of adults must be exactly 1configuration.unit_type_id, occupancy.max_adult_occupancyMaximum number of adults must be exactly 1 for selected unit type
For unit type ID 25 (Dormitory Room) maximum number of adults must be 2 or moreconfiguration.unit_type_id, occupancy.max_adult_occupancyMaximum number of adults must be 2 or more for selected unit type
For unit type ID 25 (Dormitory Room) at least two beds must be added to each bed configurationconfiguration.rooms[*].bed_configurations[*].bedsAt least 2 beds must be added to each bed configuration for selected unit type
For unit type ID 26 (Bed in Dormitory) exactly one bed configuration must be providedconfiguration.rooms[*].bed_configurationsExactly 1 bed configuration must be provided for selected unit type
For unit type ID 26 (Bed in Dormitory) exactly one bed must be added to bed configurationconfiguration.rooms[*].bed_configurations[*].bedsExactly 1 bed must be added to bed configuration for selected unit type

Non-blocking rules and validations

Validation rules in the table below apply to any unit created or updated using Rooms API, however the violation is automatically adjusted in our system. Instead of

Validation ruleRelated fieldsWarning description if violated
Child policy must be enabled on a property level before allowing children in the unitoccupancy.max_childrenChild policy was enabled for a property after passing children occupancy
Number of children eligible for the children rate must be less than or equal to number of childrenmax_children_that_pay_children_rateNumber of children paying the child rate cannot exceed the number of children allowed in the room. Its value was adjusted to match the number of children allowed.