Vous êtes sur la page 1sur 34

MetGlobal

HotelsPro API 4.1


Service Application Document
Hotel

2011

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

Contents
Contents.....................................................................................................................................2 1 General.....................................................................................................................................3 2 Files Debuging.......................................................................................................................10 3 Methods in detail....................................................................................................................27 4 Appendix................................................................................................................................33

Revision History
Version 4.0.0.1 4.0.0.2 4.0.0.3 4.0.0.4 4.0.0.9 4.1.0.1 Date 19/10/2010 27/10/2010 10/01/2011 01/03/2011 03/03/2011 27/05/2011 Description Template document created General, Methods, Elements sections are created General Section completed Document updated Document completed WSDL changed Modification Author Cuneyt CAVA Unal TASDIZEN Olga OVALI Cuneyt CAVA Cuneyt CAVA Cuneyt CAVA

MetGlobal 2012 Author: Unal TASDIZEN

www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

1 General
1.1 Introduction
1.1.1 Purpose of HotelsPro XML booking system HotelsPro XML booking system is dedicated to the Travel and Tourism industry. HotelsPro XML booking system is an XML-based interface for HotelsPro affiliates that allows clients to check availability and make bookings at thousands of hotels and transfers worldwide (using the clients own front-end system/site and HotelsPro system). Hotels/transfer can be booked with instant confirmation or on request. Bookings can be cancelled through the XML booking system. The booking process is fully supported by the database that holds all the destinations and product information data the client will need. To become an XML affiliate the client needs to be registered as HotelsPro agency at HotelsPro website www.hotelspro.com firstly. 1.1.2 Technical Requirements for XML affiliate: 1. Online website. 2. Web server with database support and software language (PHP, ASP or other). 3. IT team. Developers working on the creation of the interface software should ideally have the following skills/experience: Good knowledge of XML, and preferably schema definitions. Understanding of basic database concepts. 4. Opportunity for charging clients online.

1.2 Environments
The client can use 2 environments involved in the project to develop the interface: Live Test

Each environment has separate software/configuration: Booking database URL for request/response

Please note: The hotel/transfer bookings made on the test system cannot be real (live) bookings. Live environment is available by the link:
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

http://api.hotelspro.com/4.1/hotel/b2bHotelJSON.php http://api.hotelspro.com/4.1/hotel/b2bHotelSOAP.php Test environment is available by the link: http://api.hotelspro.com/4.1_test/hotel/b2bHotelJSON.php http://api.hotelspro.com/4.1_test/hotel/b2bHotelSOAP.php XML request can be sent using SOAP protocol. All requests need to be sent in UTF-8 encoding (unicode). All responses will be similarly encoded. Please note: Firstly only test environment is available for a new XML affiliate. Until system is not tested properly by XML affiliate, the live environment of HotelsPro XML booking system will not be available for XML affiliate. For sending XML request to the booking system the client is advised to add a new user (XML agent) to its HotelsPro agency account and use API key (unique code generated by HotelsPro) in every XML request to the booking system. So it will be easier for the client to separate the XML bookings (bookings which were made by HotelsPro XML booking system) from manual bookings (booking which were made by agents on HotelsPro website manually).

1.3 Hotel Database


Before starting developing client needs to get HotelsPro hotel and information and store it in its own database. XML-formated hotel information will be available for XML affiliate after signing contract and NDA. Only master account can use Administration Menu so XML-formated hotel information can be downloaded only by the main user of HotelsPro agency (master account which has admin rights i.e:XY-123456-ZW). To download XML-formatted hotel information the main agent should click HotelList(XML) link in Administration submenu of HotelsPro page:

After clicking here, below page will be open:

MetGlobal 2012 Author: Unal TASDIZEN

www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

After clicking on button Update Files the system will start hotel data generating process. It can take up to 60 minutes. The process will be shown with the loader .

The window of process can be closed; it will not interrupt the generating process. After 40-60 minutes hotel data files will be created. The data can be accessed by the links on the page:

Also the data will be available by these links: http://static.hotelspro.com/xf_4.0/downloads/[AffiliateCode]hotellist.xml http://static.hotelspro.com/xf_4.0/downloads/[AffiliateCode]hoteldescr.xml http://static.hotelspro.com/xf_4.0/downloads/[AffiliateCode]hotelamenities.xml http://static.hotelspro.com/xf_4.0/downloads/[AffiliateCode]destinations.xml Each of those files contains affiliate and request/response information as: 1. 2. 3. 4. 5. ResponseType; AffiliateCode code of the XML affiliate; AffRequestId affiliate request identifier; AffRequestTime time when request for hotel list was sent; TotalNumber total number of HotelsPro hotels in XML file.

1.4 Hotels List


The file contains information for every hotel as: 1. HotelCode unique hotel identifier in XML booking system; 2. OldHotelId old hotel identifier (used in 1.0-1.2 versions, it is not needed for XML partners who work with HotelsPro system version 3.0 or 4.0); 3. DestinationId identifier of destination where the hotel is situated; 4. Destination name of city where the hotel is situated; 5. Country; 6. HotelName; 7. StarRating - stars of the hotel (from 0 to 5); 8. HotelAddress address of the hotel; 9. HotelPostalCode zip code of the hotel address; 10. HotelPhoneNumber; 11. HotelArea area of the hotel;
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

12. Chain name of hotel chain; 13. Coordinates latitude and longitude; 14. URL for 3 hotel images; XML format:
<?xml version="1.0" encoding="UTF-8" ?> - <XMLResponse> <ResponseType>HotelListResponse</ResponseType> - <RequestInfo> <AffiliateCode>XX0000</AffiliateCode> <AffRequestId>XXX</AffRequestId> <AffRequestTime>yyyy-mm-ddThh:mm:ss</AffRequestTime> </RequestInfo> <TotalNumber>XXXXX</TotalNumber> - <Hotels> - <Hotel> <HotelCode>XXXXXX</HotelCode> <OldHotelId>X/XXXXXXXX</OldHotelId> <DestinationId>XXXX</DestinationId> <Destination>Name of city</Destination> <Country>Name of country</Country> <HotelName>Hotel Name</HotelName> <StarRating>x</StarRating> <HotelAddress>Hotel address</HotelAddress> <HotelPostalCode>Zip Code</HotelPostalCode> <HotelPhoneNumber>Hotel phone number</HotelPhoneNumber> <HotelArea>Hotel area</HotelArea> <Chain>Hotel Chain</Chain> - <Coordinates> <Latitude>latitude</Latitude> <Longitude>longitude</Longitude> </Coordinates> - <HotelImages> <ImageURL>URL1</ImageURL> <ImageURL>URL2</ImageURL> <ImageURL>URL3</ImageURL> </HotelImages> </Hotel> - <Hotel> .... </Hotel> .... </Hotels> </XMLResponse>

1.5 Hotels Description


The file contains location information and text description for every hotel. XML format:
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 <?xml version="1.0" encoding="UTF-8" ?> - <XMLResponse> <ResponseType>HotelListResponse</ResponseType> - <RequestInfo> <AffiliateCode>XX0000</AffiliateCode> <AffRequestId>XX</AffRequestId> <AffRequestTime>yyyy-mm-ddThh:mm:ss</AffRequestTime> </RequestInfo> <TotalNumber>XXXXX</TotalNumber> - <Hotels> - <Hotel> <HotelCode>XXXXXX</HotelCode> <OldHotelId>X/XXXXXXXX</OldHotelId> <HotelLocation>Location information</HotelLocation> <HotelInfo>Text detailed hotel description</HotelInfo> </Hotel> - <Hotel> .... </Hotel> .... </Hotels> </XMLResponse>

1.6 Hotels Amenities


The file contains information about hotel and room amenities for every hotel: 1. 2. 3. PAmenities list of property (hotel) amenities which are separated by symbol ; RAmenities list of room amenities which are separated by symbol ; RoomsNumber number of rooms in the hotel

XML format:
<?xml version="1.0" encoding="UTF-8" ?> - <XMLResponse> <ResponseType>HotelListResponse</ResponseType> - <RequestInfo> <AffiliateCode>XX0000</AffiliateCode> <AffRequestId>XX</AffRequestId> <AffRequestTime>yyyy-mm-ddThh:mm:ss</AffRequestTime> </RequestInfo> <TotalNumber>XXXXX</TotalNumber> - <Hotels> - <Hotel> <HotelCode>XXXXXX</HotelCode> <OldHotelId>X/XXXXXXXX</OldHotelId> <PAmenities>PAmenity1;PAmenity2;...;PAmenityN</PAmenities> <RAmenities>RAmenity1;RAmenity2;...;RAmenityN</RAmenities> <RoomsNumber>number of rooms</RoomsNumber> </Hotel> - <Hotel> ....
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 </Hotel> .... </Hotels> </XMLResponse>

Optimally XML affiliate might download XML-formatted hotel information once a month and update its own database. Received by this way XML-formated hotel information can be shown on clients own frontend system/site for helping customers to search, select and book hotels.

1.7 Multilingual Hotel Information


Hotelspro provides hotel information in Danish, Dutch, French, German, Italian, Japanese,Korean, Portugese, Russian, Spanish. The files are in csv format and the field order is as follows: Hotel Code Hotel Name Hotel Address Hotel Description Hotel Amenities Room Amenities File http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.da.zip http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.nl.zip http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.fr.zip http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.de.zip http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.it.zip http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.ja.zip http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.kr.zip http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.pt.zip http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.ru.zip http://static.hotelspro.com/xf_4.0/multi-lang/hotelinfo.es.zip

Language Danish Dutch French German Italian Japanese Korean Portugese Russian Spanish

Please note all the hotel data is not available in all languages. The hotel content in languages other than English are dependent on the info provided to us by hotels & suppliers.

1.8 Destination List


The file contains information for every city as: 1. 2. 3. 4. DestinationId - unique destination identifier in XML booking system; Country - Country Name City - City Name State - State Code
www.hotelspro.com

MetGlobal 2012 Author: Unal TASDIZEN

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

XML format
<?xml version="1.0" encoding="UTF-8" ?> - <XMLResponse> <ResponseType>DestinationListResponse</ResponseType> - <RequestInfo> <AffiliateCode>XX0000</AffiliateCode> <AffRequestId>XX</AffRequestId> <AffRequestTime>yyyy-mm-ddThh:mm:ss</AffRequestTime> </RequestInfo> <TotalNumber>XXXXX</TotalNumber> - <Destinations> - <Destination> <DestinationId>XXXX</DestinationId> <Country>Name of country</Country> <City>Name of city</City> <State>State Code</State> </Destination> - <Destination> .... </Destination> .... </ Destinations> </XMLResponse>

1.9 Multilingual Destination Information


Hotelspro provides destination information in Turkish, French, German, Chinese, Hungarian, Portugese, Russian, Polish. The files are in csv format and the field order is as follows: DestinationId Country City State File http://static.hotelspro.com/xf_4.0/multi-lang/destinationinfo.tr.zip http://static.hotelspro.com/xf_4.0/multi-lang/destinationinfo.fr.zip http://static.hotelspro.com/xf_4.0/multi-lang/destinationinfo.de.zip http://static.hotelspro.com/xf_4.0/multi-lang/destinationinfo.zh.zip http://static.hotelspro.com/xf_4.0/multi-lang/destinationinfo.hu.zip http://static.hotelspro.com/xf_4.0/multi-lang/destinationinfo.pt.zip http://static.hotelspro.com/xf_4.0/multi-lang/destinationinfo.ru.zip http://static.hotelspro.com/xf_4.0/multi-lang/destinationinfo.pl.zip

Language Turkish French German Chinese Hungarian Portugese Russian Polish

MetGlobal 2012 Author: Unal TASDIZEN

www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

2 Files Debuging
2.1 Overview
Together with this documentation you received the following files: WSDL file PHP sample project (HotelsPro WS)

2.2 WSDL file


The WSDL file contains the formal description of the web service in XML format. The latest version can be downloaded from http://api.hotelspro.com/4.1/hotel/b2bHotelSOAP.wsdl Please ensure that, you always work with the latest version. The following chart gives an overview of the defined operations, port types, bindings and services:

2.3 SOAP PHP sample project


The PHP sample project HotelsPro WS demonstrates the use of the methods and data types. 2.3.1 getAvailableHotel

2.3.1.1 PHP Code Sample :


<?php // create SOAP client object $client = new SoapClient("wsdl_hotel_path", array('trace' => 1)); try { $rooms = array(); // First Room $rooms[] = array(array("paxType" => "Adult")); // Second Room $rooms[] = array(array("paxType" => "Adult"), array("paxType" => "Ad ult"), array("paxType" => "Child", "age" => 8)); $filters = array(); $filters[] = array("filterType" => "hotelStar", "filterValue" => "3" ); $filters[] = array("filterType" => "resultLimit", "filterValue" => " 5");
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 // make getAvailableHotel request (start search) $checkAvailability = $client->getAvailableHotel("apiKey", "RHMK", "2 011-04-20", "2011-04-22", "EUR", "UK", "false", $rooms, $filters); } catch (SoapFault $exception) { echo $exception->getMessage(); exit; } ?> responseId: <?php echo $checkAvailability->responseId?><br/> searchId: <?php echo $checkAvailability->searchId?><br/> totalFound: <?php echo $checkAvailability->totalFound?><br/> <table border="1"> <thead> <tr> <th>processId</th> <th>hotelCode</th> <th>availabilityStatus</th> <th>totalPrice</th> <th>totalTax</th> <th>currency</th> <th>boardType</th> <th>Room Data</th> </tr> </thead> <tbody> <?php if (is_object($checkAvailability->availableHotels)) { $hotelResponse[] = $checkAvailability->availableHotels; } else { $hotelResponse = $checkAvailability->availableHotels; } foreach ((array)$hotelResponse as $hnum => $hotel) { ?> <tr> <td><?php echo $hotel->processId?></td> <td><?php echo $hotel->hotelCode?></td> <td><?php echo $hotel->availabilityStatus?></td> <td><?php echo $hotel->totalPrice?></td> <td><?php echo $hotel->totalTax?></td> <td><?php echo $hotel->currency?></td> <td><?php echo $hotel->boardType?></td> <td> <?php if (is_object($hotel->rooms)) { $roomResponse[] = $hotel; } else { $roomResponse = $hotel->rooms; } foreach ((array)$roomResponse as $rnum => $room) { ?>
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 <table border="1" style="margin: 10px; width: 300px; float: left;"> <tr> <td><b>Room <?php echo($rnum + 1);?> Category</b></td> <td><?php echo $room->roomCategory;?></td> </tr> <tr> <td><b>Total Room Rate</b></td> <td><?php echo $room->totalRoomRate;?></td> </tr> <tr> <td><b>Paxes</b></td> <td> <?php if (is_object($room->paxes)) { $roomsInfo[] = $room->paxes; } else { $roomsInfo = $room->paxes; } if (is_object($room->ratesPerNight)) { $ratesPerNight[] = $room->ratesPerNight; } else { $ratesPerNight = $room->ratesPerNight; } foreach ((array)$roomsInfo as $pnum => $pax) { echo $pax->paxType . " (" . $pax->age . ")<br/>"; } ?> </td> </tr> <tr> <td><b>ratesPerNight</b></td> <td> <?php foreach ((array)$ratesPerNight as $rpnum => $price) { echo $price->date; ?> (<?php echo $price->amount;?>)<br/> <?php } ?> </td> </tr> </table> <?php unset($ratesPerNight); unset($roomsInfo); } unset($roomResponse); ?> </td> </tr> <?php }
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 ?> </tbody> </table>

2.3.2

allocateHotelCode

2.3.2.1 PHP Code Sample:


<?php $client = new SoapClient($GLOBALS["wsdl_hotel_path"], array('trace' => 1 )); try { $allocateHotelCode = $client->allocateHotelCode("apiKey", $searchId, $hotelCode); } catch (SoapFault $exception) { $exception->getMessage(); exit; } ?> responseId: <?php echo $allocateHotelCode->responseId?><br/> searchId: <?php echo $allocateHotelCode->searchId?><br/> hotelCode: <?php echo $allocateHotelCode->hotelCode?><br/> <table border="1"> <thead> <tr> <th>processId</th> <th>availabilityStatus</th> <th>totalPrice</th> <th>totalTax</th> <th>currency</th> <th>boardType</th> <th>Room Data</th> </tr> </thead> <tbody> <?php if (is_object($allocateHotelCode->availableHotels)) { $availableHotels[] = $allocateHotelCode->availableHotels; } else { $availableHotels = $allocateHotelCode->availableHotels; } foreach ($availableHotels as $hnum => $hotel) { ?> <tr> <td><?php echo $hotel->processId?>&nbsp;</td> <td><?php echo $hotel->availabilityStatus?>&nbsp;</td> <td><?php echo $hotel->totalPrice?>&nbsp;</td> <td><?php echo $hotel->totalTax?>&nbsp;</td> <td><?php echo $hotel->currency?>&nbsp;</td> <td><?php echo $hotel->boardType?>&nbsp;</td>
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 <td> <?php if (is_object($hotel->rooms)) { $roomResponse[] = $hotel->rooms; } else { $roomResponse = $hotel->rooms; } foreach ((array)$roomResponse as $rnum => $room) { ?> <table border="1" style="margin: 10px; width: 300px; float: left;" > <tr> <td><b>Room <?php echo($rnum + 1);?> Category</b></td> <td><?php echo $room->roomCategory;?>&nbsp;</td> </tr> <tr> <td><b>Total Room Rate</b></td> <td><?php echo $room->totalRoomRate;?>&nbsp;</td> </tr> <tr> <td><b>Paxes</b></td> <td> <?php if (is_object($room->paxes)) { $roomsInfo[] = $room->paxes; } else { $roomsInfo = $room->paxes; } if (is_object($room->ratesPerNight)) { $ratesPerNight[] = $room->ratesPerNight; } else { $ratesPerNight = $room->ratesPerNight; } foreach ((array)$roomsInfo as $pnum => $pax) { ?> <?php echo $pax->paxType;?> (<?php echo $pax->age;?>)<br/> <?php } ?> </td> </tr> <tr> <td><b>ratesPerNight</b></td> <td> <?php foreach ((array)$ratesPerNight as $rpnum => $price) { ?> <?php echo $price->date;?> (<?php echo $price->amount;? >)<br/> <?php } ?> </td>
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 </tr> </table> <?php unset($ratesPerNight); unset($roomsInfo); } unset($roomResponse); ?> </td> </tr> <?php } ?> </tbody> </table>

2.3.3

makeHotelBooking

2.3.3.1 PHP Code Sample:


<?php $client = new SoapClient("wsdl_hotel_path", array('trace' => 1)); try { // lead traveller $leadTravellerInfo = array(); $paxInfo = array("paxType" => "Adult", "title" => "Mr", "firstName" => "John", "lastName" => "TEST"); $leadTravellerInfo["paxInfo"] = $paxInfo; $leadTravellerInfo["nationality"] = "UK"; $otherTravellerInfo = array(); $otherTravellerInfo[] = array("title" => "Mr", "firstName" => "Mark" , "lastName" => "TEST"); $otherTravellerInfo[] = array("title" => "Ms", "firstName" => "Jane" , "lastName" => "TEST"); $otherTravellerInfo[] = array("title" => "Mr", "firstName" => "Baby" , "lastName" => "TEST"); $preferences = "nonSmoking"; $note = ""; $agencyReferenceNumber = ''; $makeHotelBooking = $client->makeHotelBooking("apiKey", $processId, $agencyReferenceNumber, $leadTravellerInfo, $otherTravellerInfo, $preferen ces, $note); $hotel = $makeHotelBooking->hotelBookingInfo; $rooms = is_array($hotel->rooms) ? $hotel->rooms : array($hotel>rooms); $policies = is_array($hotel->cancellationPolicy) ? $hotel>cancellationPolicy : array($hotel->cancellationPolicy);
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 } catch (SoapFault $exception) { echo $exception->getMessage(); exit; } ?> responseId: <?php echo $makeHotelBooking->responseId?><br/> trackingId: <?php echo $makeHotelBooking->trackingId?><br/> <table border="1"> <thead> <tr> <th>bookingStatus</th> <th>checkIn</th> <th>checkOut</th> <th>boardType</th> <th>Room Data</th> <th>cancellationPolicy</th> <th>comments</th> </tr> </thead> <tbody> <?php if (false == empty($hotel)) { ?> <tr> <td><?php echo $hotel->bookingStatus;?></td> <td><?php echo $hotel->checkIn;?></td> <td><?php echo $hotel->checkOut;?></td> <td><?php echo $hotel->boardType;?></td> <td> <?php foreach ($rooms as $room) { ?> <table border="1" style="margin: 10px; width: 350px; float: left;" > <tr> <td><b>Room <?php echo($room + 1);?> Category</b></td> <td><?php echo $room->roomCategory;?>&nbsp;</td> </tr> <tr> <td><b>Total Room Rate</b></td> <td><?php echo $room->totalRoomRate;?></td> </tr> <tr> <td><b>Paxes</b></td> <td> <?php $paxes = is_array($room->paxes) ? $room->paxes : array($room>paxes); ?> <?php foreach ($paxes as $pax) {
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 ?> <?php echo "{$pax->title} $pax->firstName $pax>lastName - {$pax->paxType}"; ?> (<?php echo $pax->age;?>)<br/> <?php } ?> </td> </tr> <tr> <td><b>ratesPerNight</b></td> <td> <?php $prices = is_array($room->ratesPerNight) ? $room->ratesPerNight : array($room->ratesPerNight); ?> <?php foreach ($prices as $price) { ?> <?php echo $price->date; ?> (<?php echo $price->amount;?>)<br/> <?php } ?> </td> </tr> </table> <?php } ?> </td> <td> <table border="1"> <thead> <tr> <th>Days</th> <th>feeType</th> <th>feeAmount</th> <th>currency</th> <th>remarks</th> </tr> </thead> <tbody> <?php foreach ($policies as $policy) { ?> <tr> <td><?php <td><?php <td><?php <td><?php
MetGlobal 2012 Author: Unal TASDIZEN

echo echo echo echo

$policy->cancellationDay;?>&nbsp;</td> $policy->feeType;?>&nbsp;</td> $policy->feeAmount;?>&nbsp;</td> $policy->currency; ?>&nbsp;</td>


www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 <td><?php echo $policy->remarks; ?>&nbsp;</td> </tr> <?php } ?> </tbody> </table> </td> <td><?php echo $hotel->comments;?>&nbsp;</td> </tr> <?php } ?> </tbody> </table>

2.3.4

getHotelBookingStatus

2.3.4.1 PHP Code Sample:


<?php $client = new SoapClient("wsdl_hotel_path", array('trace' => 1)); try { $getHotelBookingStatus = $client->getHotelBookingStatus("apiKey", $t rackingId); } catch (SoapFault $exception) { echo $exception->getMessage(); exit; } ?> responseId: <?php echo $getHotelBookingStatus->responseId?><br/> trackingId: <?php echo $getHotelBookingStatus->trackingId?><br/> <table border="1"> <thead> <tr> <th colspan="10">Book Info</th> </tr> <tr> <th>bookingStatus</th> <th>confirmationNumber</th> <th>hotelCode</th> <th>checkIn</th> <th>checkOut</th> <th>totalPrice</th> <th>currency</th> <th>boardType</th> <th>agencyReferenceNumber</th> <th>comments</th> </tr>
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 </thead> <tbody> <tr> <td><?php echo $getHotelBookingStatus->hotelBookingInfo>bookingStatus;?>&nbsp;</td> <td><?php echo $getHotelBookingStatus->hotelBookingInfo>confirmationNumber;?>&nbsp;</td> <td><?php echo $getHotelBookingStatus->hotelBookingInfo->hotelCode; ?>&nbsp;</td> <td><?php echo $getHotelBookingStatus->hotelBookingInfo->checkIn; ?>&nbsp;</td> <td><?php echo $getHotelBookingStatus->hotelBookingInfo->checkOut; ?>&nbsp;</td> <td><?php echo $getHotelBookingStatus->hotelBookingInfo->totalPrice; ?>&nbsp;</td> <td><?php echo $getHotelBookingStatus->hotelBookingInfo->currency; ?>&nbsp;</td> <td><?php echo $getHotelBookingStatus->hotelBookingInfo->boardType; ?>&nbsp;</td> <td><?php echo $getHotelBookingStatus->hotelBookingInfo>agencyReferenceNumber; ?>&nbsp;</td> <td><?php echo $getHotelBookingStatus->hotelBookingInfo->comments; ?>&nbsp;</td> </tr> <tbody> </table> <table border="1"> <thead> <tr> <th colspan="5">Pax List</th> </tr> <tr> <th>Pax Type</th> <th>Title</th> <th>Name</th> <th>LastName</th> <th>Age</th> </tr> </thead> <tbody> <?php $rooms = is_array($getHotelBookingStatus->hotelBookingInfo->rooms) ? $ge tHotelBookingStatus->hotelBookingInfo : array($getHotelBookingStatus>hotelBookingInfo); foreach ($rooms as $room) { $paxes = is_array($room->paxes) ? $room->paxes : array($room>paxes); foreach ($paxes as $pax) { ?> <tr> <td><?php echo $pax->paxType;?>&nbsp;</td>
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 <td><?php <td><?php <td><?php <td><?php </tr> <?php } } ?> echo echo echo echo $pax->title;?>&nbsp;</td> $pax->firstName;?>&nbsp;</td> $pax->lastName;?>&nbsp;</td> $pax->age;?>&nbsp;</td>

<table border="1"> <thead> <tr> <th colspan="5">Price Per Night</th> </tr> </thead> <tbody> <?php foreach ($rooms as $roomId => $room) { $prices = is_array($room->ratesPerNight) ? $room->ratesPerNight : ar ray($room->ratesPerNight); ?> <tr> <th>Room <?=$roomId + 1;?></th> <th>Day</th> <th>Amount</th> </tr> <?php foreach ($prices as $price) { ?> <tr> <td>&nbsp;</td> <td><?php echo $price->date;?>&nbsp;</td> <td><?php echo $price->amount;?>&nbsp;</td> </tr> <?php } } ?> <table border="1"> <thead> <tr> <th colspan="4">Cancellation Policy</th> </tr> <tr> <th>cancellationDay</th> <th>feeType</th> <th>feeAmount</th> <th>currency</th> <th>remarks</th> </tr> </thead>
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 <tbody> <?php $policies = is_array($getHotelBookingStatus->hotelBookingInfo>cancellationPolicy) ? $getHotelBookingStatus->hotelBookingInfo>cancellationPolicy : array($getHotelBookingStatus->hotelBookingInfo>cancellationPolicy); foreach ($policies as $policy) { ?> <tr> <td><?php echo $policy->cancellationDay;?>&nbsp;</td> <td><?php echo $policy->feeType;?>&nbsp;</td> <td><?php echo $policy->feeAmount;?>&nbsp;</td> <td><?php echo $policy->currency;?>&nbsp;</td> <td><?php echo $policy->remarks;?>&nbsp;</td> </tr> <?php } ?> </tbody> </table>

2.3.5

cancelHotelBooking

2.3.5.1 PHP Code Sample:


<?php $client = new SoapClient("wsdl_hotel_path", array('trace' => 1)); try { $cancelHotelBooking = $client->cancelHotelBooking("apiKey", $trackingId); } catch (SoapFault $exception) { echo $exception->getMessage(); exit; } ?> responseId: <?php echo $cancelHotelBooking->responseId?><br/> trackingId: <?php echo $cancelHotelBooking->trackingId?><br/> <table border="1"> <thead> <tr> <th>agencyReferenceNumber</th> <th>bookingStatus</th> <th>note</th> </tr> </thead> <tbody> <tr> <td><?php echo $cancelHotelBooking->agencyReferenceNumber;? >&nbsp;</td> <td><?php echo $cancelHotelBooking->bookingStatus;?>&nbsp;</td>
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 <td><?php echo $cancelHotelBooking->note;?>&nbsp;</td> </tr> <tbody> </table>

2.3.6

getHotelCancellationPolicy

2.3.6.1 PHP Code Sample:


<?php $client = new SoapClient("wsdl_hotel_path", array('trace' => 1));

try { $getHotelCancellationPolicy = $client>getHotelCancellationPolicy("apiKey", $processId); } catch (SoapFault $exception) { echo $exception->getMessage(); exit; } ?> responseId: <?php echo $getHotelCancellationPolicy->responseId?><br/> processId: <?php echo $processId?><br/> <?php } ?> <table border="1"> <thead> <tr> <th>cancellationDay</th> <th>feeType</th> <th>feeAmount</th> <th>currency</th> <th>remarks</th> </tr> </thead> <tbody> <?php $policies = is_array($getHotelCancellationPolicy->cancellationPolicy) ? $g etHotelCancellationPolicy->cancellationPolicy : array ($getHotelCancellationPolicy->cancellationPolicy); foreach ($policies as $policy) { ?> <tr> <td><?php echo $policy->cancellationDay;?>&nbsp;</td> <td><?php echo $policy->feeType;?>&nbsp;</td> <td><?php echo $policy->feeAmount;?>&nbsp;</td> <td><?php echo $policy->currency;?>&nbsp;</td> <td><?php echo $policy->remarks;?>&nbsp;</td> </tr> <?php
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 } ?> </tbody> </table>

2.3.7

amendHotelBooking

2.3.7.1 PHP Code Sample:


<?php $client = new SoapClient("wsdl_hotel_path", array('trace' => 1)); try { // lead traveller $leadTravellerInfo = array(); $paxInfo = array("paxType" => "Adult", "title" => "Mr", "firstName" => "John", "lastName" => "TEST"); $leadTravellerInfo["paxInfo"] = $paxInfo; $leadTravellerInfo["nationality"] = "UK"; $rooms = array(); $rooms [] = array(array("paxType" => "Adult", "title" => "Mr", "firstName" => "Ma rk", "lastName" => "TEST"), array("paxType" => "Child", "title" => "Mr", " firstName" => "Baby", "lastName" => "TEST", "age" => 2), array("paxType" = > "Child", "title" => "Ms", "firstName" => "Baby2", "lastName" => "TEST", "age" => 1) ); $rooms [] = array(array("paxType" => "Adult", "title" => "Ms", "firstName" => "Ja ne", "lastName" => "TEST"), array("paxType" => "Adult", "title" => "Mr", " firstName" => "Brad", "lastName" => "TEST")); $preferences = "nonSmoking"; $note = "test"; $amendHotelBooking = $client->amendHotelBooking("apiKey", $trackingI d, "2011-11-15", "2011-11-17", $leadTravellerInfo, $rooms, $preferences, $ note); } catch (SoapFault $exception) { echo $exception->getMessage(); exit; } ?> responseId: <?php echo $amendHotelBooking->responseId?><br/> trackingId: <?php echo $amendHotelBooking->trackingId?><br/> <table border="1"> <thead> <tr> <th>amendStatus</th>
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 <th>note</th> </tr> </thead> <tbody> <tr> <td><?php echo $amendHotelBooking->amendStatus;?>&nbsp;</td> <td><?php echo $amendHotelBooking->note;?>&nbsp;</td> </tr> <tbody> </table>

2.3.8

getBalance

2.3.8.1 PHP Code Sample:


<?php $client = new SoapClient("wsdl_hotel_path", array('trace' => 1)); try { $getBalance = $client->getBalance("apiKey"); } catch (SoapFault $exception) { echo $exception->getMessage(); exit; } ?> Deposit Currency : <?php echo $getBalance->currency?><br/> Total Deposit: <?php echo $getBalance->totalDeposit?><br/> Total Booking Amount: <?php echo $getBalance->totalBookingAmount ?><br/> Currenct Balance: <?php echo $getBalance->currentBalance?><br/>

2.4 JSON sample project


The json sample project HotelsPro WS demonstrates the use of the methods and data types. 2.4.1 getAvailableHotel

2.4.1.1 JSON Request Sample :


http://api.hotelspro.com/4.1_test/hotel/b2bHotelJSON.php? method=getAvailableHotel&apiKey=eGFMWDBjYmVqcnFPNFpQMHBsVytlaUhGNzR6dkFBcU 1xRXl3WkcrV0hLdTlLSzVZT3NyYXFDZlc5a0xOQWtoWg==&destinationId=LD6J&checkIn= 2011-04-20&checkOut=2011-0424&currency=EUR&clientNationality=UK&onRequest=false&rooms[0][0] [paxType]=Adult&rooms[0][1][paxType]=Adult&rooms[0][2] [paxType]=Child&rooms[0][2][age]=6&rooms[1][0][paxType]=Adult&rooms[1][1] [paxType]=Adult&rooms[1][2][paxType]=Child&rooms[1][2][age]=8&filters[0] [filterType]=hotelStar&filters[0][filterValue]=3&filters[1] [filterType]=resultLimit&filters[1][filterValue]=10
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

2.4.2

allocateHotelCode

2.4.2.1 JSON Request Sample:


http://api.hotelspro.com/4.1_test/hotel/b2bHotelJSON.php? method=allocateHotelCode&apiKey=eGFMWDBjYmVqcnFPNFpQMHBsVytlaUhGNzR6dkFBcU 1xRXl3WkcrV0hLdTlLSzVZT3NyYXFDZlc5a0xOQWtoWg==&searchId=IG73375984&hotelCode=UKIRET

2.4.3

makeHotelBooking

2.4.3.1 JSON Request Sample:


http://api.hotelspro.com/4.1_test/hotel/b2bHotelJSON.php? method=makeHotelBooking&apiKey=eGFMWDBjYmVqcnFPNFpQMHBsVytlaUhGNzR6dkFBcU1 xRXl3WkcrV0hLdTlLSzVZT3NyYXFDZlc5a0xOQWtoWg==&processId=HG52628524&agencyReferenceNumber=&leadTravellerInfo[paxInfo] [paxType]=Adult&leadTravellerInfo[paxInfo] [title]=Mr&leadTravellerInfo[paxInfo] [firstName]=John&leadTravellerInfo[paxInfo] [lastName]=DOE&leadTravellerInfo[nationality]=UK&otherTravellerInfo[0] [title]=Mr&otherTravellerInfo[0][firstName]=Ahmetr&otherTravellerInfo[0] [lastName]=AY&otherTravellerInfo[1][title]=Mr&otherTravellerInfo[1] [firstName]=Mehmet&otherTravellerInfo[1] [lastName]=YILDIZ&preferences=nonSmoking&note=test%20note

2.4.4

getHotelBookingStatus

2.4.4.1 JSON Request Sample:


http://api.hotelspro.com/4.1_test/hotel/b2bHotelJSON.php? method=getHotelBookingStatus&apiKey=eGFMWDBjYmVqcnFPNFpQMHBsVytlaUhGNzR6dk FBcU1xRXl3WkcrV0hLdTlLSzVZT3NyYXFDZlc5a0xOQWtoWg==&trackingId=XI-HV67353988

2.4.5

cancelHotelBooking

2.4.5.1 JSON Request Sample:


http://api.hotelspro.com/4.1_test/hotel/b2bHotelJSON.php? method=cancelHotelBooking&apiKey=eGFMWDBjYmVqcnFPNFpQMHBsVytlaUhGNzR6dkFBc U1xRXl3WkcrV0hLdTlLSzVZT3NyYXFDZlc5a0xOQWtoWg==&trackingId=XI-HY-23449598

2.4.6

getHotelCancellationPolicy

2.4.6.1 JSON Request Sample:


http://api.hotelspro.com/4.1_test/hotel/b2bHotelJSON.php? method=getHotelCancellationPolicy&apiKey=eGFMWDBjYmVqcnFPNFpQMHBsVytlaUhGN zR6dkFBcU1xRXl3WkcrV0hLdTlLSzVZT3NyYXFDZlc5a0xOQWtoWg==&trackingId=XI-HG52628524

MetGlobal 2012 Author: Unal TASDIZEN

www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

2.4.7

amendHotelBooking

2.4.7.1 JSON Request Sample:


http://api.hotelspro.com/4.1_test/hotel/b2bHotelJSON.php? method=amendHotelBooking&apiKey=eGFMWDBjYmVqcnFPNFpQMHBsVytlaUhGNzR6dkFBcU 1xRXl3WkcrV0hLdTlLSzVZT3NyYXFDZlc5a0xOQWtoWg==&trackingId=XI-HV67353988&checkIn=2011-11-15&checkOut=2011-11-17&leadTravellerInfo[paxInfo] [paxType]=Adult&leadTravellerInfo[paxInfo] [title]=Mr&leadTravellerInfo[paxInfo] [firstName]=John&leadTravellerInfo[paxInfo] [lastName]=DOE&leadTravellerInfo[nationality]=UK&rooms[0][0] [paxType]=Adult&rooms[0][0][title]=Mr&rooms[0][0][firstName]=test&rooms[0] [0][lastName]=test&rooms[0][1][paxType]=Child&rooms[0][1] [title]=Mr&rooms[0][1][firstName]=test3&rooms[0][1] [lastName]=test3&rooms[0][1][age]=2&rooms[0][1][paxType]=Child&rooms[0][1] [title]=Mr&rooms[0][1][firstName]=test4&rooms[0][1] [lastName]=test4&rooms[0][1][age]=1&rooms[1][0][paxType]=Adult&rooms[1][0] [title]=Mr&rooms[1][0][firstName]=test5&rooms[1][0] [lastName]=test5&rooms[1][1][paxType]=Adult&rooms[1][1][title]=Mr&rooms[1] [1][firstName]=test2&rooms[1][1] [lastName]=test2&preferences=nonSmoking&note=test%20note

2.4.8

getBalance

2.4.8.1 JSON Request Sample:


http://api.hotelspro.com/4.1_test/hotel/b2bHotelJSON.php? method=getBalance&apiKey=eGFMWDBjYmVqcnFPNFpQMHBsVytlaUhGNzR6dkFBcU1xRXl3W kcrV0hLdTlLSzVZT3NyYXFDZlc5a0xOQWtoWg==

MetGlobal 2012 Author: Unal TASDIZEN

www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

3 Methods in detail
3.1 General functions
3.1.1 getAvailableHotel

getAvailableHotel method allows the client to get a list of hotels that are available in a city according to search criteria provided by the client. The method allows the client to check availability of a single hotel or all hotels in a city. Please note that getAvailableHotel method contains cached availability and rates. In order to get exact hotel rate allocateHotelCode method must be used (see next method). 3.1.1.1 Request
Variable apikey destinationId checkIn checkOut currency clientNationality onRequest Type String String Date Date String String Bool Description Api key taken from the interface identifier of destination check-in date in format yyyy-mm-dd; check-out date in format yyyy-mm-dd; currency ISO code (it can be EUR, USD or GBP; if sent currency code is different, then response will contain rates in default currency EUR); Code of country (2 chars) this criteria allows the client to get only available hotels with instant confirmation; or available hotels with instant confirmation and available on-request hotels; if onRequest = false then only instant confirmation hotels will be returned in response; if onRequest = true then instant confirmation and on request hotels will be returned in response; Array of pax elements array Array of filter elements Mandatory Yes Yes Yes Yes No Default: EUR Yes No Default: true

rooms filters

Array Array

Yes No

3.1.1.2 Response
Variable responseId searchId totalFound availableHotels Type Int. String Int. Array Description Id of response for debugging Unique id for this availability session Total number of found available hotels Array of hotel elements Mandatory Yes Yes Yes Yes

MetGlobal 2012 Author: Unal TASDIZEN

www.hotelspro.com

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

3.1.2

allocateHotelCode

allocateHotelCode method allows the client to get rates and availability for selected hotel from getAvailableHotel response. Please note that allocateHotelCode method must be used before making booking in order to get exact hotel rate. 3.1.2.1 Request
Variable apiKey searchId hotelCode Type String String String Description Api key taken from the interface unique HotelsPro SEARCH reference received in getAvailableHotel Hotel identifier Mandatory Yes Yes Yes

3.1.2.2 Response
Variable responseId searchId hotelCode availableHotels Type Int. String String Array Description Id of response for debugging Unique id for this availability session Hotel identifier Array of Hotel Element Mandatory Yes Yes Yes Yes

3.1.3

makeHotelBooking

Purpose of this method is to make booking for the selected hotel in allocateHotelCode method. Please note: We strongly recommend to use getHotelCancellationPolicy method for getting detailed infomation about cancellation policy and cancellation penalty before makeHotelBooking method. 3.1.3.1 Request
Variable apiKey processId agencyReference Number leadTravellerInfo otherTravellerInfo preferences note Type String String String Element Array String String Description Api key taken from the interface unique identifier of search result from allocateHotelCode Response Agencys booking reference number leadTraveller element Array of pax elements array smoking/nonSmoking Note for the booking Mandatory Yes Yes No Yes No if single pax No No

3.1.3.2 Response
Variable responseId trackingId Type Int. String Description Id of response for debugging unique HotelsPro booking reference (this reference will be required in XML request for operations with the booking); if first 2 letters of it are HR - booking is OnRequest; if first 2 letters of it are XI - booking is InstantConfirmation
www.hotelspro.com

Mandatory Yes Yes

MetGlobal 2012 Author: Unal TASDIZEN

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 hotelBookingInfo Element bookInfo Element Yes

3.1.4

getHotelBookingStatus

If a booking was made as OnRequest booking then the client needs to know if the booking was confirmed or rejected by the hotel. In this case the client should use getHotelBookingStatus method. Also this method can return all details of the booking, not just the status. 3.1.4.1 Request
Variable apiKey trackingId Type String String Description Api key taken from the interface Unique HotelsPro booking reference Mandatory Yes Yes

3.1.4.2 Response
Variable responseId trackingId agencyReferenceNumber hotelBookingInfo Type Int. String String Element Description Id of response for debugging Unique HotelsPro booking reference Agencys booking reference number bookInfo element Mandatory Yes Yes No Yes

3.1.5

cancelHotelBooking

Booking cancellation allows the client to cancel any booking previously made through HotelsPro XML booking system. Please note: booking cancellation cannot be made on or after CheckIn date. 3.1.5.1 Request
Variable apiKey trackingId Type String String Description Api key taken from the interface Unique HotelsPro booking reference Mandatory Yes Yes

3.1.5.2 Response
Variable responseId trackingId agencyReferenceNumber bookingStatus Type Int. String String String Description Id of response for debugging unique HotelsPro booking reference received in MakeHotelBookingResponse; Agencys booking reference number status of cancellation: it can be Cancelled or Cancellation Processing; If status is Cancelled it means that the booking was cancelled successfully. If status is Cancellation Processing it means that: 1) the booking could not be cancelled immediately, but cancellation request is received by HotelsPro specialists, they will cancel the booking and send confirmation mail to the client; 2) cancellation is being made after the cancellation period of this booking (after the deadline) (a cancellation charge of at least one night stay will occur), such cancellation can not
www.hotelspro.com Document Status: Live

Mandatory Yes Yes No Yes

MetGlobal 2012 Author: Unal TASDIZEN

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 note String be done. note of cancellation. If CancellationStatus is Cancelled then in Note it will be written as Booking has been cancelled successfully. If CancellationStatus is Cancellation Processing then in Note it will be written as Your cancellation request has been received or Your cancellation request has been received. Cancellation is being made within the cancellation period for this booking. A cancellation charge of at least one night stay will occur. No

3.1.6

getHotelCancellationPolicy

getHotelCancellationPolicy method allows the client to get detailed information about cancellation policy and cancellation penalty for selected hotel. 3.1.6.1 Request
Variable apiKey trackingId Type String String Description Api key taken from the interface unique HotelsPro booking reference received in MakeHotelBookingResponse; or processId received in allocateHotelCode response. Mandatory Yes Yes

3.1.6.2 Response
Variable responseId trackingId agencyReferenceNumber cancellationPolicy Type Int. String String Array Description Id of response for debugging unique HotelsPro booking reference; Agencys booking reference number Array of policy Mandatory Yes Yes No Yes

3.1.7

amendHotelBooking

amendHotelBooking method allows the client to amend any booking previously made through HotelsPro XML booking system. Please note: Booking amendment cannot be made on or after CheckIn date. 3.1.7.1 Request
Variable apiKey trackingId checkIn checkOut leadTraverllerInfo rooms preferences note Type String String Date Date Element Array String String Description Api key taken from the interface unique HotelsPro booking reference received in MakeHotelBookingResponse; check-in date in format yyyy-mm-dd; check-out date in format yyyy-mm-dd; leadTraveller Element Array of pax elements array smoking/nonSmoking Notes for amendment request Mandatory Yes Yes Yes Yes Yes Yes No No

3.1.7.2 Response
Variable
MetGlobal 2012 Author: Unal TASDIZEN

Type
www.hotelspro.com

Description

Mandatory

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 responseId trackingId agencyReferenceNumber amendStatus Note Int. String String Enum String Id of response for debugging unique HotelsPro booking reference Agencys booking reference number The value will be Pending for all amenment requests amendment note: Your amendment request has been received. You will be contacted regarding amendment results by email or by message in our online system. Yes Yes No Yes No

3.1.8

getBalance

getBalance method allows the client to get information about current account balance (This method can be used only by agencies who work with Deposit payment method). 3.1.8.1 Request
Variable apiKey Type String Description Api key taken from the interface Mandatory Yes

3.1.8.2 Response
Variable responseId Currency totalDeposit totalBookingAmount currentBalance Type Int. String Float Float Float Description Id of response for debugging Balance currency Total amount of deposit Total amount of bookings Current account balance Mandatory Yes Yes Yes Yes Yes

3.2 Elements
3.2.1
Variable paxType age title firstName lastName

pax Element
Type Enum Int. String String String Description Child/Adult Age of pax Title of pax Firstname of pax Lastname of pax Mandatory Yes Yes if pax type is child, No for rest No for getAvailableHotel method, Yes for rest (Types: Mr, Ms, Mrs, Miss) No for getAvailableHotel method, Yes for rest No for getAvailableHotel method, Yes for rest

3.2.2

leadTraveller Element
Type Element String Description pax Element Client nationality Mandatory Yes Yes

Variable paxInfo nationality

3.2.3

filter Element
Type Enum String Description hotelCode / hotelName / hotelStar / boardType / Limit Mandatory Yes Yes

Variable filterType filterValue

3.2.4
Variable

hotel Element
Type Description
www.hotelspro.com

Mandatory

MetGlobal 2012 Author: Unal TASDIZEN

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 processId hotelCode availabilityStatus specialDeal String String Enum Int. unique identifier of search result for the hotel. If the client wants to book the hotel, this identifier needs to be sent in book request Hotel identifier status of hotel availability: it can be InstantConfirmation or OnRequest; Code for special deal Code Explanation 2 3 4 5 6 7 8 9 10 11 12 totalPrice totalTax currency boardType rooms Float Float String String Array Special Discount Special Offer Board Type Upgrade Free Transportation Free Parking Free Upgrade Free Meal Free Child Free Person Early Booking Discount Free Night Yes No Default: 0 Yes Yes Yes Yes Yes Yes No

total price for all nights of the stay including all taxes and fees; amount of taxes and fees (it is included in TotalPrice); Iso code currency of totalPrice type of board (for example Room Only, Bed and Breakfast), it shows what is included in total price of the stay Array of roomResponse Element

3.2.5

roomResponse Element
Type String Array Float Array Description text description of room category, it can be Standard Room, Deluxe Room and etc.; Array of pax elements array total rate for the room for all nights of the stay including all taxes and fees; Array of dailyRate element Mandatory Yes Yes Yes Yes

Variable roomCategory paxes totalRoomRate ratesPerNight

3.2.6
Variable date amount

dailyRate Element
Type Date Float Description date of night of the stay Rate for the room for the night including all taxes and fees Mandatory Yes Yes

3.2.7

bookInfo Element
Type Enum Description status of booking; it can be:
www.hotelspro.com

Variable bookingStatus

Mandatory Yes

MetGlobal 2012 Author: Unal TASDIZEN

31

Document Status: Live

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0 confirmed booking, on request booking, rejected booking, cancelled booking, payment processing confirmation number (please be sure that this number is printed on a customer voucher) Supplier name identifier of booked hotel check-in date in format yyyy-mm-dd check-out date in format yyyy-mm-dd total price for all nights of the stay including all taxes and fees currency ISO code type of board (for example Room Only, Bed and Breakfast), it shows what is included in total price of the stay Array of pax elements array Array of policy element XML affiliates booking reference number. GetBookingStatus response will contain the same value of AgencyReferenceNumber which were sent in MakeHotelBooking request. Comments of booking

1 2 3 4 5

confirmationNumber supplier hotelCode checkIn checkOut totalPrice currency boardType rooms cancellationPolicy agencyReferenceNumber

String String String Date Date Float String String Array Array String

Yes No Yes Yes Yes Yes Yes Yes Yes Yes No

comments

String

No

3.2.8

policy Element
Type Int. Enum Float String String Description Days of cancellation time Percent / Amount / Night Fee amount Currency ISO Code of total fee amount Remarks for policy element Mandatory Yes Yes Yes No No

Variable cancellationDay feeType feeAmount currency remarks

4 Appendix
4.1 List of error codes
501 - Invalid apikey 502 - Invalid currency code 503 - Invalid city code 504 - Invalid date format! Please use YYYY-mm-dd format. 505 - Check-in date can not be earlier than Check-out date 506 - City could not found! Please check your city code. 507 - Destination is not available.
MetGlobal 2012 Author: Unal TASDIZEN www.hotelspro.com Document Status: Live

31

Project Name: HotelsPro XML 4.1 Hotel Document Number / Version Number: v1.0

508 - Invalid onrequest type 509 - Invalid filter type 510 - Multiple hotelcode is not allowed 511 - Maximum number of hotelstar filter is 5 512 - Hotel star must be between 2 and 5 513 - Maximum number of board type filter is 8 514 - Hotel code could not find 515 - Hotel name could not find 516 - Multiple hotelname does not allow 517 - Invalid hotel name (it should be minimum: 3 characters, maximum: 50 characters) 518 - Incorrect CheckIn date (it can not be earlier today or later today+1year) 519 - Incorrect CheckOut date (it must be later CheckIn date) 520 - Hotel can not be reserved for more than 30 nights 521 - Please use your account's balance currency for CheckAvailability request 522 - Incorrect number of rooms in XML request (minimum: 1 room, maximum: 5 rooms) 523 - Invalid number of adults per room (maximum 6 adults per room) 524 - There must be at least 1 adult per room in the request 525 - Invalid number of paxes per room (maximum 6 paxes per room) 526 - Invalid number of children per room (maximum 4 children per room) 527 - Invalid nationality code 528 - Children ages are not defined in the request 529 - Invalid hotel code 530 - Invalid search code 531 - Invalid hotel code 532 - Empty or missed ProcessId 533 - Expired or incorrect ProcessId 534 - Invalid pax type 535 - Empty or missed pax name information 536 - Maximum number of result limit type filter is 1 537 - Result limit must be type of integer 538 - Empty or missed TrackingId 539 - Expired or incorrect TrackingId 540 - Invalid time format 541 - Invalid search id 542 - There is no search result with this hotel code 543 - Empty or missed Client information. 544 - Client nationality and user ip country can not be different 545 - Client Nationality can not be empty 546 - Empty or missed Other traveller information. 547 - Search pax count and book pax count must be equal 548 - Invalid preferences value in MakeHotelBooking XML request 556 - Dublicate hotel booking 557 - Affiliate's deposit is not enough to make the booking 558 - The affiliate doesn't have permission to make LastMinute bookings 560 - The affiliate doesn't have permission to make bookings for Non-Refundable Hotels 561 - Booking has been made by different affiliate 562 - Hotel booking amendment can not be made on or after CheckIn date 563 - Hotel booking has been cancelled already 564 - Hotel booking cancellation can not be made on or after CheckIn date 565 - Affiliate is not activated 566 - Affiliate is deactivated 567 - Affiliate doesn't have permission for this XML request type

MetGlobal 2012 Author: Unal TASDIZEN

www.hotelspro.com

31

Document Status: Live

Vous aimerez peut-être aussi