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 Bearer Token provided.
Get Room Type by ID
Retrieve specific Room Type by ID.
Request:
GET https://staging.bookdirect.com/api/v1/room_types/:id
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Room Type 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 Room Type.
Not Found Error
Method can return a Not Found Error result with 404 Not Found HTTP Code if Room Type with provided ID is not present at system.
Create Room Type
Create new Room Type.
Request:
Query body (JSON):
Success Response Example
Status Code: 201 Created
Unauthorised Error Response
Status Code: 401 Unauthorized
Validation Error Response
Status Code: 422 Unprocessable Entity
Fields
property_id [required]
String with valid UUID of Property object what you would like to associate with created Room Type.
title [required]
Any non-empty string with maximum length of 255 symbols.
Note: The Room Type will be represented in the system under that title.
count_of_rooms [required]
Any positive integer number.
Note: This field represent how many items of created Room Type you have at Property.
occ_adults [required]
Any positive integer number.
Note: This field represent how many places to sleep Adult person you have at one item of Room Type.
occ_children [required]
Any positive integer number.
Note: This field represent how many places where only Children or Infants can sleep at one item of Room Type.
occ_infants [required]
Any positive integer number.
Note: This field represent how many places where only Infants can sleep you have at one item of Room Type. Example: count of baby cots.
default_occupancy [required]
Any positive integer number lower or equal to occ_adults.
Note: This field represent how many guests can stay at room by default (without extra spaces). Keep in mind, this field can not be greater then occ_adults value.
Field is optional, by default equal to occ_adults.
Returns
Success
Method can return a Success result with 201 Created HTTP Code if operation is successful. Will contain a Room Type 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 Room Type
Update Room Type.
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 Room Type method.
Returns
Success
Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Room Type 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 Room Type 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 Room Type
Remove Room Type.
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 Room Type with provided ID is not present at system.