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 rule | Related fields | Error description if violated |
---|---|---|
Unit type ID provided must exist in meta and be active | configuration.unit_type_id | Unit type is inactive or does not exist |
Unit type must be allowed for a property | configuration.unit_type_id | Unit type not allowed for selected property type |
Unit name ID provided must exist in meta | unit_name_id | Unit name does not exist |
Smoking policy is one of SMOKING , NONSMOKING , SMOKING_AND_NONSMOKING | smoking_policy | |
Number of units must be between 0 and 32000 | number_of_units | Number of units is invalid |
Size value must be between 0 and 9999.99 | size.value | Size value must be between 0 and 9999.99 |
Size unit must be of type SQM or SQFT | size.unit | |
At least one bed should be added to each bed configuration provided in the request | configuration.rooms[*].bed_configurations | At least 1 bed should be added to each bed configuration |
Bed type IDs provided in the request must exist in meta and be active | configuration.rooms[*].bed_configurations[*].beds[*].bed_type_id | Bed type is inactive or does not exist |
Bed types IDs should not be repeated within a single bed configuration | configuration.rooms[*].bed_configurations[*].beds[*].bed_type_id | Bed types should not be repeated within a single bed configuration |
Exactly one default bed configuration is mandatory for each room provided | configuration.rooms[*].bed_configurations[*].is_default_configuration | Exactly 1 default bed configuration is mandatory |
Number of beds must be between 1 and 255 | configuration.rooms[*].bed_configurations[*].beds[*].bed_count | Number of beds must be between 1 and 255 |
Maximum overall number of guests is between 1 and 50 | occupancy.max_guests | |
Maximum number of adults is between 1 and 50 | occupancy.max_adults | |
Maximum number of children is between 1 and 49 | occupancy.max_children | |
Maximum number of adults cannot exceed the maximum number of guests | occupancy.max_guests , occupancy.max_adults | Maximum 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 guests | occupancy.max_guests , occupancy.max_children | Number of children must be less than maximum number of guests |
Maximum number of guests cannot exceed the maximum number of adults and children combined | occupancy.max_guests , occupancy.max_adults , occupancy.max_children | Maximum 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 100 | extra_beds_configuration.extra_beds | |
Maximum number of cribs provided must be between 0 and 100 | extra_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 rule | Related fields | Error description if violated |
---|---|---|
Room types provided must be of types BEDROOM_SUBROOM or LIVING_ROOM_SUBROOM | configuration.rooms[*].type | Room type is not allowed for selected (multi-room) unit type |
At least one bedroom must be provided | configuration.rooms | At least 1 room of type BEDROOM_SUBROOM is mandatory for selected (multi-room) unit type |
Number of bedrooms must be between 1 and 20 | configuration.rooms | Number of BEDROOM_SUBROOM rooms must be between 1 and 20 |
Number of living rooms must be between 1 and 5 | configuration.rooms | Number 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_SUBROOM | configuration.rooms[*].bed_configurations | Room 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 rule | Related fields | Error description if violated |
---|---|---|
Room type provided must be of type GUEST_ROOM | configuration.rooms[*].type | Room type is not allowed for selected (mono-room) unit type |
Exactly one room of type GUEST_ROOM must be provided | configuration.rooms | Selected (mono-room) room unit type must have exactly 1 room of type GUEST_ROOM |
At least one bed configuration is provided | configuration.rooms[*].bed_configurations | Room 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 rule | Related fields | Error description if violated |
---|---|---|
For unit type 10 (Single ) maximum number of adults must be exactly 1 | configuration.unit_type_id ,occupancy.max_adult_occupancy | Maximum 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 more | configuration.unit_type_id , occupancy.max_adult_occupancy | Maximum 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 configuration | configuration.rooms[*].bed_configurations[*].beds | At 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 provided | configuration.rooms[*].bed_configurations | Exactly 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 configuration | configuration.rooms[*].bed_configurations[*].beds | Exactly 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 rule | Related fields | Warning description if violated |
---|---|---|
Child policy must be enabled on a property level before allowing children in the unit | occupancy.max_children | Child 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 children | max_children_that_pay_children_rate | Number 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. |