In this tutorial we will see how to create a new Room Rate inside Octorate
Required knowledge / points
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:
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.
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.
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
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!