Creating and updating rate plans¶
Creating a rate plan¶
POST https://supply-xml.booking.com/hotels/ota/OTA_HotelRatePlanNotif
The POST ota/OTA_HotelRatePlanNotif
request enables you to create rate plans. A rate plan is a label that helps properties organise the pricing of their rooms. Note that a rate plan itself does not contain any value, but just the name of the rate plan.
→ If you want to create a derived rate plan, which derives from an existing rate plan, see creating a derived rate plan instead.
Body parameters¶
The following table describes what elements you must add in the request body:
Element | Attribute | Description | Type | Required/Optional | Notes |
---|---|---|---|---|---|
OTA_HotelRatePlanNotifRQ |
The parent object for rate plan. Contains the RatePlans object. |
object | required | ||
Target |
Specifes whether the request is for production (Production ) or testing (Test ). |
enum | required | ||
RatePlans |
Contains the RatePlan objects. |
array | required | ||
HotelCode |
Specifies the ID of the property you create a rate plan for. | integer | required | ||
RatePlan |
Contains the Description object. |
object | required | ||
RatePlanNotifType |
Specifies the type of operation you want to perform on the rate plan. Possible values: New , Overlay , Remove , and Activate . |
enum | required | ||
Description |
Contains the rate plan name. | required | |||
Name |
Specifies the name of the rate plan. | string | required |
Request body example¶
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanNotifRQ xmlns="http://www.opentravel.org/OTA/2003/05" MessageContentCode="8" Version="1.005" TimeStamp="2015-06-09T11:53:48" Target='Production'>
<RatePlans HotelCode="{PropertyID}" >
<RatePlan RatePlanNotifType="New">
<Description Name="Standard Rate"/>
</RatePlan>
</RatePlans>
</OTA_HotelRatePlanNotifRQ>
Sample response¶
The following is an example response. You can see a success message and find the rate plan id as the value of the ResponseRatePlanCode
attribute.
<OTA_HotelRatePlanNotifRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelRatePlanNotifRS.xsd" TimeStamp="2015-09-30T13:49:52-00:00" Target="Production" Version="3.000">
<Success />
<RatePlanCrossRef ResponseRatePlanCode="{RatePlanID}"/>
</OTA_HotelRatePlanNotifRS>
Updating a rate plan¶
Updating a rate plan via the API is just renaming it. See, renaming a rate plan.
Creating a derived rate plan¶
POST https://supply-xml.booking.com/hotels/ota/OTA_HotelRatePlanNotif
The POST ota/OTA_HotelRatePlanNotif
request also enables you to create a derived rate plan. This means you can create a new rate plan and indicate what aspects it should follow from an existing (parent) rate plan. You must also:
- Specify which parent rate plan by adding its rate plan id in the request.
- Set the price by specifying the relation to the parent rate plan price in percentages: For example, 80 refers to a 20% discount, 120 refers to a 20% increase.
When to create a derived rate plan
Creating a rate plan only involves giving it a name. You can then link a rate plan to a room type and add restrictions, policy info, and price. After you have done that, you could create a derived rate plan.
Body parameters¶
The following table describes what elements you must add in the request body:
Element | Attribute | Description | Type | Required | Notes |
---|---|---|---|---|---|
OTA_HotelRatePlanNotifRQ |
The parent object for rate plan. Contains the RatePlans object. |
object | required | ||
Target |
Specifes whether the request is for production (Production ) or testing (Test ). |
enum | required | ||
RatePlans |
Contains the RatePlan objects. |
array | required | ||
HotelCode |
Specifies the ID of the property you create a rate plan for. | integer | required | ||
RatePlan |
Contains the Description object. |
object | required | ||
RatePlanNotifType |
Specifies the type of operation you want to perform on the rate plan. Possible values: New ,Overlay ,Remove , and Activate . |
enum | required | ||
Description |
Contains the derived rate plan name. | required | |||
Name |
Specifies the name of the derived rate plan. | string | required | ||
RateRelation |
Contains the details about the new derived rate plan. | object | optional | - | |
ParentRateId |
Specifies the id of the parent rate plan. | integer | required | Default: 1 |
|
Percentage |
Specifies the percentage change from the parent rate plan. | integer | required | Min/max value: 1 /200 |
|
FollowsPrice |
Indicates whether the derived rate plan follows the price of the parent rate plan. | Boolean | optional | Format: 0/1 Default: 1 |
|
FollowsRestrictions |
Indicates whether the derived rate plan follows the restrictions of the parent rate plan. | Boolean | optional | Format: 0/1 Default: 1 |
|
FollowsPolicyGroup |
Indicates whether the derived rate plan follows the policies of the parent rate plan. | Boolean | optional | Format: 0/1 Default: 1 |
|
FollowsClosed |
Indicates how the derived rate plan follows the status of the parent rate plan. | enum | optional | Possible values: 0 (Never follows parent rate plan status.), 1 (Follows parent status when parent rate plan is open.), 2 (Follows parent status when parent rate plan is closed.), and 3 (Always follows parent rate plan status.). Default: 3 |
Request body example¶
Provide an OTA_HotelRatePlanNotifRQ object with the RateRelation object in the request body. Example:
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanNotifRQ
xmlns="http://www.opentravel.org/OTA/2003/05"
MessageContentCode="8"
Version="1.005"
Target='Production'>
<RatePlans HotelCode="{PropertyID}">
<RatePlan RatePlanNotifType="New">
<Description Name="Basic rate 2 guests"/>
<RateRelation ParentRateId="{ParentRatePlanID}" Percentage = "90"
FollowsPrice = "1"
FollowsRestrictions = "1"
FollowsPolicyGroup = "1"
FollowsClosed = "1">
</RateRelation>
</RatePlan>
</RatePlans>
</OTA_HotelRatePlanNotifRQ>
Sample response¶
The following is an example response. You can see a success message and find the (derived) rate plan id as the value of the ResponseRatePlanCode
attribute.
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanNotifRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelRatePlanNotifRS.xsd" TimeStamp="2015-09-30T13:49:52-00:00" Target="Production" Version="3.000">
<Success />
<RatePlanCrossRef ResponseRatePlanCode="{RatePlanID}"/>
</OTA_HotelRatePlanNotifRS>
Updating a derived rate plan¶
Before you update a derived rate plan
If you want to update a rate plan you created, you must be aware of the overlay system. To avoid existing information to be deleted,you must include all the elements (or objects) that you used in the creating a rate plan request. Change the elements that you want to update and leave the others unchanged.
POST https://supply-xml.booking.com/hotels/ota/OTA_HotelRatePlanNotif
To update a rate plan, the request stays mostly the same. However, within the RatePlan
element you must change the value of the RatePlanNotifType
attribute from New
to Overlay
. In addition,
Body parameters¶
The following table describes what elements you must add in the request body:
Element | Attribute | Description | Type | Required | Notes |
---|---|---|---|---|---|
OTA_HotelRatePlanNotifRQ |
The parent object for rate plan. Contains the RatePlans object. |
object | required | ||
Target |
Specifes whether the request is for production (Production ) or testing (Test ). |
enum | required | ||
RatePlans |
Contains the RatePlan objects. |
array | required | ||
HotelCode |
Specifies the ID of the property you create a rate plan for. | integer | required | ||
RatePlan |
Contains the Description object. |
object | required | ||
RatePlanNotifType |
Specifies the type of operation you want to perform on the rate plan. Possible values: New ,Overlay ,Remove , and Activate . |
enum | required | ||
RatePlanCode |
Specifies the ID of the rate plan. | integer | required | ||
Description |
Contains the derived rate plan name. | required | |||
Name |
Specifies the name of the derived rate plan. | string | required | ||
RateRelation |
Contains the details about the new derived rate plan. | object | optional | - | |
ParentRateId |
Specifies the id of the parent rate plan. | Integer | required | Default: 1 |
|
Percentage |
Specifies the percentage change from the parent rate plan. | integer | required | Min/max value: 1 /200 |
|
FollowsPrice |
Indicates whether the derived rate plan follows the price of the parent rate plan. | Boolean | optional | Format: 0/1 Default: 1 |
|
FollowsRestrictions |
Indicates whether the derived rate plan follows the restrictions of the parent rate plan. | Boolean | optional | Format: 0/1 Default: 1 |
|
FollowsPolicyGroup |
Indicates whether the derived rate plan follows the policies of the parent rate plan. | Boolean | optional | Format: 0/1 Default: 1 |
|
FollowsClosed |
Indicates whether the derived rate plan follows the potentially closed status of the parent rate plan. | Integer | optional | Min/max value: 1 /3 |
Request body example¶
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanNotifRQ
xmlns="http://www.opentravel.org/OTA/2003/05"
MessageContentCode="8"
Version="1.005"
Target='Production'>
<RatePlans HotelCode="{PropertyID}">
<RatePlan RatePlanNotifType="Overlay" RatePlanCode="18904334">
<Description Name="Basic rate 2 guests"/>
<RateRelation ParentRateId="{ParentRatePlanID}" Percentage = "90"
FollowsPrice = "1"
FollowsRestrictions = "1"
FollowsPolicyGroup = "1"
FollowsClosed = "1">
</RateRelation>
</RatePlan>
</RatePlans>
</OTA_HotelRatePlanNotifRQ>
Sample response¶
The following is an example response. You can see a success message and find the (derived) rate plan id as the value of the ResponseRatePlanCode
attribute.
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanNotifRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelRatePlanNotifRS.xsd" TimeStamp="2015-09-30T13:49:52-00:00" Target="Production" Version="3.000">
<Success />
<RatePlanCrossRef ResponseRatePlanCode="{RatePlanID}"/>
</OTA_HotelRatePlanNotifRS>