Sample Request and Response
The following samples are a typical request and response for a hotel booking made through the Hotel service, which is accessed through the Universal API copy system.
Note: Before sending a sample request, it is recommended to make a ping request first to test connectivity to Universal API without calling an actual functional request.
Variables in the samples are in bold.
Sample Request
Requests include an HTTP header and a SOAP envelope and that contains the SOAP endpoint (including the requested service), gzip status, Travelport credentials, and XML request. All requests must be TLS encrypted.
HTTP Header
The HTTP header includes:
- SOAP endpoints, which vary by:
- Geographical region.
- Requested service. In the preceding example, the HotelService is used for the endpoint; however, the service name is modified based on the request transaction.
-
gzip compression, which is optional, but strongly recommended. To accept gzip compression in the response, specify “Accept-Encoding: gzip,deflate” in the header.
- Authorization, which follows the standard basic authorization pattern.
- The text that follows “Authorization: Basic” can be encoded using Base 64. This functionality is supported by most programming languages.
- The syntax of the authorization credentials must include the prefix "Universal API/" before the User Name and Password assigned by Travelport.
- See HTTP Header Best Practices document in Travelport's Knowledge Base.
POST https://americas.universal-api.pp.travelport.com/
B2BGateway/connect/uAPI/HotelService HTTP/2.0
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Authorization: Basic Universal API/UserName:Password
Content-Length: length
SOAP Envelope Containing Request XML
The following request is for a one-room hotel booking for one adult for a three-night stay. The hotel reservation is guaranteed with a credit card.
- The HotelCreateReservationReq operation of HotelService is used for the request. The HotelReqRsp schema is used to define the XML.
- The provider for the request is Galileo and the pseudo city code indicates the requesting travel provider.
- The request is emulated to the target branch 'XXBRCH'.
- The Origin Application is "UAPI".
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<HotelCreateReservationReq TargetBranch="XXBRCH" AuthorizedBy="TEST" TraceId="65e4c8a3-ab1d-402d-8d47-8029528a5801" xmlns="http://www.travelport.com/schema/hotel_v37_0">
<BillingPointOfSaleInfo OriginApplication="UAPI" xmlns="http://www.travelport.com/schema/common_v37_0"/>
<BookingTraveler DOB="1960-10-09" Gender="M" Key="cf0f8433-4622-40e6-9ac5-01b3cbdb49c7" TravelerType="ADT" Age="51" xmlns="http://www.travelport.com/schema/common_v37_0">
<BookingTravelerName First="John" Last="Doe"/>
<PhoneNumber Number="525-5255" AreaCode="312" Type="Other" CountryCode="1" Location="ORD"/>
<Email EmailID="john.doe@email.com" Type="Other"/>
</BookingTraveler>
<AgencyContactInfo xmlns="http://www.travelport.com/schema/common_v37_0">
<PhoneNumber Number="1 303 2224444-4321" AreaCode="303" Text="Branch 654t" Type="Agency" CountryCode="1"/>
</AgencyContactInfo>
<CustomerID xmlns="http://www.travelport.com/schema/common_v37_0"/>
<FileFinishingInfo xmlns="http://www.travelport.com/schema/common_v37_0">
<ShopInformation/>
<AccountInformation/>
<AgencyInformation>
<Email EmailID="agency10.email@tp.com" Key="28897" Type="Home"/>
<PhoneNumber Number="565545454" AreaCode="111" Type="Fax" Key="325228" CountryCode="11"/>
</AgencyInformation>
</FileFinishingInfo>
<HotelRateDetail Base="USD129.00" RatePlanType="KNGRACK" Total="USD436.54"/>
<HotelProperty ParticipationLevel="Best Available Rate and Inside Shopper participant" ReserveRequirement="Other" Availability="Available" HotelTransportation="CourtesyBus" HotelCode="86178" HotelChain="HY" HotelLocation="DEN" Name="HYATT PLACE DENVER AIRPORT">
<PropertyAddress>
<Address>16250 East 40th Avenue </Address>
<Address>Aurora CO US 80011 </Address>
</PropertyAddress>
<Distance Value="10" Direction="SW" xmlns="http://www.travelport.com/schema/common_v37_0"/>
</HotelProperty>
<HotelStay>
<CheckinDate>2012-12-04</CheckinDate>
<CheckoutDate>2012-12-07</CheckoutDate>
</HotelStay>
<Guarantee ExternalReference="196244e59c324ce2b006f2af534c01db" Type="Guarantee" xmlns="http://www.travelport.com/schema/common_v37_0">
<CreditCard Number="4111111111111111" Type="VI" ExpDate="2015-09"/>
</Guarantee>
<GuestInformation NumberOfRooms="1">
<NumberOfAdults>1</NumberOfAdults>
<NumberOfChildren Count="0"/>
</GuestInformation>
<ActionStatus TicketDate="2012-09-01T23:59:00.0000000" Type="TAU" xmlns="http://www.travelport.com/schema/common_v37_0">
<Remark/>
</ActionStatus>
</HotelCreateReservationReq>
</SOAP:Body>
</SOAP:Envelope>
Sample Response
The sample response confirms the requested hotel reservation. The HotelReqRsp schema is used to define the XML. Universal API uses schema validation for requests. If your request schema is not valid, an error is returned in the response. Schema validation is enabled by Travelport, and cannot be disabled for individual transactions.
By default, rates are returned in the local currency of the hotel property. Free-form descriptive text from the supplier is also returned. If the reservation is the first booking for the trip, a new Universal Record is automatically created, with an Apollo PNR (booking record) contained within the Universal Record. If the reservation is added to an existing trip, a new PNR is appended to an existing Universal Record that already contains at least one PNR.
Because a Universal Record can contain booking records from multiple providers and suppliers, at least two types of record locators are returned in the response:
-
The Universal Record Locator Code "DV7HLP" is the record locator code for the Universal Record.
-
The Provider Reservation "P6N55O" indicates the reservation code of a Galileo "1G" PNR. This PNR is contained within the "DV7HLP" Universal Record.
Depending on the provider and/or supplier, additional identifiers for this reservation may also be returned:
-
An alternate booking source code (BookingSource) for the reservation. In this example, an IATA number.
-
A supplier-specific record locator (SupplierCode) returned by the hotel chain.
Transaction IDs uniquely identify the call and can be used for logging and debugging. Keys and references uniquely identify data within the call and can be used to maintain continuity of data in follow-on transactions. Credit card numbers and other identifying information are masked in the response.
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Body>
<hotel:HotelCreateReservationRsp xmlns:hotel="http://www.travelport.com/schema/hotel_v37_0" xmlns:common_v37_0="http://www.travelport.com/schema/common_v37_0" TraceId="65e4c8a3-ab1d-402d-8d47-8029528a5801" TransactionId="7DE8D4880A0771C501A0112596D1A8C5" ResponseTime="3241">
<universal:UniversalRecord xmlns:universal="http://www.travelport.com/schema/universal_v37_0" xmlns:common_v37_0="http://www.travelport.com/schema/common_v37_0" LocatorCode="DV7HLP" Version="0" Status="Active">
<common_v37_0:BookingTraveler Key="273115" TravelerType="ADT" Age="51" DOB="1960-10-09" Gender="M">
<common_v37_0:BookingTravelerName First="John" Last="Doe" />
<common_v37_0:PhoneNumber Key="332679" Type="Other" Location="ORD" CountryCode="1" Number="525-5255" AreaCode="312">
<common_v37_0:ProviderReservationInfoRef Key="248490" />
</common_v37_0:PhoneNumber>
<common_v37_0:Email Key="141104" Type="Other" EmailID="john.doe@email.com">
<common_v37_0:ProviderReservationInfoRef Key="248490" />
</common_v37_0:Email>
</common_v37_0:BookingTraveler>
<common_v37_0:OSI Key="190469" Carrier="1G" Text="HY86178ARR04DEC CXL:CANCEL BY 4 PM DAY OF ARRIVAL" ProviderReservationInfoRef="248490" />
<common_v37_0:ActionStatus Key="174965" Type="TAU" TicketDate="2012-09-01T23:59:00.000+10:00" ProviderReservationInfoRef="248490" ProviderCode="1G" />
<universal:ProviderReservationInfo Key="248490" ProviderCode="1G" LocatorCode="P6N55O" CreateDate="2012-08-31T18:19:36.626+00:00" ModifiedDate="2012-08-31T18:19:37.339+00:00" HostCreateDate="2012-08-31" />
<hotel:HotelReservation xmlns:hotel="http://www.travelport.com/schema/hotel_v37_0" xmlns:common_v37_0="http://www.travelport.com/schema/common_v37_0" Status="HK" BookingConfirmation="HY0002751920" LocatorCode="00PKFL03" CreateDate="2012-08-31T18:19:36.568+00:00" ModifiedDate="2012-08-31T18:19:37.339+00:00" ProviderReservationInfoRef="248490" TravelOrder="1">
<common_v37_0:BookingTravelerRef Key="273115" />
<common_v37_0:ReservationName>
<common_v37_0:BookingTravelerRef Key="273115" />
</common_v37_0:ReservationName>
<hotel:HotelProperty HotelChain="HY" HotelCode="86178" HotelLocation="DEN" Name="HYATT PLACE DENVER AIRPORT" HotelTransportation="CourtesyBus" ReserveRequirement="Other" ParticipationLevel="Best Available Rate and Inside Shopper participant" Availability="Available">
<hotel:PropertyAddress>
<hotel:Address>16250 EAST 40TH AVE</hotel:Address>
<hotel:Address>AURORA CO 80011</hotel:Address>
</hotel:PropertyAddress>
<common_v37_0:PhoneNumber Type="Hotel" Number="303-371-0700" />
<common_v37_0:PhoneNumber Type="Fax" Number="303-371-2223" />
<common_v37_0:Distance Value="10" Direction="SW" />
</hotel:HotelProperty>
<hotel:HotelRateDetail RatePlanType="KNGRACK" Base="USD387.00" Total="USD436.54" RateGuaranteed="true">
<hotel:RoomRateDescription Name="Total Includes">
<hotel:Text>Total includes taxes, surcharges and fees</hotel:Text>
</hotel:RoomRateDescription>
<hotel:HotelRateByDate EffectiveDate="2012-12-04" ExpireDate="2012-12-07" Base="USD129.00" />
</hotel:HotelRateDetail>
<hotel:HotelStay>
<hotel:CheckinDate>2012-12-04</hotel:CheckinDate>
<hotel:CheckoutDate>2012-12-07</hotel:CheckoutDate>
</hotel:HotelStay>
<common_v37_0:Guarantee Type="Guarantee" Key="135850" ExternalReference="196244e59c324ce2b006f2af534c01db" Reusable="true">
<common_v37_0:CreditCard Type="VI" Number="************1111" ExpDate="2015-09" />
</common_v37_0:Guarantee>
<common_v37_0:BookingSource Type="IataNumber" Code="99999992" />
<hotel:GuestInformation NumberOfRooms="1">
<hotel:NumberOfAdults>1</hotel:NumberOfAdults>
</hotel:GuestInformation>
<hotel:AssociatedRemark Key="2290" ProviderReservationInfoRef="248490">
<common_v37_0:RemarkData>PLEASE CALL 0123 67789 99 FOR HOTEL QUERIES</common_v37_0:RemarkData>
</hotel:AssociatedRemark>
<common_v37_0:SellMessage>INVALID ARC/IATA NUMBER</common_v37_0:SellMessage>
<common_v37_0:SellMessage>CXL:CANCEL BY 4 PM DAY OF ARRIVAL *</common_v37_0:SellMessage>
</hotel:HotelReservation>
<common_v37_0:GeneralRemark Key="365346" TypeInGds="Basic" ProviderReservationInfoRef="248490" CreateDate="2012-09-01T04:19:00.000+10:00">
<common_v37_0:RemarkData>USD436.544111111111111111VI2015-09</common_v37_0:RemarkData>
</common_v37_0:GeneralRemark>
<common_v37_0:UnassociatedRemark Key="23618" ProviderReservationInfoRef="248490">
<common_v37_0:RemarkData>DEN</common_v37_0:RemarkData>
</common_v37_0:UnassociatedRemark>
<common_v37_0:AgencyInfo>
<common_v37_0:AgentAction ActionType="Created" AgentCode="TEST.AGENT@TP.COM" BranchCode="WAB" AgencyCode="S11686" EventTime="2012-08-31T18:19:34.937+00:00" />
</common_v37_0:AgencyInfo>
<common_v37_0:AgencyContactInfo>
<common_v37_0:PhoneNumber Key="332680" Type="Agency" Location="SYD" CountryCode="1" Number="1 303 2224444-4321" AreaCode="303" Text="Branch 654t Jeff Walters">
<common_v37_0:ProviderReservationInfoRef Key="248490" />
</common_v37_0:PhoneNumber>
</common_v37_0:AgencyContactInfo>
</universal:UniversalRecord>
</hotel:HotelCreateReservationRsp>
</SOAP:Body>
</SOAP:Envelope>