Rate Category is entity used as Templates for Rate Plans.
Rate Categories List
Retrieve list of Rate Categories associated with User Groups.
Request:
GET https://staging.bookdirect.com/api/v1/rate_categories
Success Response Example
Status Code: 201 Created
{"data":[{"type":"rate_category","id":"fd0a299c-ba54-428f-9f2d-97ed7d649feb","attributes":{"id":"fd0a299c-ba54-428f-9f2d-97ed7d649feb","title":"Best Available Rate","sell_mode":"per_room","rate_mode":"manual","currency":"USD","children_fee":"0.00","infant_fee":"0.00","stop_sell":[false,false,false,false,false,false,false],"min_stay_arrival":[1,1,1,1,1,1,1],"max_stay":[0,0,0,0,0,0,0],"closed_to_departure":[false,false,false,false,false,false,false],"closed_to_arrival":[false,false,false,false,false,false,false],"auto_rate_settings":null,"derived_option":null,"inherit_closed_to_arrival":false,"inherit_closed_to_departure":false,"inherit_max_stay":false,"inherit_min_stay_arrival":false,"inherit_rate":false,"inherit_stop_sell":false},"relationships":{"group":{"data":{"type":"group","id":"f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7"}}}}]}
Unauthorised Error Response
Status Code: 401 Unauthorized
Returns
Success
Method can return a Success result with 201 Created HTTP Code if operation is successful. Will contain a list of Rate Category objects in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Get Rate Category by ID
Retrieve specific Rate Category by ID.
Request:
GET https://staging.bookdirect.com/api/v1/rate_categories/:id
Success Response Example
Status Code: 200 OK
{"data":{"type":"rate_category","id":"fd0a299c-ba54-428f-9f2d-97ed7d649feb","attributes":{"id":"fd0a299c-ba54-428f-9f2d-97ed7d649feb","title":"Best Available Rate","sell_mode":"per_room","rate_mode":"manual","currency":"USD","children_fee":"0.00","infant_fee":"0.00","stop_sell":[false,false,false,false,false,false,false],"min_stay_arrival":[1,1,1,1,1,1,1],"max_stay":[0,0,0,0,0,0,0],"closed_to_departure":[false,false,false,false,false,false,false],"closed_to_arrival":[false,false,false,false,false,false,false],"auto_rate_settings":null,"derived_option":null,"inherit_closed_to_arrival":false,"inherit_closed_to_departure":false,"inherit_max_stay":false,"inherit_min_stay_arrival":false,"inherit_rate":false,"inherit_stop_sell":false},"relationships":{"group":{"data":{"type":"group","id":"f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7"}}}}}
Unauthorised Error Response
Status Code: 401 Unauthorized
Not Found Error
Status Code: 404 Not Found
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Rate Category object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if Rate Category with provided ID is not present at system.
Create Rate Category
Create new Rate Category.
Request:
Query body (JSON):
Success Response Example
Status Code: 200 OK
Unauthorised Error Response
Status Code: 401 Unauthorized
Validation Error Response
Status Code: 422 Unprocessable Entity
Fields
title [required]
Any non-empty string with maximum length of 255 symbols. Should be unique per Group.
Note: The Rate Category will be represented in the system under that title.
group_id [required]
String with valid UUID of Group object what you would like to associate with created Rate Category.
parent_rate_category_id [required]
String with valid UUID of Rate Category object what you would like to associate as parent with created Rate Category.
currency [required]
3 symbols long string with Currency Alphabetic code based at ISO 4217.
sell_mode [optional]
String, allow only two values: per_room or per_person.
Field is optional, be default system set per_room value.
Note: Sell mode for Rate Category.
Per Room Rate Category mean price is equal to any count of allowed guests. Price for 1 Guest will be same with price for 2 Guests.
Per Person Rate Category used to create Rate Category where price is calculated based at Guests count.
rate_mode [optional]
String, allow only next values: manual, derived, auto, cascade.
Field is optional, be default system set manual value.
Note: Rate Mode field represent how to calculate rate for current Rate Category. At BookDirect.com we have 4 possible ways to do that:
Manual - price is specified at options.rate field.
Derived - price derived from parent_rate_plan for primary occupancy option.
Cascade - price derived from parent_rate_plan for each occupancy option.
Auto - price calculated automatically based at price for primary occupancy option and auto_rate_settings.
Read more about Rate Modes and Derived options at our Rate Plan Section.
closed_to_arrival [optional]
7 items long Array with boolean values.
Represent Closed To Arrival restriction where each value at array affected to specific weekday.
closed_to_departure [optional]
7 items long Array with boolean values.
Represent Closed To Departure restriction where each value at array affected to specific weekday.
stop_sell [optional]
7 items long Array with boolean values.
Represent Stop Sell restriction where each value at array affected to specific weekday.
min_stay_arrival [optional]
7 items long Array with positive integer values.
Represent Min Stay Arrival restriction where each value at array affected to specific weekday.
max_stay [optional]
7 items long Array with non-negative integer values.
Represent Max Stay restriction where each value at array affected to specific weekday.
max_sell [optional]
Non-negative integer value.
Represent maximum count of allowed sales for current Rate Category.
auto_rate_settings [optional]
Object with Auto Rate Settings structure.
Field is optional generally, but required if rate_mode equal to auto.
This object contain information how to increase or decrease rate options from primary occupancy option.
derived_option [options]
Valid Derived Options Object.
This field represent rules to derive and modify parent values for Rate Plan Primary Occupancy Option.
inherit_rate [optional]
Boolean value.
Field is optional. By default equal to false if parent_rate_category_id is empty, true if parent_rate_category_id is present.
Allow Rate Plan derive rate from Parent Rate Plan. When Parent Rate Plan is changed, Rate Plan will be automatically updated.
inherit_closed_to_arrival [optional]
Boolean value.
Field is optional. By default equal to false if parent_rate_category_id is empty, true if parent_rate_category_id is present.
Allow Rate Plan derive closed_to_arrival from Parent Rate Plan. When Parent Rate Plan is changed, Rate Plan will be automatically updated.
inherit_closed_to_departure [optional]
Boolean value.
Field is optional. By default equal to false if parent_rate_category_id is empty, true if parent_rate_category_id is present.
Allow Rate Plan derive closed_to_departure from Parent Rate Plan. When Parent Rate Plan is changed, Rate Plan will be automatically updated.
inherit_stop_sell [optional]
Boolean value.
Field is optional. By default equal to false if parent_rate_category_id is empty, true if parent_rate_category_id is present.
Allow Rate Plan derive stop_sell from Parent Rate Plan. When Parent Rate Plan is changed, Rate Plan will be automatically updated.
inherit_min_stay_arrival [optional]
Boolean value.
Field is optional. By default equal to false if parent_rate_category_id is empty, true if parent_rate_category_id is present.
Allow Rate Plan derive min_stay_arrival from Parent Rate Plan. When Parent Rate Plan is changed, Rate Plan will be automatically updated.
inherit_max_stay [optional]
Boolean value.
Field is optional. By default equal to false if parent_rate_category_id is empty, true if parent_rate_category_id is present.
Allow Rate Plan derive max_stay from Parent Rate Plan. When Parent Rate Plan is changed, Rate Plan will be automatically updated.
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Rate Category object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Validation Error
Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.
Update Rate Category
Update Rate Category.
Request:
Query body (JSON):
Success Response Example
Status Code: 200 OK
Unauthorised Error Response
Status Code: 401 Unauthorized
Not Found Error
Status Code: 404 Not Found
Validation Error Response
Status Code: 422 Unprocessable Entity
Fields
This method use same fields as Create Rate Plan method.
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Rate Category object in the answer.
Unauthorised Error
Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if Rate Category 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.
Remove Rate Category
Remove Rate Category.
Request:
Success Response Example
Status Code: 200 OK
Unauthorised Error Response
Status Code: 401 Unauthorized
Not Found Error
Status Code: 404 Not Found
Returns
Success
Method can return a Success result with 200 OK HTTP Code if 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 wrong Bearer Token provided.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if Rate Category with provided ID is not present at system.