Introduction
Retrieving data
Updating data

Updating availability, price and minimum length of stay - http://xml.tobook.com/updateAvailability.asp

Description

This function can be used for updating availability information, such as number of available rooms, rates, minimum length of stay (MLOS), belonging to the given roomtypes.

The maximim for start-date is 547 days ahead. After that thso dates the data will not be stored.

Click here to see a demo of this function.

back to top

Prerequisites

A valid username with the corresponding password used for logging in to toBook.com.
A unique ID of the hotel in the system of toBook.com.
The ID and name of at least one roomtype and rate package combination of the hotel.

back to top

Request XML - Structure

When ChainID is submitted, username and password must belong to the hotelchain, otherwise to the specific hotel.

Node Attribute Data type Field type Description
Request        
Authentication        
Username   String Mandatory Username used for login
Password   String Mandatory Password used for login
ChainID   Integer Optional Unique ID of the hotelchain in the toBook.com system.
HotelID   Integer Mandatory Unique ID of the hotel in the toBook.com system.
RoomType        
  ID Integer Mandatory Unique ID of the roomtype and rate package in the toBook.com system.
  Name String Mandatory Unique identifying name of the roomtype in the toBook.com system.
StartDate   Date Mandatory Beginning date of the requested period, given in YYYY-MM-DD format. Max date : 547 ahead.
EndDate   Date Mandatory End date of the requested period, given in YYYY-MM-DD format
MLOS   Integer Optional Value of minimum length of stay
Rate   Float Optional Price of the rooms per night
Availability   Integer Optional Number of rooms available
Note that like Expedia, availability/inventory is shared between rate packages at roomtype level

back to top

Request XML - Example

<?xml version="1.0" encoding="utf-8" ?>
<Request>
  <Authentication>
    <Username>gentest</Username>
    <Password>gen2008</Password>
    <ChainID>46</ChainID>
    <HotelID>463</HotelID>
  </Authentication>
  <RoomType ID="1958" Name="Double">
    <StartDate>2009-07-20</StartDate>
    <EndDate>2009-07-30</EndDate>
    <MLOS>2</MLOS>
    <Rate>150.50</Rate>
    <Availability>5</Availability>
  </RoomType>
  <RoomType ID="1959" Name="Extra large triple with french bed">
    <StartDate>2009-07-30</StartDate>
    <EndDate>2009-07-20</EndDate>
    <Rate>180</Rate>
  </RoomType>
</Request>
    

back to top

Response XML - Structure

Empty nodes and negative values are ignored, when updating availability, rates or minimum length of stay.

Node Attribute Data type Field type Description
Response        
ChainID   Integer Optional Unique ID of the hotelchain in the toBook.com system
HotelID   Integer Mandatory Unique ID of the hotel in the toBook.com system
Status   String Mandatory Result of the request.
RoomType        
  ID Integer Mandatory Unique ID of the roomtype in the toBook.com system
  Name String Mandatory Name of the roomtype
  Updated String Mandatory Indication if the requested modification has been stored or not in the toBook.com system (values: Yes, No)
StartDate   Date Mandatory Beginning date of the requested period, given in YYYY-MM-DD format
EndDate   Date Mandatory End date of the requested period, given in YYYY-MM-DD format
MLOS   Integer Optional Minimum length of stay
Rate   Float Optional The value of rate in the toBook.com system.
Availability   Integer Optional Number of rooms available in the toBook.com system.

If the validation prcoess fails, the response contains a short description of the error.

Node Data type Field type Description
Response   Mandatory  
ErrorDesc String Mandatory Short description of the error (eq. "Could't parse the received XML.", "Login failed, check Username, Password, HotelID or ChainID nodes.")
Status String Mandatory Result of the request.

back to top

Response XML - Example

<?xml version="1.0" encoding="utf-8" ?>
<Response>
  <HotelID>463</HotelID>
  <ChainID>46</ChainID>
  <RoomType Name="Double" ID="1958" Updated="Yes">
    <MLOS>2</MLOS>
    <Rate>150.50</Rate>
    <Availability>5</Availability>
    <StartDate>2009-07-20</StartDate>
    <EndDate>2009-07-30</EndDate>
  </RoomType>
  <RoomType ID="1959" Name="Extra large triple with french bed">
    <Error>RoomType ID and Name do not match</Error>
  </RoomType>
  <Status>Success</Status>
</Response>
    
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <ErrorDesc>Could't parse the received XML.</ErrorDesc>
  <Status>Failure</Status>
</Response>
    
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <ErrorDesc>Login failed, check Username, Password, HotelID or ChainID nodes.</ErrorDesc>
  <Status>Failure</Status>
</Response>
    

back to top