derivedprices (B.XML)

The 'derivedprices' API call in B.XML is used to allow derived pricing for specific room/rate products. This consists of setting a leading occupancy for that room/rate (e.g., 2 persons) and setting derived pricing rules for other possible occupancies that this room/rate can accommodate (e.g., price for 3 persons is 50% more). This means that, whenever a price is set for a specific room/rate/date combination, the price will be for the leading occupancy, and the derived pricing rules will determine the prices for the same room/rate/date combination, for the occupancies which have them set.

HTTP request

POST https://supply-xml.booking.com/hotels/xml/derivedprices

Request body

<request>
  <username>xml_username</username>
  <password>xml_password</password>
  <rooms>
    <room id="1000202">
      <rates>
        <rate id="12345" leading_occupancy="2">
          <occupancy persons="3" percentage="25" round="1" />
          <occupancy persons="4" additional="10" />
          <occupancy persons="5" percentage="-15" />
          <occupancy persons="6" additional="-5" round="0" />
        </rate>
      </rates>
    </room>
  </rooms>
</request>

Response body

<ok></ok>
<!-- RUID: [UmFuZG9tSVYkc2RlIyh9YWDBx32oy3x3Ccs+urTlxzG2rsOzD1t9dXjyrNEjkjXKN0kEqyEPcel6V+ZiSJd0BvJNx9uCzmGE] -->

The above example will do the following: For the room/rate product of room with ID 1000202 (<room id="1000202">) and rate with ID 12345, the leading occupancy will be set to 2 persons (<rate id="12345" leading_occupancy="2">). This means that, every time a price is set for a room/rate/date product of room/rate ID's 1000202/12345, that price will correspond to a 2-persons booking. The following <occupancy> elements set the derived pricing rules for other occupancies of the same room/rate: For a 3-persons booking, the price will correspond to 25% more, always rounded down to 0 decimal places: <occupancy persons="3" percentage="25" round="1" />. For a 4-persons booking, the price will correspond to an additional amount of 10 in the currency set: <occupancy persons="4" additional="10" />. For a 5-persons booking, the price will correspond to 15% less: <occupancy persons="5" percentage="-15" />. For a 6-persons booking, the price will correspond to an amount decreased by 5, in the currency set, never rounded down: <occupancy persons="6" additional="-5" round="0" />.

Request fields

request

Mandatory: Yes

Content type: (none)

Parent node: (none)

Multiplicity: 1

Attributes: (none)

Constraints: (none)

Description: This is the root element of every derivedprices call.

Syntax example: <request></request>

username

Mandatory: Yes

Content type: String

Parent node: request

Multiplicity: 1

Attributes: (none)

Constraints: (none)

Description: This is the username of the machine account being used to connect.

Syntax example: <username>xml_username</username>

password

Mandatory: Yes

Content type: String

Parent node: request

Multiplicity: 1

Attributes: (none)

Constraints: (none)

Description: This is the password of the machine account being used to connect.

Syntax example: <password>xml_password</password>

rooms

Mandatory: Yes

Content type: (none)

Parent node: request

Multiplicity: 1

Attributes: (none)

Constraints: (none)

Description: This is the structural element which contains the set of rooms which are to be updated with this call.

Syntax example: <rooms></rooms>

room

Mandatory: Yes

Content type: (none)

Parent node: rooms

Multiplicity: 1..X

Attributes: id (integer)

Constraints: Attribute 'id' is mandatory.

Description: This is the element describing a specific room which will be updated with this call. The 'id' attribute is the Booking.com system numeric identifier of the room.

Syntax example: <room id="1000202"></room>

rates

Mandatory: Yes

Content type: (none)

Parent node: room

Multiplicity: 1

Attributes: (none)

Constraints: (none)

Description: This is the structural element which contains the set of rates, for the specified room, whose corresponding room/rate products are to be updated with this call.

Syntax example: <rates></rates>

rate

Mandatory: Yes

Content type: (none)

Parent node: rates

Multiplicity: 1..X

Attributes: id (integer), leading_occupancy (integer)

Constraints: Attributes 'id' and 'leading_occupancy' are mandatory.

Description: This is the element describing a specific rate which will be updated with this call. The 'id' attribute is the Booking.com system numeric identifier of the rate. The 'leading_occupancy' attribute is the room/rate standard occupancy to which all further price specifications will be applied.

Syntax example: <rate id="12345" leading_occupancy="2"></rate>

occupancy

Mandatory: Yes

Content type: (none)

Parent node: rate

Multiplicity: 1..X

Attributes: persons (integer), percentage (integer), additional (integer), round (boolean)

Constraints: Attribute 'persons' is mandatory. Attributes 'percentage' and 'additional' cannot be both set, just one.

Description: This is the element describing a derived pricing rule for a specific occupancy, in which the 'persons' attribute states the number of persons of the occupancy. The derived pricing rule can be set by either the 'percentage' attribute, which states the increase or decrease in price compared to the leading occupancy percentage-wise, or the 'additional' attribute, which states by how much more (or less) does the price increase (or decrease) compared to the leading occupancy in terms of actual currency amount. An optional 'round' boolean attribute states whether this derived price should always be rounded down (round="1") or not (round="0") . The default value for 'percentage', 'additional', and 'round' is 0.

Syntax example: <occupancy persons="3" percentage="25" round="1" />

Response fields

On success, the response will consist exclusively on an <ok></ok> element, as well as the RUID string as comment, which is used by the Booking.com staff to trace back any updates made before, as well as for debugging purposes.

Syntax example:

<ok></ok>
<!-- RUID: [UmFuZG9tSVYkc2RlIyh9YWDBx32oy3x3Ccs+urTlxzG2rsOzD1t9dXjyrNEjkjXKN0kEqyEPcel6V+ZiSJd0BvJNx9uCzmGE] -->

To remove a previously-set price for a specific occupancy, specify a price or percentage of 0.