Introduction
Retrieving data
Updating data

Updating reservations and cancellations - http://xml.tobook.com/updateReservations.asp

Description

This function can be used for confirming reservations or cancellations.

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.
At least one unique ID of a reservation 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.

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.
Reservation        
  Action String Mandatory Action that has been made with the reservation (values: Confirmed, Cancelled)
ID   integer Mandatory Unique ID of the reservation in the toBook.com system.
ConfirmID   integer Mandatory Unique ID of the reservation in the hotel's system.

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>
  <Reservation Action="Confirmed" >
    <ID>184471</ID>
    <ConfirmID>987654</ConfirmID>
  </Reservation>
  <Reservation Action="Cancelled" >
    <ID>183248</ID>
    <ConfirmID>876543</ConfirmID>
  </Reservation>
</Request>
    

back to top

Response XML - Structure

If the submitted Username / Password / ChainID and the submitted date period are valid, the response contains the actions have been made in the toBook.com system.

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.
Reservation        
  Updated String Mandatory Indication if the requested modification has been stored in the toBook.com system (values: Yes, No)
  Action String Mandatory Short description of the action that has been made. (eq: Confirmed, Cancelled, Database error, please try again later, ReservationID does not match HotelID)
ID   Integer Mandatory Unique ID of the reservation in the toBook.com system
ConfirmID   Integer Mandatory Unique ID of the reservation in the hotel's 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>
  <Status>Success</Status>
  <Reservation Updated="Yes" Action="Confirmed">
    <ID>184471</ID>
    <ConfirmID>987654</ConfirmID>
  </Reservation>
  <Reservation Updated="Yes" Action="Cancelled">
    <ID>183248</ID>
    <ConfirmID>876543</ConfirmID>
  </Reservation>
  <Reservation Updated="No" Action="Database error, please try again later.">
    <ID>184471</ID>
    <ConfirmID>765432</ConfirmID>
  </Reservation>
  <Reservation Updated="No" Action="ReservationID does not match HotelID.">
    <ID>183248</ID>
    <ConfirmID>654321</ConfirmID>
  </Reservation>
</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