index

OTA_HotelRes

Instructions

general information

This function is based on the industry standards set by the OpenTravel alliance. Not all elements in the standard are supported.

Commit a booking by posting a OTA_HotelResRQ message to this endpoint, confirmation will be returned as an OTA_HotelResRS message. The XML must validate to schema version OTA2015A.

The post must be authorized using HTTP basic authorization. The username is the propid of the property and the password is set in the channel manager settings for this channel.

The HotelCode is the propid and the RoomTypeCode is the roomid.

Multiple RoomStays->RoomStay elements will create a booking group with each RoomStay being one booking in the group.

Multiple independent bookings or booking groups can be created specifying multiple HotelReservations->HotelReservation elements.

Reservations can be cancelled but not modified.

A sample OTA_HotelResRQ using PHP and curl with the supported OTA_HotelResRQ attributes follows.


<?php


$username = "3101"; //propid
$password = "mysecretpassword"; //set in OTA channel manager settings
$url = "http://soft.4twa.com/api/ota/OTA_HotelRes";
$echotoken = time();


$xml = '<OTA_HotelResRQ xmlns="http://www.opentravel.org/OTA/2003/05" EchoToken="'.$echotoken.'" ResStatus="Commit" Version="1.0">
<HotelReservations>
<HotelReservation>
<RoomStays>
<RoomStay>
<RoomTypes>
<RoomType RoomTypeCode="123454" NumberOfUnits="1" />
</RoomTypes>
<RoomRates>
<RoomRate BookingCode="abc">
<Rates>
<Rate>
<Total AmountBeforeTax="220.00" AmountAfterTax="220.00" CurrencyCode="GBP" />
</Rate>
</Rates>
</RoomRate>
</RoomRates>
<GuestCounts>
<GuestCount AgeQualifyingCode="10" Count="2" />
<GuestCount AgeQualifyingCode="8" Count="1" />
</GuestCounts>
<TimeSpan Start="2016-04-22" End="2016-04-26" />
<Guarantee>
<GuaranteesAccepted>
<GuaranteeAccepted>
<PaymentCard CardCode="VI" ExpireDate="0518">
<CardHolderName>test test</CardHolderName>
<CardNumber><PlainText>012345678012345678</PlainText></CardNumber>
<SeriesCode><PlainText>012</PlainText></SeriesCode>
</PaymentCard>
</GuaranteeAccepted>
</GuaranteesAccepted>
</Guarantee>
<DepositPayments>
<GuaranteePayment>
<AmountPercent Amount="150.00" CurrencyCode="GBP"/>
</GuaranteePayment>
</DepositPayments>
<ResGuestRPHs>1</ResGuestRPHs>
<SpecialRequests>
<SpecialRequest>
<Text Language="en">ddhdfh</Text>
</SpecialRequest>
</SpecialRequests>
</RoomStay>
</RoomStays>
<ResGuests>
<ResGuest ResGuestRPH="1" ArrivalTime="15:00:00">
<Profiles>
<ProfileInfo>
<Profile>
<Customer>
<PersonName>
<GivenName>test</GivenName>
<Surname>test2</Surname>
</PersonName>
<Telephone PhoneNumber="01616849586" />
<Email>[email protected]</Email>
<Address>
<AddressLine>Grate Rooms Ltd</AddressLine>
<AddressLine>22 Cheetham Road</AddressLine>
<CityName>Manchester</CityName>
<PostalCode>M4 4EW</PostalCode>
<CountryName Code="GB">UK</CountryName>
</Address>
</Customer>
</Profile>
</ProfileInfo>
</Profiles>
</ResGuest>
</ResGuests>
<ResGlobalInfo>
<HotelReservationIDs>
<HotelReservationID ResID_Type="5" ResID_Value="318379" />
</HotelReservationIDs>
<BasicPropertyInfo HotelCode="3103" />
</ResGlobalInfo>
</HotelReservation>
</HotelReservations>
</OTA_HotelResRQ>';


$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$return = curl_exec($ch);
curl_close($ch);

header ("Content-Type: text/xml; charset=utf-8");
echo $return;
?>



Sample XML for a cancellation, ResID_Value and HotelCode must be specified

<OTA_HotelResRQ xmlns="http://www.opentravel.org/OTA/2003/05" ResStatus="Cancel" Version="1.0"> <HotelReservations> <HotelReservation> <ResGlobalInfo> <HotelReservationIDs> <HotelReservationID ResID_Type="5" ResID_Value="318379" /> </HotelReservationIDs> <BasicPropertyInfo HotelCode="3103" /> </ResGlobalInfo> </HotelReservation> </HotelReservations> </OTA_HotelResRQ>