MVL Ota Api - v2
MVL Ota Api - v2
Version 2.02
September 16, 2019
Table of Contents
INTRODUCTION ................................................................................................................................................................... 2
1.0 Overview ............................................................................................................................................................. 2
2.0 Communication Protocol .................................................................................................................................... 2
3.0 Integration Requirement .................................................................................................................................... 2
WEB METHODS ................................................................................................................................................................... 3
Common Response ......................................................................................................................................................... 3
1.0 Security................................................................................................................................................................ 4
1.1 GetTimeToken ................................................................................................................................................. 4
1.2 GetMD5Hash ................................................................................................................................................... 5
2.0 Ota ....................................................................................................................................................................... 6
2.1 GetVillaList ...................................................................................................................................................... 6
2.2 GetVillaInfo ..................................................................................................................................................... 8
2.3 GetRates ........................................................................................................................................................ 18
2.4. GetComputedRates ....................................................................................................................................... 23
2.5 GetAvailability ............................................................................................................................................... 29
2.6 InsertBooking ................................................................................................................................................ 31
APPENDIX .......................................................................................................................................................................... 33
JSON Params ................................................................................................................................................................. 33
1.0 Common Parameters .................................................................................................................................... 33
2.0 GetAvailability Parameters ........................................................................................................................... 33
3.0 InsertBooking Parameters............................................................................................................................. 33
VERSION HISTORY ............................................................................................................................................................. 34
Version 2.0 .................................................................................................................................................................... 34
Version 2.01 .................................................................................................................................................................. 34
Version 2.02 .................................................................................................................................................................. 34
1.0 Overview
This document provides the Online Travel Agent (OTA) partners of Marketing Villas Ltd. (MVL) the ability to pull data of
villas marketed by MVL using the MVL Partners API. Depending on the deal between the OTA and MVL, the agent can
also send reservation request via the API.
This web service utilizes the Representational State Transfer (REST) architecture over HTTP protocol wherein the web
methods can return response in either XML (default) or JSON format depending on the requested “Accept” header
value. GET and POST are the only supported HTTP operations.
A good working knowledge on the use of the REST architecture is needed to have a successful integration with the MVL
Partners API.
An agent will be given a userid, password, and travelagent id that they will use to generate the token to be submitted to
a web method, if required.
All the web methods in this document accept the following request header parameter:
Common Response
The web methods also have common response format as follows:
XML
Return value definitions:
Path Multiple Remarks
ApiResponse/@Status N Value can either be “Ok” or “Error”.
ApiResponse/Errors/Error Y This node will be returned if @Status = “Error”.
../../Error/@Code N
../../Error/@Status N
../../Error/@ShortText N
Sample:
<ApiResponse Status="Ok">
…
</ApiResponse>
-----------------------------------------------------------------------------------------------------------------------
<ApiResponse Status="Error">
<Errors>
<Error Code="500" Status="sample string 2" ShortText="sample string 3" />
<Error Code="500.1" Status="sample string 2" ShortText="sample string 3" />
</Errors>
…
</ApiResponse>
JSON
Return value definitions:
Field Array Remarks
Status N See XML Remarks
Errors[] Y This will not be null if Status = “Error”.
Errors[i].Code N
Errors[i].Status N
Errors[i].ShortText N
Sample:
{
"Errors": null,
"Status": "Ok"
}
-----------------------------------------------------------------------------------------------------------------------
{
"Errors": [
{
"Code": "500",
"Status": "sample string 2",
"ShortText": "sample string 3"
},
{
"Code": "500.1",
"Status": "sample string 2",
"ShortText": "sample string 3"
}
],
"Status": "Error"
}
a. Construct the original form (un-hashed) of the token in the format userid|password|time token.
Example: uid|pwd|7e829135b93c61cc54abaeece9de085b.
The userid should always be in lowercase. The time token can be retrieved by calling the
GetTimeToken method.
b. Get the MD5 hashed key of the constructed original form of the token by passing it to the
GetMD5Hash method. The generated hash key will serve as the token value that is passed to
the api method that requires it.
1.1 GetTimeToken
Retrieve an MD5 hashed timestamp.
Request Information
BODY/URI PARAMETERS
None.
Response Information
XML
Return value definitions:
Sample:
<ApiResponse Status="Ok">
<Value>d5588b0143d8305a7dba0a6fa69d7248</Value>
</ApiResponse>
JSON
Return value definitions:
Sample:
{
"Value": "d5588b0143d8305a7dba0a6fa69d7248",
"Status": "Ok"
}
Request Information
BODY/URI PARAMETERS
Parameter Type Remarks
p_ToHash String Required.
Response Information
XML
Return value definitions:
Sample:
<ApiResponse Status="Ok">
<Value>d5588b0143d8305a7dba0a6fa69d7248</Value>
</ApiResponse>
JSON
Return value definitions:
Sample:
{
"Value": "d5588b0143d8305a7dba0a6fa69d7248",
"Status": "Ok"
}
2.1 GetVillaList
Get a list of all the villas under MVL.
Request Information
BODY/URI PARAMETERS
Parameter Type Remarks Example
p_Token String Required. Refer to Security
resource guide in generating the
token.
p_UserID String Required.
p_Params String Optional. An empty JSON string. {}
Response Information
XML
Return value definitions:
Sample:
<ApiResponse Status="Ok">
<Villas>
<Villa>
<VillaId>P0001</VillaId>
<VillaName>Elite Villa 1</VillaName>
<Country>
<CountryId>ID</CountryId>
<CountryName>Indonesia</CountryName>
<Location>
<LocationId>Bali</LocationId>
<LocationName>Bali</LocationName>
<SubLocation>
<SubLocationId>Seminyak</SubLocationId>
<SubLocationName>Seminyak</SubLocationName>
</SubLocation>
</Location>
</Country>
</Villa>
<Villa>
<VillaId>P0002</VillaId>
<VillaName>Luxury Villa TH</VillaName>
<Country>
Marketing Villas Ltd. | WEB METHODS 6
<CountryId>TH</CountryId>
<CountryName>Thailand</CountryName>
<Location>
<LocationId>Phuket</LocationId>
<LocationName>Phuket</LocationName>
<SubLocation>
<SubLocationId>AoPo</SubLocationId>
<SubLocationName>Ao Po</SubLocationName>
</SubLocation>
</Location>
</Country>
</Villa>
</Villas>
</ApiResponse>
JSON
Return value definitions:
Sample:
{
"Status": "Ok",
"Villas": [
{
"VillaId": "P0001",
"VillaName": "Elite Villa 1",
"Country": {
"CountryId": "ID",
"CountryName": "Indonesia",
"Location": {
"LocationId": "Bali",
"LocationName": "Bali",
"SubLocation": {
"SubLocationId": "Seminyak",
"SubLocationName": "Seminyak"
}
}
}
},
{
"VillaId": "P0002",
"VillaName": "Luxury Villa TH",
"Country": {
"CountryId": "TH",
"CountryName": "Thailand",
"Location": {
"LocationId": "Phuket",
"LocationName": "Phuket",
"SubLocation": {
"SubLocationId": "AoPo",
"SubLocationName": "Ao Po"
}
}
}
}
]
}
Request Information
BODY/URI PARAMETERS
Parameter Type Remarks Example
p_Token String Required. Refer to Security
resource guide in generating the
token.
p_UserID String Required.
p_Params String Required. A JSON string format {"PropertyID":"P0001"}
parameter. Refer to Apendix 1.0
for the accepted JSON keys.
Response Information
XML
Return value definitions:
../../../../MaxSleep N
../../../../Adults N A parent node.
../../../../../MinAdults N
../../../../../MaxAdults N
../../../../Children N A parent node.
../../../../../MinChildren N
../../../../../MaxChildren N
../../../../Bedrooms N A parent node.
../../../../../BedroomCount N
Sample:
<ApiResponse Status="Ok">
<Villa>
<Details>
<VillaId>P0001</VillaId>
<VillaName>Villa Elite Seminyak</VillaName>
<Country>
<CountryId>ID</CountryId>
<CountryName>Indonesia</CountryName>
<CountryBaseUrl />
<Location>
<LocationId>Bali</LocationId>
<LocationName>Bali</LocationName>
<LocationBaseUrl />
<SubLocation>
<SubLocationId>Seminyak</SubLocationId>
<SubLocationName>Seminyak</SubLocationName>
<SubLocationBaseUrl />
</SubLocation>
</Location>
</Country>
<Coordinates>
<Latitude>-8.68283260</Latitude>
<Longitude>115.15555550</Longitude>
</Coordinates>
<Occupancy>
<MinSleep>8</MinSleep>
<MaxSleep>11</MaxSleep>
<Adults>
<MinAdults>8</MinAdults>
<MaxAdults>11</MaxAdults>
</Adults>
<Children>
<MinChildren>0</MinChildren>
<MaxChildren>0</MaxChildren>
</Children>
<Bedrooms>
<BedroomCount>4</BedroomCount>
<Details>
<Layouts>
<Layout>
<Heading>Guest Bedroom Top Level</Heading>
<Description><ul><li>Two identically
laid out king size bedrooms with sliding windows that overlook pool and
garden</li><li>En-suite bathrooms with monsoon
showers</li><li> Soft furnishings feature silks by Jim
Thompson on beds cushions, beds and walls</li><li>TVs hidden
behind wall panels</li></ul></Description>
</Layout>
<Layout>
<Heading>Ground Level</Heading>
<Description><ul><li>Large master
suite with king bed and luxurious en-suite with jacuzzi bath and indoor
and outdoor showers.</li><li>Office/ extra kids bedroom
reached through adjoining door from bathroom</li><li>Second
bedroom arranged as a twin (converts to king) with small outdoor sitting
area located in sleeping pavilion</li><li> Soft furnishings
feature silks by Jim Thompson on beds cushions, beds and
walls</li><li>TVs hidden behind wall
panel</li></ul></Description>
</Layout>
</Layouts>
<Configurations>
<Configuration>
<Heading>Study</Heading>
<BedType>Single</BedType>
</Configuration>
<Configuration>
<Heading>Melati</Heading>
<BedType>King/Twin</BedType>
</Configuration>
<Url>http://cimages.elitehavens.com/images/otas/villas/P0001/01-Villa
Elite - Relax poolside.jpg</Url>
<Caption>Shinta Dewi - Relax poolside</Caption>
</Hires>
<Lowres>
<Url />
<Caption />
</Lowres>
</Image>
<Image>
<Hires>
<Url>http://cimages.elitehavens.com/images/otas/villas/P0001/02-Villa
Elite - The pool.jpg</Url>
<Caption>Shinta Dewi - The pool</Caption>
</Hires>
<Lowres>
<Url />
<Caption />
</Lowres>
</Image>
</Standard>
<Mobile />
</Gallery>
<FloorPlan>
<ImageUrl />
<PropertySize><p>455sqm (villa), 698sqm
(land).</p></PropertySize>
<PoolSize><p>11m x 5m x 1.4m.<br
/></p></PoolSize>
</FloorPlan>
</Media>
</Villa>
</ApiResponse>
JSON
Return value definitions:
Sample:
{
"Errors": null,
"Villa": {
"Details": {
"VillaId": "P0001",
"VillaName": "Villa Elite Seminyak",
"Country": {
"CountryId": "ID",
"CountryName": "Indonesia",
"CountryBaseUrl": "",
"Location": {
"LocationId": "Bali",
"LocationName": "Bali",
"LocationBaseUrl": "",
"SubLocation": {
"SubLocationId": "Seminyak",
"SubLocationName": "Seminyak",
Request Information
BODY/URI PARAMETERS
Parameter Type Remarks Example
p_Token String Required. Refer to Security
resource guide in generating the
token.
p_UserID String Required.
p_Params String Required. A JSON string format {"PropertyID":"P0001"}
parameter. Refer to Apendix 1.0
for the accepted JSON keys.
Response Information
XML
Return value definitions:
Sample:
<ApiResponse Status="Ok">
<Villa>
<VillaId>P0001</VillaId>
<VillaName>Villa Elite Seminyak</VillaName>
<Rooms>
<Room RoomId="818">
<RoomName>4 bedroom</RoomName>
<BedroomCount>4</BedroomCount>
<MaxOccupancy>8</MaxOccupancy>
<MaxAdult>8</MaxAdult>
<MaxChild>0</MaxChild>
<Rates>
<StandardRate RateNameId="647">
<RateName>Standard Rate (4BR)</RateName>
<MarketingDesc />
<Periods>
<Period Year="2018">
<StartDate>2018-08-19</StartDate>
<EndDate>2018-08-31</EndDate>
<PublishedRate IsSCTaxIncluded="N">790</PublishedRate>
<LS14DiscountedRate>0</LS14DiscountedRate>
<LSStdDiscountedRate LSRequiredNights="10">118.5</LSStdDiscountedRate>
<TaxRate TaxRateType="%">10</TaxRate>
<SCRate SCRateType="%">5</SCRate>
<MinNights>3</MinNights>
<Inclusions><li> Daily breakfast</li><li> WiFi Internet
access</li> <li> Exclusive use of gym, jacuzzi and pool</li><li>
Sound system</li><li> Satellite TV and DVD</li><li> Welcome drink
and fruit basket</li><li> Turndown service</li><li>Personal
service by the villa staff including full time villa manager, housekeeper, chef/cook,
security and attendants</li><li> Exclusive use of the whole villa and listed
facilities </li><li>Airport transfers (Conditions
apply)</li></Inclusions>
<CancellationCondition />
<Season SeasonId="SH">Shoulder Season</Season>
</Period>
…
</Periods>
</StandardRate>
<PackageRates>
<Package RateNameId="8888">
<RateName />
<MarketingDesc />
<Periods>
JSON
Return value definitions:
Sample:
{
"Errors": null,
"Villa": {
"VillaId": "P0001",
"VillaName": "Villa Elite Seminyak",
"Rooms": [
{
"RoomName": "4 bedroom",
"BedroomCount": 4,
"MaxOccupancy": 8,
"MaxAdult": 8,
"MaxChild": 0,
"Rates": {
"StandardRate": {
"RateName": "Standard Rate (4BR)",
"MarketingDesc": "",
"Periods": [
{
"StartDate": "2018-08-19",
"EndDate": "2018-08-31",
"PublishedRate": {
"IsSCTaxIncluded": "N",
"Value": 790
},
"LS14DiscountedRate": 0,
"LSStdDiscountedRate": {
"LSRequiredNights": 10,
"Value": 118.5
},
"TaxRate": {
"TaxRateType": "%",
"Value": 10
},
"SCRate": {
"SCRateType": "%",
"Value": 5
},
"MinNights": 3,
"Inclusions": "<li> Daily breakfast<\/li><li> WiFi
Internet access<\/li> <li> Exclusive use of gym, jacuzzi and pool<\/li><li>
Sound system<\/li><li> Satellite TV and DVD<\/li><li> Welcome drink and fruit
basket<\/li><li> Turndown service<\/li><li>Personal service by the villa staff
including full time villa manager, housekeeper, chef/cook, security and
attendants<\/li><li> Exclusive use of the whole villa and listed facilities
<\/li><li>Airport transfers (Conditions apply)<\/li>",
"CancellationCondition": "",
"Season": {
"SeasonId": "SH",
"Value": "Shoulder Season"
},
"Year": 2018
It is advisable to limit the number of villas in the list to a maximum of 10 items per request so as not to slow
down the return of data. This method should only be use if you want to get the computed rates of the client
selected stay dates.
The returned data will include the applicable discounts and promotions for the selected stay period.
Request Information
BODY/URI PARAMETERS
Parameter Type Remarks Example
p_Token String Required. Refer to
Security resource
guide in generating
the token.
p_UserID String Required.
p_Params String Required. A JSON {"PropertyIDList":["P0001","P0002"],"CIDate":"2018-
string format 12-01","CODate":"2018-12-10"}
parameter. Refer to
Apendix 2.0 for the
accepted JSON keys.
Response Information
XML
Return value definitions:
Sample:
<ApiResponse Status="Ok">
<Villas>
<Villa>
<Details>
<VillaId>P0001</VillaId>
<VillaName>Villa Elite</VillaName>
<CurrencyCode>USD</CurrencyCode>
<Rooms>
<Room RoomId="529">
<RoomName>3 bedroom</RoomName>
<BedroomCount>3</BedroomCount>
<MaxOccupancy>6</MaxOccupancy>
<MaxAdult>6</MaxAdult>
<MaxChild>0</MaxChild>
<Rates>
<Rate RateNameId="438" DiscountId="112646">
<RateName>Enjoy a free one-day rental car with driver + one Indonesian
family style dinner</RateName>
<Periods>
<Period>
<StartDate>2018-12-01</StartDate>
<EndDate>2018-12-10</EndDate>
<Nights>9</Nights>
<BaseRate>350</BaseRate>
<BaseDiscount>-0</BaseDiscount>
<BaseSC>17.5</BaseSC>
<BaseTax>36.75</BaseTax>
<BaseGrossRate>404.25</BaseGrossRate>
<SubTotal>3638.25</SubTotal>
</Period>
</Periods>
<Total>3638.25</Total>
<MinNights>2</MinNights>
<Inclusions><li> WiFi Internet access </li><li>Car and
driver at a special rate of USD35++/day for 8 hours (excluding
JSON
Return value definitions:
Sample:
{
"Villas": [
{
"Details": {
"VillaId": "Mako",
"VillaName": "Villa Mako",
"Rooms": [
{
"RoomName": "3 bedroom",
"BedroomCount": 3,
"MaxOccupancy": 6,
"MaxAdult": 6,
"MaxChild": 0,
Request Information
BODY/URI PARAMETERS
Parameter Type Remarks Example
p_Token String Required. Refer to Security
resource guide in generating
the token.
p_UserID String Required.
p_Params String Required. A JSON string {"PropertyID":"Mako","SDate":"2018-
format parameter. Refer to 12-01","EDate":"2018-12-
Apendix 2.0 for the accepted 31","Status":"BLOCKED"}
JSON keys.
Response Information
XML
Return value definitions:
Sample:
<ApiResponse Status="Ok">
<Dates>
<DateRange>
<From></From>
<To></To>
<Status Lco="N" Eci="N">BLOCKED,AVAILABLE</Status>
</DateRange>
<DateRange>
<From></From>
<To></To>
<Status Lco="N" Eci="N">BLOCKED,AVAILABLE</Status>
</DateRange>
</Dates>
</ApiResponse>
JSON
Return value definitions:
Sample:
{
"Dates": [
{
"From": "2018-08-30",
"To": "2018-09-02",
"Status": {
"Lco": "N",
"Eci": "N",
"Value": "BLOCKED"
}
},
{
"From": "2018-09-03",
"To": "2018-09-15",
"Status": {
"Lco": "N",
"Eci": "N",
"Value": "BLOCKED"
}
}
],
"Status": "Ok"
}
This method expects the submitted data to satisfy the following conditions to be successful:
Request Information
BODY/URI PARAMETERS
Parameter Type Remarks Example
p_Token String Required. Refer to Security
resource guide in generating
the token.
p_UserID String Required.
p_Params String Required. A JSON string {"VillaID":"P0001","RateNameID":647,"Disco
format parameter. Refer to untID":0,"TravelAgentID":116,"CIDate":"2019
Apendix 3.0 for the -12-21","CODate":"2019-12-
accepted JSON keys. 26","GuestFirstName":"Juan","GuestLastNam
e":"Dela
Cruz","CountryOfResidence":"PH","ExtraEmai
l":"","TotalAdults":4,"TotalChildren":0,"TotalI
nfants":0}
Response Information
XML
Return value definitions:
Sample:
<ApiResponse Status="Ok">
<Booking>
<VillaBkId>2018xxxxxxxAB</VillaBkId>
<BkTotAmt>9999.00</BkTotAmt>
</Booking>
</ApiResponse>
JSON
Return value definitions:
Sample:
JSON Params
1.0 Common Parameters
Key Type Optional Remarks Example
PropertyID String N “PropertyID”:”P0001”
Version 2.0
Date Released: September 07, 2018
Version 2.01
Date Released: February 13, 2019
Version 2.02
Date Released: September 16, 2019