Upload OTA or custom supplier inventory

The inventory file or custom suppliers data file is passed to the RESTful Web API as an octet-stream inside the HTTP POST request.

Supported file formats are:

  1. Json - The file will contain an array of predefined HotelDetails objects (See below).
  2. csv/xls/xlsx - This option requires an initial setup process of the OTA inventory file.The system expect the same file format which was provided in the setup process.The header (field names) should be identical to the one provided in the initial setup process.

In case of an error, the following unique error codes will be returned in the format Exxxx:

  • 1001 - Internal server error
  • 1010 - Setup error - no suppliers associated
  • 1011 - Setup error - no initial CSV file uploaded
  • 1012 - LoadInventory is not supported for users in mapping works lite mode
  • 1013 - Uploading OTA inventory is not supported for agencies with Travolutionary IDs mode. Please provide a supplierName to upload custom supplier inventory
  • 1014 - Size of your file exceeds 100MB. To ensure successful loading, please convert your file to CSV format and upload again.
  • 1020 - Upload failed
  • 1021 - Invalid file extension
  • 1022 - Wrong file format
  • 1023 - Failed to upload Excel file. Please try uploading this file in CSV format.
  • 1030 - Unrecognized custom supplier name
  • 777 - Uploaded file is the same as existing file. Please use "run mapping" functionality

HotelDetails


Represents hotel details.


HotelDetails attributes:

  • HotelId (String)
  • HotelName(required) (String)
  • Address (String)
  • CityName (String)
  • Zip (String)
  • CountryCode(ISO) (*) (String)
  • CountryName (*) (String)
  • State (String)
  • Phone (String)
  • Fax (String)
  • Email (String)
  • Website (String)
  • StarRating (String)
  • Chain (String)
  • CrossReference (Dictionary of SupplierID(**) and key)
  • RoomCount (Integer)
  • Latitude (Number)
  • Longitude (Number)

*Please note that either Country code or country Name are mandatory.

** See the index of supplier ids here: Supplier ids

Example Request (JSON) - OTA Inventory Uploading

Sample of how to load the OTA inventory automatically using the API (JSON format):

POST https://mapping-wl.azurewebsites.net/mapping/LoadInventory HTTP/1.1
Accept: application/json
Content-Type: multipart/form-data; boundary="Upload----02/11/2018 19:23:33"
Host: mapping-wl.azurewebsites.net
Cookie: __ControllerTempData=AA; __RequestVerificationToken=pt
Content-Length: 994805
Connection: Keep-Alive

--Upload----02/11/2018 19:23:33
Content-Type: application/octet-stream
Content-Disposition: form-data; name=Hotels; filename="Sample - OTA Inventory.json"; filename*=utf-8''Sample%20-%20OTA%20Inventory.json

[{
	"HotelId" : "US2838",
	"Zip" : null,
	"CountryCode" : "us",
	"State" : "tx",
	"Phone" : "1-512-452-3300",
	"Fax" : "1-512-452-3124",
	"Email" : "",
	"Website" :"http://hamptoninn.hilton.com/en/hotels/texas/hampton-inn/index.html",		
	"StarRating" : "3",
	"Chain" : "",
	"CrossReference" : null,
	"RoomCount" : null,
	"Latitude" : 30.3374,
	"Longitude" : -97.7003,
	"HotelName" : "Hampton Inn Austin North at I 35 Hwy 183",
	"Address" : "7619 I 35 North TX 78752 USA",
	"CityName" : "Austin ",
	"CountryName" : null
}, {
	"HotelId" : "US2839",
	"Zip" : null,
	"CountryCode" : "us",
	"State" : "tx",
	"Phone" : "1-512-249-0045",
	"Fax" : "1-512-249-5792",
	"Email" : "",
	"Website" : "http://hamptoninn3.hilton.com/en/hotels/texas/hampton-inn/index.html",
	"StarRating" : "3",
	"Chain" : "",
	"CrossReference" : null,
	"RoomCount" : null,
	"Latitude" : 30.4636,
	"Longitude" : -97.8012,
	"HotelName" : "Hampton Inn Suites Austin Cedar Park Lakeline",
	"Address" : "10811 Pecan Park Boulevard TX 78750 USA",
	"CityName" : "Austin ",
	"CountryName" : null
}, {
	"HotelId" : "US2846",
	"Zip" : null,
	"CountryCode" : "us",
	"State" : "tx",
	"Phone" : "1-512-482-8000",
	"Fax" : "1-512-469-0078",
	"Email" : "",
	"Website" : "http://www3.hilton.com/en/hotels/texas/hilton-austin-AUSCVHH/index.html",
	"StarRating" : "4",
	"Chain" : "",
	"CrossReference" : null,
	"RoomCount" : null,
	"Latitude" : 30.264994,
	"Longitude" : -97.738803,
	"HotelName" : "Hilton Austin ",
	"Address" : "500 East 4th Street TX 78701 USA",
	"CityName" : "Austin ",
	"CountryName" : null
	}
]

--Upload----02/11/2018 19:23:33--

Example Request (CSV)

Sample of how to load the OTA inventory automatically using the API (CSV format):

POST https://mapping-wl.azurewebsites.net/mapping/LoadInventory HTTP/1.1
Accept: application/json
Content-Type: multipart/form-data; boundary="Upload----02/11/2018 19:23:33"
Host: mapping-wl.azurewebsites.net
Cookie: __ControllerTempData=AA; __RequestVerificationToken=pt
Content-Length: 994805
Connection: Keep-Alive

--Upload----02/11/2018 19:23:33
Content-Type: application/octet-stream
Content-Disposition: form-data; name=Hotels; filename="OTA - Inventory 2.csv"; filename*=utf-8''OTA%20-%20Inventory%202.csv
            
Supplier Primary Reference;Hotel Name;AddressLine;City;Zip Code;Country ISO;Phone_1;Fax;Email;Phone_2
MA362;Mercure Bristol Holland House Hotel and Spa;Redcliffe Hill;BRISTOL;BS1 6SQ;GB;0117 9689900 ;;[email protected];
HO171;Crowne Plaza London Ealing;Western Avenue, Hanger Lane;LONDON;W5 1HG;GB;0871 942 9114;;[email protected] ;

--Upload----02/11/2018 19:23:33--
Language
Click Try It! to start a request and see the response here!