Availability Rules is a way to setup Availability Overrides for specific Room Types and Channels. This feature can be useful if you would like to close out some specific channel, decrease Availability or set Max Availability for it.
Example of use cases:
Stop sales for Christmas vacation at Channel A
Set Max Availability for Room Type A at Channel B
Get List of Availabilty Rules
Retrieve a list of Availability Rules associated with user Properties.
Request:
GET https://staging.channex.io/api/v1/channel_availability_rules?filter[property_id]={PROPERTY_ID}
By default, this method returns the first 10 elements. To get more details, you should use arguments.
Information about count of entities and current pagination position contained at meta section at response object.
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a list of Room Type objects in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong API key provided.
Get Availability Rule by ID
Retrieve specific Availability Rule by ID.
Request:
GET https://staging.channex.io/api/v1/channel_availability_rules/:id
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Availability Rules object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided or User not have access to requested Availability Rule.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if Availability Rule with provided ID is not present at system.
Create Availability Rule
Create a new Availability Rule.
Request:
POST https://staging.channex.io/api/v1/channel_availability_rules
String with a valid UUID of the Property to associate with the created Availability Rule.
affected_channels [required]
List of valid UUID of Channels which should be affected.
affected_room_types [required]
List of valid UUID of Room Types which should be affected.
type [required]
Enumerable. Possible values:
close_out
availability_offset
max_availability
value
Integer. Required ONLY if type set to availability_offset or max_availability.
If type equal to availability_offset, value will be extracted from current Room Type availability. As result, OTA Availability for selected room type will be calculated as:
Room Availability - Value = OTA Availabiltiy
If type equal to max_availability, value will be used as max possible value for OTA Availability.
start_date [required]
Date. Should be provided as ISO 8601 format YYYY-MM-DD.
end_date
Optional. Date. Should be provided as ISO 8601 format YYYY-MM-DD. If it is empty, Availability Rule will have affect to all dates after start_date.
days
Optional. List of day of weeks what should be affected. Supported values: "mo", "tu", "we", "th", "fr", "sa", "su".
This field allow to setup Rule which will be applicable for every Sunday or Monday. By default it is empty and applicable for each day.
Returns
Success
Method can return a Success result with 201 Created HTTP Code if operation is successful. Will contain a Availability Rule object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong API Key provided.
Validation Error
Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.
Update Availability Rule
Update a Room Type.
Request:
PUT https://staging.channex.io/api/v1/channel_availability_rules/:id
This method use same fields as Create Availability Rule method.
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Availability Rule object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong API Key provided.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if API Key with provided ID is not present at system.
Validation Error
Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.