Create Room and Rates

Last updated: March 19th, 2020


In this tutorial we will see how to create a new Room Rate inside Octorate

Required knowledge / points

  • You MUST have read the start guide carefully
  • You should know how HTTP APIs works
  • It's suggested to be confident with tools like curl

Room & Rates for Octorate

Octorate doesn't clearly makes the different between a Room, a Rate and a Product, but it has them differentiated in products and describe then the relation between them.
What does this mean? That you will find then this kind of products:

  • Double Room is a product,
  • Double Room Not Refundable is a product,
  • Double room single use is a product.

Then according to the channel an "All to All" mapping may be performed or only one of this is linked.
The difference here is related to the portal ability to handle the rates.
Anyway the "Double Room Not refundable" has a derivation rule, that describes for instance that a discount of 5% is applied and the availability must be the same.
This is handled by the object DerivedRule that you can find in our docs schemas.

Let's see a case

We've said the the room rates are created describing the relationship between two products.
Let's then create the 3 required objects: "The product 1", "The Derived Product" and the rule.

Create the main Product

Here we will create a new "Double Room" that will costs at least 200 eur per nights.
Request: curl --location --request POST '.../octobook/rest/roomrates/{{accommodation}}' \ --header 'accept: application/json' \ --header 'Authorization: Bearer {{token}}' \ --header 'Content-Type: application/json' \
--data-raw '{"name": "Double Room",
"adults": 2,
"bathroomQuantity": 1,
"bedroomQuantity": 1,
"dormitory": false,
"bedQuantity": 1,
"minimumSellingPrice": 200
Response: { "name": "Double room", "id": 122, "adults": 2, "children": 0, "infants": 0, "dormitory": true, "notRefundable": false, ... some content hidden for readability ... } Keep note of the ID created here we will use this in the second step

Create the derivable Product and the relationship

Let's then create the not refundable version with a 5% discount. (As alternative you can choose INCREMENT(relative))

Request curl --location --request POST '.../octobook/rest/roomrates/{{accommodation}}' \ --header 'accept: application/json' \ --header 'Authorization: Bearer {{token}}>' \ --header 'Content-Type: application/json' \ --data-raw '{"name": "Double Room Not Refundable", "adults": 2,
"bathroomQuantity": 1,
"noRefundable": true,
"bedroomQuantity": 1,
"dormitory": false,
"bedQuantity": 1,
"minimumSellingPrice": 200
"derivedRule": {
"parent": 122,
"availability": true,
"stay": true,
"restrictions": true,
"stopSell": true,
"price": "PERCENT",
"priceValue": -5,
"priceRound": true
}, }'
Response: { "name": "Double room Not Refundable", "id": 122, "adults": 2, "children": 0, "infants": 0, "dormitory": true, "notRefundable": true,"derivedRule":{...} ... some content hidden for readability ... } We've done we have configured our room and rate!