Rate Categories Collection

API methods to work with Rate Categories

Rate Category is entity used as Templates for Rate Plans.

Rate Categories List

Retrieve list of Rate Categories associated with User Groups.

Request
Success Response
Error Response

Request:

GET https://staging.channex.io/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

{
"errors": {
"code": "unauthorized",
"title": "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
Success Response
Error Response

Request:

GET https://staging.channex.io/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

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Not Found Error

Status Code: 404 Not Found

{
"errors": {
"code": "not_found",
"title": "Resouce 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
Success Response
Error Response

Request:

POST https://staging.channex.io/api/v1/rate_categories

Query body (JSON):

{
"rate_category": {
"title": "Best Available Rate",
"group_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"parent_rate_category_id": null,
"children_fee": "0.00",
"infant_fee": "0.00",
"currency": "GBP",
"sell_mode": "per_room",
"rate_mode": "manual",
"closed_to_arrival": [false, false, false, false, false, false, false],
"closed_to_departure": [false, false, false, false, false, false, false],
"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],
"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
}
}

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

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Validation Error Response

Status Code: 422 Unprocessable Entity

{
"errors": {
"code": "validation_error",
"title": "Validation Error",
"details": {
"title": [
"can't be blank"
]
}
}
}

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 Channex.io 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
Success Response
Error Response

Request:

PUT https://staging.channex.io/api/v1/rate_categories/:id

Query body (JSON):

{
"rate_category": {
"title": "Best Available Rate",
"group_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"parent_rate_category_id": null,
"children_fee": "0.00",
"infant_fee": "0.00",
"currency": "GBP",
"sell_mode": "per_room",
"rate_mode": "manual",
"closed_to_arrival": [false, false, false, false, false, false, false],
"closed_to_departure": [false, false, false, false, false, false, false],
"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],
"auto_rate_settings": null
}
}

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
},
"relationships": {
"group": {
"data": {
"type": "group",
"id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7"
}
}
}
}
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Not Found Error

Status Code: 404 Not Found

{
"errors": {
"code": "resource_not_found"
"title": "Resource Not Found"
}
}

Validation Error Response

Status Code: 422 Unprocessable Entity

{
"errors": {
"code": "validation_error",
"title": "Validation Error",
"details": {
"title": [
"can't be blank"
]
}
}
}

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
Error Response

Request:

DELETE https://staging.channex.io/api/v1/rate_categories/:id

Success Response Example

Status Code: 200 OK

{
"meta": {
"message": "Success"
}
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Not Found Error

Status Code: 404 Not Found

{
"errors": {
"code": "resource_not_found"
"title": "Resource 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.