-
Notifications
You must be signed in to change notification settings - Fork 0
Avantio
Avantio site https://www.avantio.com/ (previous name 'itsolutions')
All required information can be found in official documentation http://feeds.avantio.com/doc/api_for_portals.pdf. This document is updated constantly. Current API version is 2.6.
Briefly, Avantio provides two ways to get data about accommodations:
-
Via XML files. List of files can be found in the documentation. This way is used by sync workers. Files are updated with different frequency from several hours to several days (more details in documentation). Avantio is multihost supplier. Each host has CODE_PARTNER provided by Avantio. To get access to files you only need CODE_PARTNER.
-
Via SOAP API. This way is used by Concierge webhooks. Each API method requires username and password to be presented in request:
<Credentials>
<Language>EN</Language>
<UserName>Foo</UserName>
<Password>123</Password>
</Credentials>
NOTE: wsdl.xml contains a lot of methods but only those which described in the documentation works fine. Others return a similar error:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>PolicyFault: the access policy has been violated</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Each Avantio accommodation always has three parameters: AccommodationCode
, UserCode
, LoginGA
. This triple used by SOAP API to identify the accommodation. As well as Roomorama requires one identifier for each property these three should be converted to one to be stored in Roomorama. Avantio::PropertyId
class responsible for converting Avantio ids to Roomorama id and vice versa. For more details see the class documentation.
To check a property availability and get the price for a given stay use IsAvailable
and GetBookingPrice
methods.
NOTE: GetBookingPrice
return valid response even for unavailable periods, so check with IsAvailable
method is required!
IsAvailable Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="ws.avantio.com/crsConnectionServices/xsd" xmlns:crs="ws.avantio.com/crsConnectionServices">
<soapenv:Header/>
<soapenv:Body>
<xsd:IsAvailableRQ>
<crs:Credentials>
<crs:Language>EN</crs:Language>
<crs:UserName>username</crs:UserName>
<crs:Password>password</crs:Password>
</crs:Credentials>
<crs:Criteria>
<crs:Accommodation>
<crs:AccommodationCode>55720</crs:AccommodationCode>
<crs:UserCode>1210075202</crs:UserCode>
<crs:LoginGA>itsalojamientos</crs:LoginGA>
</crs:Accommodation>
<crs:Occupants>
<crs:AdultsNumber>1</crs:AdultsNumber>
</crs:Occupants>
<crs:DateFrom>2016-10-01</crs:DateFrom>
<crs:DateTo>2016-10-22</crs:DateTo>
</crs:Criteria>
</xsd:IsAvailableRQ>
</soapenv:Body>
</soapenv:Envelope>
Each valid response contains AvailableCode
field. Possible values for this field described in the documentation. 1
means available.
Unavailable response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:IsAvailableRS xmlns:ns1="ws.avantio.com/crsConnectionServices/xsd" xmlns:ns2="ws.avantio.com/crsConnectionServices">
<ns2:Available>
<ns2:AvailableCode>-3</ns2:AvailableCode>
<ns2:AvailableMessage>The compulsory arrival date is not fulfilled</ns2:AvailableMessage>
</ns2:Available>
<ns2:OccupationalRule>
<ns2:StartDate>21/06/2016</ns2:StartDate>
<ns2:EndDate>31/12/2016</ns2:EndDate>
<ns2:MinimumNights>5</ns2:MinimumNights>
<ns2:MinimumNightsOnline>1</ns2:MinimumNightsOnline>
<ns2:CheckInDays>
<ns2:WeekDay>MONDAY</ns2:WeekDay>
<ns2:WeekDay>TUESDAY</ns2:WeekDay>
<ns2:WeekDay>WEDNESDAY</ns2:WeekDay>
</ns2:CheckInDays>
<ns2:CheckOutDays>
<ns2:WeekDay>THURSDAY</ns2:WeekDay>
<ns2:WeekDay>FRIDAY</ns2:WeekDay>
<ns2:WeekDay>SATURDAY</ns2:WeekDay>
<ns2:WeekDay>SUNDAY</ns2:WeekDay>
</ns2:CheckOutDays>
</ns2:OccupationalRule>
</ns1:IsAvailableRS>
</soapenv:Body>
</soapenv:Envelope>
Available response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:IsAvailableRS xmlns:ns1="ws.avantio.com/crsConnectionServices/xsd" xmlns:ns2="ws.avantio.com/crsConnectionServices">
<ns2:Available>
<ns2:AvailableCode>1</ns2:AvailableCode>
<ns2:AvailableMessage>Available</ns2:AvailableMessage>
</ns2:Available>
</ns1:IsAvailableRS>
</soapenv:Body>
</soapenv:Envelope>
GetBookingPrice Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="ws.avantio.com/crsConnectionServices/xsd" xmlns:crs="ws.avantio.com/crsConnectionServices">
<soapenv:Header/>
<soapenv:Body>
<xsd:GetBookingPriceRQ>
<crs:Credentials>
<crs:Language>EN</crs:Language>
<crs:UserName>username</crs:UserName>
<crs:Password>password</crs:Password>
</crs:Credentials>
<crs:Criteria>
<crs:Accommodation>
<crs:AccommodationCode>55720</crs:AccommodationCode>
<crs:UserCode>1210075202</crs:UserCode>
<crs:LoginGA>itsalojamientos</crs:LoginGA>
</crs:Accommodation>
<crs:Occupants>
<crs:AdultsNumber>1</crs:AdultsNumber>
</crs:Occupants>
<crs:ArrivalDate>2016-10-03</crs:ArrivalDate>
<crs:DepartureDate>2016-10-22</crs:DepartureDate>
</crs:Criteria>
</xsd:GetBookingPriceRQ>
</soapenv:Body>
</soapenv:Envelope>
Response contains a lot of different prices. We are interested in RoomOnlyFinal
.
GetBookingPrice response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:GetBookingPriceRS xmlns:ns1="ws.avantio.com/crsConnectionServices/xsd" xmlns:ns2="ws.avantio.com/crsConnectionServices">
<ns2:BookingPrice>
<ns2:RoomOnly>7600</ns2:RoomOnly>
<ns2:RoomOnlyFinal>7605</ns2:RoomOnlyFinal>
<ns2:RoomOnlyWithoutOffer>7600</ns2:RoomOnlyWithoutOffer>
<ns2:RoomOnlyFinalWithoutOffer>7605</ns2:RoomOnlyFinalWithoutOffer>
<ns2:RoomOnlyPaymentWhenBooking>2660</ns2:RoomOnlyPaymentWhenBooking>
<ns2:RoomOnlyFinalPaymentDetails>
<ns2:PaymentDetail>
<ns2:PaymentNumber>1</ns2:PaymentNumber>
<ns2:PaymentTime>WhenBooking</ns2:PaymentTime>
<ns2:Amount>2660</ns2:Amount>
<ns2:PaymentDate>2016-09-13</ns2:PaymentDate>
<ns2:PaymentMethods>
<ns2:PaymentMethod>1</ns2:PaymentMethod>
<ns2:PaymentMethod>43</ns2:PaymentMethod>
</ns2:PaymentMethods>
</ns2:PaymentDetail>
<ns2:PaymentDetail>
<ns2:PaymentNumber>2</ns2:PaymentNumber>
<ns2:PaymentTime>WhenArrival</ns2:PaymentTime>
<ns2:Amount>4945</ns2:Amount>
<ns2:PaymentDate>2016-10-03</ns2:PaymentDate>
</ns2:PaymentDetail>
</ns2:RoomOnlyFinalPaymentDetails>
<ns2:Currency>EUR</ns2:Currency>
</ns2:BookingPrice>
<ns2:CancellationPolicies>
<ns2:Description>In case of cancellation the following charges will apply:
- If the reservation is cancelled: the prepayment amount.</ns2:Description>
<ns2:CancellationPolicyList>
<ns2:CancellationPolicyItem>
<ns2:RoomOnlyAmount>2660</ns2:RoomOnlyAmount>
<ns2:Deadline>2016-10-02</ns2:Deadline>
</ns2:CancellationPolicyItem>
</ns2:CancellationPolicyList>
<ns2:NoShow>
<ns2:RoomOnlyAmount>0</ns2:RoomOnlyAmount>
</ns2:NoShow>
<ns2:Currency>EUR</ns2:Currency>
</ns2:CancellationPolicies>
<ns2:TermsAndConditions>http://crs.itsolutions.es/verCondicionesGenerales.php?bk=bk_demoss&Idioma=EN&formato=1</ns2:TermsAndConditions>
<ns2:Services>
<ns2:Service>
<ns2:Code>18</ns2:Code>
<ns2:Amount>1</ns2:Amount>
</ns2:Service>
<ns2:Service>
<ns2:Code>10</ns2:Code>
<ns2:Amount>1</ns2:Amount>
</ns2:Service>
</ns2:Services>
</ns1:GetBookingPriceRS>
</soapenv:Body>
</soapenv:Envelope>