Availability and Rates
API methods to work with Availability and Rates information
Availability and Restriction information is the core data of Channex. This information represents how many rooms your property has to sell and what restrictions you have applied to each rate plan.
NOTE: At Channex availability information is represented at two levels: for Rate Plan and for Room Type. At Rate Plan we provide availability for specific Rate Plan, this value is derived from the Room Type availability. At Room Type we provide the real availability without any changes from modifiers.
Get Availability Or Restrictions Per Rate Plan
Get Availability and Restrictions data from Rate Plans.
Request:
Query requires three get arguments:
date
Specific date or Date range what you would like to load. Date should be provided as ISO 8601 format YYYY-MM-DD
.
Query to get values for specific date:
filter[date]=YYYY-MM-DD
To get values for Date Range:
filter[date][gte]=YYYY-MM-DD&filter[date][lte]=YYYY-MM-DD
restrictions List of comma separated restrictions what you would like to load. Supported values: - availability - rate - min_stay_arrival - min_stay_through - min_stay - closed_to_arrival - closed_to_departure - stop_sell - max_stay - availability_offset (Read Only) - max_availability (Read Only)
property_id ID of associated Property
Returns
Success
Method can return a Success result with 200 OK
HTTP Code if operation is successful. Will contain a Restriction object in the answer.
Bad Request Error
Method can return a Bad Request Error result with 400 Bad Request
HTTP Code if user pass wrong arguments.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized
HTTP Code if wrong Bearer Token provided.
Restriction Object
Restriction Object is valid answer for Get Restrictions method. This object contain information about availability and restrictions. Each key at this object is equal to Rate Plan id. Each Rate Plan ID represented as Object with dates as keys. Each date represented as object where keys is restrictions and values is restriction values for specific date.
Get Availability Per Room Type
Get the Availability per Room Type
Request:
Query requires two get arguments:
date
Specific date or Date range what you would like to load. Date should be provided as ISO 8601 format YYYY-MM-DD
.
Query to get values for specific date:
filter[date]=YYYY-MM-DD
To get values for Date Range:
filter[date][gte]=YYYY-MM-DD&filter[date][lte]=YYYY-MM-DD
property_id ID of associated Property
Returns
Success
Method can return a Success result with 200 OK
HTTP Code if operation was successful. Will contain an Availability object in the answer.
Bad Request Error
Method can return a Bad Request Error result with 400 Bad Request
HTTP Code if the user passes wrong arguments.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized
HTTP Code if wrong Bearer Token provided.
Availability Object
Availability Object is valid answer for Get Availability method. This object contains information about availability per Room Type. Each key at this object is equal to Room Type ID. Each Room Type ID represented as Object with dates as keys. Each date has a value equal to current Availability.
Update Rate & Restrictions
Update Rate & Restrictions for specific Rate Plans and Dates.
Request:
Query body (JSON):
Date Range update query body (JSON):
This method allow update multiple dates from single message.
Fields
Query object should contain values key with list of change objects. Each change object should have the next structure:
property_id [required]
String with valid UUID of Property object.
rate_plan_id [required]
String with valid UUID of Rate Plan object.
date [required]
String with date in ISO 8601 format by mask YYYY-MM-DD
.
Past dates are not allowed.
date_from [required]
if date is not present
String with date in ISO 8601 format by mask YYYY-MM-DD
.
Start of applicable date range.
Past dates are not allowed.
date_to [required]
if date is not present
String with date in ISO 8601 format by mask YYYY-MM-DD
.
End of applicable date range.
Past dates are not allowed.
days [optional]
List of days which should be affected by update. Allow names of days at 2 symbol format (mo, tu, we, th, fr, sa, su
).
To update each Monday in specific date range, you can send next request:
rate [optional]
String or Positive Integer value.
The value should be greater than 0.
Our API allows 2 ways to pass the rate value:
Decimal value converted into String ("200.00"), or Integer value with a minimum fraction size of currency (20000 for 200.00 USD).
Both of these ways allows you to work with Rates and prevents any problems with floating point operations.
min_stay_arrival [optional]
Positive Integer value.
min_stay_through [optional]
Positive Integer value.
min_stay [optional]
Positive Integer value. Applicable only if property.settings.min_stay_type
not equal to both
value. It is virtual option and provided value will be automatically translated into correct min_stay_*
value based at property.settings.min_stay_type
value.
max_stay [optional]
Non-negative Integer value.
closed_to_arrival [optional]
Boolean value.
Also, our API allow pass 0
or 1
as Boolean representation.
closed_to_departure [optional]
Boolean value.
Also, our API allow pass 0
or 1
as Boolean representation.
stop_sell [optional]
Boolean value.
Also, our API allow pass 0
or 1
as Boolean representation.
Notes
At least one restriction should be present on the request.
Last Win logic All provided updates is processed in FIFO logic, as result, you can use overrides to minimize message size:
Returns
Success
Method can return a Success result with 200 OK
HTTP Code if the operation is successful. Will contain a meta object with message in the answer.
Validation errors
If your request contain wrong data, you will receive warning messages at answer. Please, keep in mind, this response will be marked at Success and will have header 200 OK
. It is happened, because one message can be rejected, but another will be successfully produced.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized
HTTP Code if wrong Bearer Token provided.
Query Examples
Update multiple dates
Update multiple restrictions
Update multiple rate plans
Multi Occupancy Rate Plan update
Warning Notifications
If a request contains wrong values, we will reject this value from the update and provide a warning message in the response.
Keep in mind, if the request contains a few messages, our application process all correct information and ignores the problem ones.
Example of warning message:
Update Availability
Update Availability for a specific Room Type and Date.
Request:
Query body (JSON):
Date range update query body (JSON):
This method allow you to update several dates with one message.
You can insert multiple dates and ranges into one API call
Fields
Query object should contain values key with a list of change objects. Each change object should have the next structure:
property_id [required]
String with valid UUID of Property object.
room_type_id [required]
String with valid UUID of Room Type object.
date [required] if date_from is not present
String with date in ISO 8601 format by mask YYYY-MM-DD
.
date_from [required]
if date is not present
String with date in ISO 8601 format by mask YYYY-MM-DD
.
Start of applicable date range.
date_to [required]
if date is not present
String with date in ISO 8601 format by mask YYYY-MM-DD
.
End of applicable date range.
availability [required]
Non-negative Integer value.
Returns
Success
Method can return a Success result with 200 OK
HTTP Code if the operation is successful. Will contain a meta object with message in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized
HTTP Code if a wrong Bearer Token was provided.
Last updated