Introduction
Retrieving data
Updating data

Retrieving reservations and cancellations - http://xml.tobook.com/retrieveReservations.asp

Description

This function can be used for retrieving reservations waiting to be confirmed or cancelled. Only a limited set of reservations can be retrieved by this function. Reservations which are new and waiting to be confirmed or cancelled. Finalized reservations cannot be retrieved again.

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 the hotelchain section of toBook.com.
A unique ID of the hotel in the system of toBook.com.

back to top

Request XML - Structure

When ChainID is submitted, username and password must belong to the hotelchain, otherwise to the specific hotel.
When StartDate and EndDate are submitted, the response will include only reservations with date of arrival within the requested period.
When Filter is submitted with the value of "ByCreation", the response will include reservations with booking time within the requested period.
When GuestName is submitted with the value of "Separated", the guest's title, first and last name will be split into separate nodes in the response.

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.
StartDate   Date Optional Beginning date of the requested period, given in YYYY-MM-DD format
EndDate   Date Optional End date of the requested period, given in YYYY-MM-DD format (Up-to, not including the last day provided).
Filter   String Optional Filter type (values: ByArrival, ByCreation). Default value (node is empty or not submitted): "ByArrival".
GuestName   String Optional Output mode (values: Joined, Separated). Default value (node is empty or not submitted): "Joined".

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>
  <StartDate>2010-09-09</StartDate>
  <EndDate>2010-10-12</EndDate>
</Request>
    
<?xml version="1.0" encoding="utf-8" ?>
<Request>
  <Authentication>
    <Username>gentest</Username>
    <Password>gen2008</Password>
    <ChainID>46</ChainID>
    <HotelID>463</HotelID>
  </Authentication>
  <StartDate>2009-08-01</StartDate>
  <EndDate>2010-08-10</EndDate>
  <Filter>ByCreation</Filter>
  <GuestName>Separated</GuestName>
</Request>
    

back to top

Response XML - Structure

If the submitted Username / Password / ChainID and the submitted date period is valid, the response contains the list of reservations / cancellations waiting to be confirmed by the hotel (only 50 items can be retrieved per request).

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
Currency   Integer Mandatory Currency of the hotel in the toBook.com system.
Status   String Mandatory Result of the request.
Reservation        
  Action String Mandatory Action to be made with the reservation (values: Confirm, Cancel).
ID   Integer Mandatory Unique ID of the reservation in the toBook.com system
Number   String Mandatory Unique number of the reservation in the toBook.com system, included in the confirmation emails
BookingDate   Date Mandatory The day when the booking has been made
TotalRate   Float Mandatory The price of the reservation in the above mentioned currency.
ExclCommission   Boolean Mandatory Flag to indicate if commission has to be paid after the reservation.
OriginalRoomPrice   Float Optional In case of a commission-free reservation, the original total price of the room.
CheckIn   Date Mandatory Date of arrival
CheckOut   Date Mandatory Date of departure
ArrivalTime   Integer Optional Estimated time of arrival (24 hour format, GMT+2 zone)
SmokingPreference   Boolean Mandatory Smoking preference of the guest (values: Yes, No).
NrOfPersons   Integer Mandatory Number of persons included in the reservation.
NrOfRooms   Integer Mandatory Number of rooms included in the reservation.
RoomType        
ID   Integer Mandatory Unique ID of the roomtype in the toBook.com system.
Name   String Mandatory Name of the roomtype.
Name   String Mandatory Name of the guest.
Address   String Optional Address of the guest.
Telephone   String Mandatory Phone number of the roomtype.
Email   String Mandatory E-mail address of the roomtype.

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>
  <Currency>EUR</Currency>
  <HotelID>463</HotelID>
  <ChainID>46</ChainID>
  <Reservation Action="Cancel">
    <ID>183248</ID>
    <Number>183419-463-090710</Number>
    <Name>Mr. A B</Name>
    <Email>test@tobook.com</Email>
    <Address>Address ZIP City Country</Address>
    <Telephone>0031135211671</Telephone>
    <BookingDate>2009-07-10</BookingDate>
    <NrOfRooms>1</NrOfRooms>
    <NrOfPersons>2</NrOfPersons>
    <SmokingPreference>No</SmokingPreference>
    <TotalRate>80</TotalRate>
    <ExclCommission>false</ExclCommission>
    <OriginalRoomPrice>80</OriginalRoomPrice>
    <CheckIn>2010-09-10</CheckIn>
    <CheckOut>2010-09-12</CheckOut>
    <ArrivalTime>12</ArrivalTime>
    <RoomType>
      <ID>1958</ID>
      <Name>Triple</Name>
    </RoomType>
  </Reservation>
  <Reservation Action="Confirm">
    <ID>184471</ID>
    <Number>184642-463-090804</Number>
    <Name>Mrs. Q Z</Name>
    <Email>test@tobook.com</Email>
    <Address>Address ZIP City Country</Address>
    <Telephone>4616688448482018</Telephone>
    <BookingDate>2009-08-04</BookingDate>
    <NrOfRooms>2</NrOfRooms>
    <NrOfPersons>8</NrOfPersons>          
    <SmokingPreference>Yes</SmokingPreference>
    <TotalRate>468</TotalRate>
    <ExclCommission>true</ExclCommission>
    <OriginalRoomPrice>500</OriginalRoomPrice>
    <CheckIn>2010-10-01</CheckIn>
    <CheckOut>2010-10-02</CheckOut>
    <ArrivalTime></ArrivalTime>
    <RoomType>
      <ID>1959</ID>
      <Name>Extra large triple with french bed</Name>
    </RoomType>
  </Reservation>
  <Status>Success</Status>
</Response>
    
<?xml version="1.0" encoding="utf-8" ?>
<Response>
  <Currency>EUR</Currency>
  <HotelID>463</HotelID>
  <ChainID>46</ChainID>
  <Reservation Action="Cancel">
    <ID>183248</ID>
    <Number>183419-463-090710</Number>
    <Title>Mr.</Title>
    <FirstName>A</FirstName>
    <LastName>B</LastName>
    <Email>test@tobook.com</Email>
    <Address>Address ZIP City Country</Address>
    <Telephone>0031135211671</Telephone>
    <BookingDate>2009-07-10</BookingDate>
    <NrOfRooms>1</NrOfRooms>
    <NrOfPersons>2</NrOfPersons>
    <SmokingPreference>No</SmokingPreference>
    <TotalRate>80</TotalRate>
    <ExclCommission>false</ExclCommission>
    <OriginalRoomPrice>80</OriginalRoomPrice>
    <CheckIn>2010-09-10</CheckIn>
    <CheckOut>2010-09-12</CheckOut>
    <ArrivalTime>12</ArrivalTime>
    <RoomType>
      <ID>1958</ID>
      <Name>Triple</Name>
    </RoomType>
  </Reservation>
  <Reservation Action="Confirm">
    <ID>184471</ID>
    <Number>184642-463-090804</Number>
    <Title>Mrs.</Title>
    <FirstName>Q</FirstName>
    <LastName>Z</LastName>
    <Email>test@tobook.com</Email>
    <Address>Address ZIP City Country</Address>
    <Telephone>4616688448482018</Telephone>
    <BookingDate>2009-08-04</BookingDate>
    <NrOfRooms>2</NrOfRooms>
    <NrOfPersons>8</NrOfPersons>          
    <SmokingPreference>Yes</SmokingPreference>
    <TotalRate>468</TotalRate>
    <ExclCommission>true</ExclCommission>
    <OriginalRoomPrice>500</OriginalRoomPrice>
    <CheckIn>2010-10-01</CheckIn>
    <CheckOut>2010-10-02</CheckOut>
    <ArrivalTime></ArrivalTime>
    <RoomType>
      <ID>1959</ID>
      <Name>Extra large triple with french bed</Name>
    </RoomType>
  </Reservation>
  <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