NAV Navigation
Shell JSON

Hotel Room Rate APIs

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

The RatesAPI is a direct access, automated and real-time price fetching service. This API Explorer details all available communication methods and provides users with a platform to directly test these methods.

Users can evaluate all the methods described in this document within this Swagger Explorer, passing the appropriate parameters to fetch price as it is displayed in the given source, in real-time.

Methods listed in this document are organized under the following Groups:

This API provides the pricing data for the Hotel Room fares.

Parameter Definition
Authentication Gaining access to the Rates API.
Account Viewing basic information about your call settings
Hotel Information Search for and retrieve information on the hotels you wish to track as well as sources each hotel is tracked on
Rate Shops Build templates that allow you to group hotels as well as defined the call parameters. Once defined the RateShop can be called on demand or linked to a Schedule.
Rates Retrieve rates using a granular call or a RateShop
Schedule Set up a regular schedule to run a defined RateShop.
Hooks Define an end-point for the delivery of rates retrieved by the RatesAPI.
References Retrieves reference values used in RatesAPI

Authorization

Every request sent to the RatesAPI must be authenticated with an access token. You can obtain an access token when you log-in using the credentials provided to you in your RatesAPI packet. An access token is valid only for 24 hours from the time it is generated.

The access token must be appended to the "Authorization Header" as depicted in the example below: If 'A90324XXZUZUgpO0dd6npHcM83CJ...' is your access token, every request must contain the following header:

Authorization: Bearer A90324XXZUZUgpO0dd6npHcM83CJ...

Authorizing requests on this page
The Access Token will be automatically appended to the Authorization Header when requests are made from within the Swagger Explorer. The key appears in the textbox at the top right corner of the page. If for any reason, this does not happen automatically, just copy the access token obtained using the authtoken method and paste it in this text box.

Base URLs:

Request and Response Parameters

Common Request Header / Body / Query Parameters

The Request Header parameters is applicable to all other field attributes and features

Name Requirement
(True or False)
Data Type Description
Authorization Required String The JWT Token in format "Bearer xxxx.yyyy.zzzz"

The Request Body / Query parameters is applicable to all other field attributes and features.

Name In Requirement (True or False) Data Type Description
page query Optional/False Integer / Number Enter the page number with default value as 1
size query Optional/False Number/ integer Enter the size of data with the default value as 10

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Authentication

Auth & User Management

This call authenticates the validity of a username / password combination. If the authentication is successful, a valid access token is issued. Use the username and password provided to you in your RatesAPI packet.

Example: grant_type=password and username=username and password=password

Auth is handled using the usual JWT bearer tokens with a configurable default expiry (usually 24 hours).

● There is a POST /authtoken route, where the user provides the username and password, and gets back a valid JWT issued on a successful authentication. This JWT must be supplied in the header for all subsequent calls to the API.

● As our generic APIs may need to be accessed programmatically from other backend servers, can additionally provide certain users with a secure API Key (with a rotation/regeneration functionality) with an IP whitelisting for the accessing server(s).

Sample Request (JSON Code Format Snippet)

{
"username": "string",
"password": "string"
}

This POST method searches for the matching user login credentials to authenticate / validate the credentials, based on the provided search key and the respective values passed, with Permission as PUBLIC.

Request Body Parameters

No Parameters are passed.

Name In Data Type Requirement (True or False) Description
body body userreq true none

Request Body

Parameter Name Type Description Value Requirement (Optional or Mandatory)
username String Enter a username only Nullable Required / Mandatory / True
password String Enter a password Nullable Required / Mandatory / True

Success Response code is 200

Status Meaning Description Schema
200 OK Success UserResp
400 Unauthorized Invalid Grant Type None
405 Not Found HTTP Method not available None

Account

These methods retrieve the call limitations set for your account. These limitations are based on the commercial terms of your account and are set at the time the account was first created and changed to reflect any change to these commercial terms.

GET /credits

validtill --> This parameter indicates the “valid till” date for your account.

calls --> This parameter retrieves the maximum calls allowed on your account for different time durations. (Per second/minute/hour/day/week/month).

The “pullsperday”, “rateshops”, “horizonmax” and “schedules” indicate the maximum permissible limit available for your account for these features.

Success Response code is 200

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Hotel Information

This method provides a channel for the user to request mapping of a location to a source. t is not currently mapped to. Parameters required are the hotelcode and the websitecode of the source/s if already available in the RateMetrics database, or the base URL of the source/s required.

Status Codes

1 Queue
2 Work in Progress
3 Completed
4 Source already exists in RM and websitecode is available
5 Not Feasible

Approximatetime --> This method provides the approximate turnaround time for the request. The default minimum is 72 hours and will vary based on parameter values.

POST /sourcemaprequest

No Parameters are passed.

Source Map Request URL Parameters

Source Map Request Sample (JSON Code Format Snippet)

{
     hotelcode : 0,
     sources : [
        0
         ],
     urls : [
    "string"
    ]
}
    
Name In Data Type Requirement (True or False) Description
hotelcode Req Body integer - -
sources - integer True Nullable
URLS - string True Nullable

Source Map Request Responses

Source Map Request Sample (JSON Code Format Snippet)

{
     hotelcode : 0,
     sources : 0,
     urls : [
    "string"
         ]
  }
    
Status Meaning Description Schema
200 OK Success entityResp

Hotel Info Request Body Parameters

Source Map Request Sample (JSON Code Format Snippet)

{
   hotelcode : 0,
   hotelcode : [
  "string"
       ]
}
  
Name Requirement (True or False) Data Type Description
hotelcode true integer nullable
hotelcodes true integer nullable

Hotel Info Request Responses

Hotel Info Sample Response (JSON Code Format Snippet)

{
"hotelCode" : 0, "hotelName" : "string" , "hotelGroup" : "string" , "address" : "string", "city" : "string" , "state": "string" , "country": "string" , "zip" : "string" , "lat" : "string" , "lng" : "string", "rating" : "string" , "status" : 0, "currencycode" : "string" , "propertyType" : "string" , "time_zone" : "string" , "time_zone_name" : "string", "countrycode" : "string", "hotelSources": [ { "mapID": 0, "hotelCode": 00 "websiteCode": 0, "baseurl": "string" , "createddate": "2023-04-20T05:57:50.243Z" , "modifieddate": "2023-04-20T05:57:50.243Z" , "hotelCodeNavigation": "string" , "websiteCodeNavigation": { "websiteCode": 0, "websiteName": "string", "url": "string", "channeltype": "string", "status": 0, "createddate": "2023-04-20T05:57:50.243Z", "snapshot": 0, "description": "string", "coverage": "string", "hotelSources": [ "string" ], "hotelSources_backups": [ "string" ] } } ], "hotelSources_backups": [ { "mapID": 0, "hotelCode": 0, "websiteCode": 0, "baseurl": "string", "createddate": "2023-04-20T05:57:50.243Z", "hotelCodeNavigation": "string", "websiteCodeNavigation": { "websiteCode": 0, "websiteName": "string", "url": "string", "channeltype": "string", "status": 0, "createddate": "2023-04-20T05:57:50.243Z", "snapshot": 0, "description": "string", "coverage": "string", "hotelSources": [ "string" ], "hotelSources_backups": [ "string" ] } } ] }
Status Meaning Description Schema
200 OK Success -
401 Unauthorized Authorization has been denied for this request None
Name Requirement (True or False) Data Type Description
hotelCode $int32) integer -
hotelName true string Nullable
hotelGroup true string Nullable
address true string Nullable
city true string Nullable
state true string Nullable
country true string Nullable
zip true string Nullable
lat true string Nullable
lng true string Nullable
rating true string Nullable
status true integer Nullable
currencycode true string Nullable
propertyType true string Nullable
time_zone true string Nullable
time_zone_name true string Nullable
countrycode true string Nullable
hotelSources true string Nullable
hotelSources
mapID $int64) integer -
hotelCode $int32) integer -
websiteCode $int32) integer -
baseurl true string Nullable
createddate true string Nullable
modifieddate true string Nullable
mapID integer($int64) integer -
hotelCode $int32) integer -
hotelCodeNavigation - - -
websiteCodeNavigation - - -
websiteCode $int32) integer -
websiteName true string nullable
url true string nullable
channeltype true string nullable
status true integer nullable
createddate true string nullable
snapshot true integer nullable
description true string nullable
coverage true string nullable
hotelSources true - -
hotelSources_backups true - nullable
hotelSources_backups
mapID $int64) integer -
hotelCode $int32) integer -
websiteCode $int32) integer -
baseurl true string nullable
createddate true string nullable
hotelCodeNavigation - websiteCodeNavigation
websiteCode integer($int32) integer($int32) -
websiteName true string nullable
url true string nullable
channeltype true string nullable
status true integer nullable
createddate true string nullable
snapshot true integer nullable
description true string nullable
coverage true string nullable
hotelSources true - nullable
hotelSources true - nullable

Source Map Request (requestid) Body Parameters

This method accepts the request id obtained in the response to the initial request. The response is identical to the initial response, but with the updated status at that point of time.

Responses

Name In Data Type Requirement (True or False) Description
requestid Req path Integer ($int32) required The id of the request

Source Map Request (requestid) Responses

Success Response code is 200

Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request -

Hotel Map Request Body Parameters

No Parameters are passed.

http://api.ratemetrics.com/hotelmaprequest

This method provides a way to add a new location that a user is unable to find in the API database. It accepts hotel name, address, geo coordinates with reference URLs if any or preferred website codes to map. The fields hotelname, address, city, state, country, zip are mandatory. The parameter requestid is unique for every mapping request.

Status Codes

Hotel Map Request Parameters Sample (JSON Code)

{
"hotelname" : string, "address" : "string" , "city" : "string" , "state" : "string", "country" : "string" , "zip": "string" , "latitude": 0 , "longitude" : 0 , "url" : [
"string" ], "websitecodes" : [
0 ] }
1 Queue
2 Work in Progress
3 Completed
4 Hotel exists
5 Feasibility failed
5 Source unavailable

Referencehotelcodes --> This parameter contains an array of hotel codes that are available with in 100 meters of radius for the specified address.

Approximatetime --> This method provides the approximate turnaround time for the request. The default minimum is 72 hours and will vary based on parameter values.

Hotel Map Request Responses Parameters

Hotel Map Request Responses Sample (JSON Code)

{
"hotelname" : "", "address" : "" , "city" : "" , "state" : "", "country" : "" , "zip": "" , "latitude": 0 , "longitude" : 0 , "url" : [
"string" ], "websitecodes" : [
0 ] }

Success Response code is 200

Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request -
Name Requirement (True or False) Data Type Description
hotelname true string nullable
address true string nullable
city true string nullable
state true string nullable
country true string nullable
zip true string nullable
latitude integer($int32) integer -
longitude integer($int32) integer -
url true string nullable
websitecodes true integer nullable

Map Request Status (requestid) Request Parameters

To check status of request the /maprequeststatus method is used. This method takes the requestid as the only input parameter and the response is identical in structure to the response of the /hotelmaprequest method.

Name In Data Type Requirement (True or False) Description
requestid Req path Integer ($int32) required The id of the request

Map Request Status (requestid) Response Codes

Success Response code is 200

Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None

Hotels Request Body Parameters

Hotels Request Parameters Sample (JSON Code)

{
"hotelname" : "string", "country" : "string" , "city": "string" , "state": "string" , "zip" : "string" , "keyword" : "string" , }

This Hotels API call returns a list of all hotels available in the RatesAPI for hotel room rate retrieval. If any hotel you wish to retrieve the hotel room rates for, and that which is not in our database, please send a request to support@ratemetrics.com. We will try to make it available within the next 24 hours.

Country or hotelname are mandatory parameters. All other parameters are optional.

hotelcode --> This is the unique ID assigned to a hotel location and is a mandatory parameter for all rate retrieval calls made on this API. No Parameters are passed.

Example --> { country: 'United States of America' } {hotelname: 'Hyatt' }

Hotels Request Responses Codes

Hotels Request Responses Sample (JSON Code)

{
"hotelname" : "", "country" : "United States of America" , "city": "" , "state": "" , "zip" : "" , "keyword" : "" , }
Status Meaning Description Schema
200 Success Success -
400 Unauthorized Authorization has been denied for this request None

API - Hotels Request Response Status Codes

Name Requirement (True or False) Data Type Description
hotelname true string nullable
city true string nullable
state true string nullable
country true string nullable
zip true string nullable
keyword true string nullable

Rate Shop

Rateshop Request Parameters Sample (JSON Code)

{
"rateshopname" : "string", "occupancy" : 10, "currency": 3 , "state": "string" , "currencies" : [ "string" , ] "fetchtype" : 0 , "horizon" : 365 , "hotelcodes" : [ 0 , ] "compsets" : [ { "hotelcode" : 0 , "competitorhotelcodes" : [ 0 , ] } ], "sources" : [ 0 , ], "horizonexpression" : "string", "horizonrange" : "string", "pos" : 10, }

POST /Rateshop

Rateshop Request Body Parameters

This Rateshop API call creates a new RateShop which is a collection of hotels and related parameters like LOS, horizon, source etc. defining what data should be retrieved.

rateshopname--> Your custom name for the RateShop

los --> Length of stay for the rates requested. The maximum permitted value is 10

occupancy --> Room occupancy for the rate requested

currency --> The currency the rate is to be fetched in

horizon --> How many consecutive days from the call date to retrieve data for (days out)

horizonexpression --> A customizable horizon to define specific day or days in the future.

For example

1. Date Range --> (2 - 5) will fetch data from the second to fifth day starting from the date immediately following the start date.

2. Odd Days--> (1,3,5,7,9) will fetch every alternate day, starting from the date immediately following the start date

3. Mix --> (2-5, 7, 14, 21) will fetch second to fifth day and seventh, fourteenth and twenty-first days starting from the date immediately following the start date.

The maximum value for the horizon and horizonexpression is 365

Source --> The sources to be included in the call

fetchtype --> The parameter receives integer value 1 and 2. The value 1 fetches the rates with currency one by one from currencies parameter and stops if the currency and rate is available but fetchtype 2 will fetches all currencies from the source.

pos --> This parameter decides the rateshop call be made from which region. By default, use ‘0’. In case you need specific POS then please contact our support team. POS feature is available at additional charge.

hotelscodes vs compsets --> Using hotelcodes you can group an arbitrary set of hotels. Using compset allows you to differentiate hotels as subject hotels and competitor hotels, with each subject linked to a set of competitor hotels. This association in reflected in the output which is flat for hotelcodes and hierarchical for comp sets. Rateshopname, los and occupancy are mandatory fields. The other fields are optional or can be specified during the Rate method in conjunction with the rateshopid. Any such parameter passed in the Rate method, overrides the corresponding definition already defined in the Rateshop.

Rateshop Request Responses Codes

Rateshop Request Responses Sample (JSON Code)

{
"rateshopname" : "string", "los" : 0, "occupancy": 0, "currency": "string" , "currencies" : [ "string" , ] "fetchtype" : 0 , "horizon" : 0 , "hotelcodes" : 0 , "compsets" : { "hotelcodes" : 0 , "competitorhotelcodes" : [ 0 , ] }, "sources": 0 , "horizonexpression" : [ "string" , ], "pos" : 0 }
Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

API - Rateshop Request Response Status Codes

Name Requirement (True or False) Data Type Description
rateshopname true string nullable
los integer($int32) example: 0 integer nullable
occupancy integer($int32) example: 0 integer nullable
currency true example: string string nullable
currencies true string nullable
fetchtype integer($int32) example: 0 integer nullable
hotelcodes true example: 0 integer($int32)] integer -
compsets true example: OrderedMap { "hotelcode": 0, "competitorhotelcodes": List [ 0 ] } string] string -
sources true example: 0 integer($int32) integer nullable
horizonexpression true string nullable
pos integer($int32) example: 0 integer -

GET /Rateshoplist

This Rateshoplist API call allows you to retrieve the list of rateshops created in your account. No parameters are passed.

Rateshoplist Request Responses Codes

Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

GET/Rateshop /{rateshopid}

This API accepts the rateshopid as the input parameter and returns/retries/fetches the configuration details for that rateshopid.

Rateshopid Request Body Parameters

Name In Data Type Requirement (True or False) Description
rateshopid Req path Integer ($int32) required The id of the rateshop

Rateshopid Request Responses Codes

Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

PUT /Rateshop /{rateshopid}

This Rateshopid API call allows the user to modify the details of an existing RateShop linked to a rateshopid.

Rateshopid Request Body Parameters

Rateshop (rateshopid) Request Parameters Sample (JSON Code)

{
"rateshopname" : "string", "los" : 10, "occupancy": 3, "currency": "string" , "currencies" : [ "string" , ] "fetchtype" : 0 , "horizon" : 365 , "hotelcodes" : [ 0 , ], "compsets" : [ { "hotelcode": 0, "competitorhotelcodes" : [ } ] ], "sources" : [ 0 , ] "horizonexpression" : "string" "horizonrange" : "string" "pos" : 0 }
Name In Data Type Requirement (True or False) Description
rateshopid Req path Integer ($int32) required The id of the rateshop
Name Requirement (True or False) Data Type Description
rateshopname True minLength: 1 string nullable
los integer($int32) maximum: 10 minimum: 1 integer nullable
occupancy integer($int32) maximum: 3 minimum: 1 integer nullable
currency true example: string string nullable
currencies true string nullable
fetchtype integer($int32) example: 0 integer nullable
horizon true example: 0 integer($int32)] integer nullable
compsets true example: OrderedMap { "hotelcode": 0, "competitorhotelcodes": List [ 0 ] } string] string -
sources true example: 0 integer($int32) integer nullable
horizonexpression true string nullable
horizonrange integer($int32)] string nullable
pos Tinteger($int32) example: 0 integer -

Rateshop (rateshopid) Request Responses Codes

Rateshop (rateshopid) Request Responses Sample (JSON Code)

{
"rateshopname" : "string", "los" : 10, "occupancy": 3, "currency": "string" , "currencies" : [ "string" , ] "fetchtype" : 0 , "horizon" : 365 , "hotelcodes" : [ 0 , ], "compsets" : [ { "hotelcode": 0, "competitorhotelcodes" : [ } ] ], "sources" : [ 0 , ] "horizonexpression" : "string" "horizonrange" : "string" "pos" : 0 }
Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -
Name Requirement (True or False) Data Type Description
rateshopname True minLength: 1 string nullable
los integer($int32) maximum: 10 minimum: 1 integer nullable
occupancy integer($int32) maximum: 3 minimum: 1 integer nullable
currency true example: string string nullable
currencies true string nullable
fetchtype integer($int32) example: 0 integer nullable
horizon true example: 0 integer($int32)] integer nullable
compsets true example: OrderedMap { "hotelcode": 0, "competitorhotelcodes": List [ 0 ] } string] string -
sources true example: 0 integer($int32) integer nullable
horizonexpression true string nullable
horizonrange integer($int32)] string nullable
pos Tinteger($int32) example: 0 integer -

DELETE /Rateshop/{rateshopid}

This rateshopid API call allows you to delete a RateShop from your account. It accepts rateshopid (required) as the parameter and returns the status of the request.

The same rateshopid is the parameter with the same response codes as 200, 400, 401, 429.

Rates

POST /hotelrates

This Hotelrates API call allows you to make a granular request for a single rate. This will require building all logic for retrieving rates in your application, but allows customization with the benefit of increased speed.

The input parameters are

hotelcode --> The hotelcode for the hotel to be shopped

checkin --> Specific date for the check-in

checkout --> Specific date for the check-out

guests --> Occupancy for the room

currency --> The currency to fetch price in

websitecode --> The sourceid assigned to the source to be shopped.

snapshot --> Toggle true to enable screen capture for a call. The default values set to False

pos --> This parameter decides the call be made from which region. By default use ‘0’. In case you need specific POS then please contact our support team. POS feature is available at additional charge.

The output parameters:

onsiterate --> Is the actual rate the hotel room is available for.

netrate --> It is the netrate rate of the hotel room before discount

maxoccupancy --> Maximum number of guest the specific room can accommodate

ispromo --> Y/N values, which indicates whether the room have promotions/offers/discounts or not (Y - Available / N - Not Available)

taxtype --> Contains the tax information fetched from pricing page

taxstatus --> Possible values are -1, 1, 2, 3, where -1 denotes Tax information not available, 1 denotes Tax Included in rate, 2 denotes Tax not included in rate, 3 denotes Tax partially included in rate

taxamount --> Contain the taxable value

israteperstay --> Possible values are N and Y, where N denotes the rate published is 'rate per night' and Y denotes the rate is 'rate per stay'. This would be helpful when los is greater than 1

For other parameters like currency, roomtypecode, conditionscode and mealplancode refer to “Reference” section at the bottom of this document.

For the various code explanation, please review your RatesAPI packet, or make the individual method calls to pull back a list of codes and their descriptions.

Hotelrates Request Body Parameters

Hotelrates Request Parameters Sample (JSON Code)

{
  "hotelcode": 0,
  "checkin": "2023-04-12T11:34:38.644Z",
  "checkout": "2023-04-12T11:34:38.644Z",
  "guests": 0,
  "currency": "string",
  "websitecode": 0,
  "pos": 0,
  "snapshot": true,
  }
  
Name Requirement (True or False) Data Type Description
intern False Boolean -
queueid Default Value: 0 integer -
subjectcode Default Value: 0 Integer ($int32) -
orefid - string -
username - string The name of the user

Hotelrates Request Query Parameters

Name Requirement (True or False) Data Type Description
hotelcode* integer($int64) integer -
checkin* string($date-time) string -
checkout* string($date-time) string -
guests* integer($int32) integer -
currency* string minLength: 1 string -
websitecode* integer($int32) integer -
pos integer($int32) true integer nullable
snapshot boolean true boolean nullable

Hotel Rates Request Responses Codes

Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

GET /runstatus /{queueid}

This API call returns the status of the Rateshop run request. Status codes available in this method are:

  1. In-progress
  2. Completed
  3. Terminated with errors
  4. Terminated, No credits available
  5. Rerun in-progress

Runstatus (queueid) Request Path Parameters

Name Requirement (True or False) Data Type Description
queueid required integer The id of the queue.

Status Meaning Description Schema
200 Success Success -

POST /runrateshop

This runrateshop API call retrieves the rates using the configuration parameters as defined during the RateShop creation. The rateshopid is the only mandatory parameter.

queueid--> The uniqueID for running a RateShop

approximatetime --> Estimated time before all the rates are retrieved.

While it is possible to define all request parameters during RateShop creation, you may prefer to define a few parameters at runtime. Even if the parameters for a RateShop is defined during creation, you can override those parameters during runtime.

Runrateshop Request Body Parameters

{
"rateshopid" : "2023-04-12T12:30:27.408Z", "horizon" : 0, "horizonexpression": "string", "sources" : [ 0 , ] "hotelcodes" : [ 0 , ], "compsets" : [ { "hotelcode": 0, "competitorhotelcodes" : [ 0 ] } ], "sources" : true }
Name Requirement (True or False) Data Type Description
rateshopid* integer($int32) integer -
startdate string($date-time) true string Nullable
horizon integer($int32) true string Nullable
horizonexpression string true integer Nullable
sources true integer($int32)] string Nullable
hotelcodes true integer($int32)] integer Nullable
compsets true compset integer Nullable
hotelcode integer($int32) integer -
competitorhotelcodes [ nullable: true integer($int32)] integer Nullable
snapshot boolean nullable: true boolean Nullable

Runrateshop Request Responses Codes

Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

POST /ratesbyqueue /{queueid}

This API call allows you to review all running RateShops and provides you the current running status. If all calls in the RateShop has been run and the queue is complete, this method returns the retrieved data as response

If you define a hook to retrieve data, rates will be delivered as they are retrieved. Even if you have defined a hook for delivery, you can still retrieve the rate using the queueid. This route is available for 36 hours from the time of call.

The output parameters:

hotelcode --> The hotelcode for the hotel to be shopped

checkin --> Specific date for the check-in

checkout --> Specific date for the check-out

guests --> Occupancy for the room

currency --> The currency to fetch price in

websitecode --> The sourceid assigned to the source to be shopped

snapshot --> Toggle true to enable screen capture for a call. The default values set to False

pos --> This parameter decides the rateshop call made from which region.

maxoccupancy --> Maximum number of guest the specific room can accommodate

ispromo --> Y/N values, which indicates whether the room have promotions/offers/discounts or not (Y - Available / N - Not Available)

taxtype --> Contains the tax information fetched from pricing page

taxstatus --> Possible values are -1, 1, 2, 3, where -1 denotes Tax information not available, 1 denotes Tax Included in rate, 2 denotes Tax not included in rate, 3 denotes Tax partially included in rate

taxamount --> Contain the taxable value

israteperstay --> Possible values are N and Y, where N denotes the rate published is 'rate per night' and Y denotes the rate is 'rate per stay'. This would be helpful when los is greater than 1

For other parameters like currency, roomtypecode, conditionscode and mealplancode refer to “Reference” section at the bottom of this document.

Queueid is the integer, required, path parameter, with Success Response code as 200

Schedules

POST /Schedule

This API call allows a user to create a time-table for running a specific Rateshop at a predetermined date and time on a set schedule. While creating this schedule, the user can also define the mode of delivery. Options are a Web-Hook or through a queueid.

year

- No specification "2016"- One year only "2016, 2017" - Runs 2 years month

"" - runs all 12 months in a year

  1. January
  2. February
  3. March
  4. April
  5. May
  6. June
  7. July
  8. August
  9. September
  10. October
  11. November
  12. December

"1,3,5" runs every Monday, Wednesday, and Friday

day

All day in a month

1 - 31 - Any day index in a calendar month. can be passed expression like "1,3,5"

hour

This parameter can be any value from 0-23 and this value determines the hour of day the rateshop is invoked. If the value is "" it is considered as undefined and can be run anytime within 24 hours.

minute

This parameter can be any value from 0-59 and this value determines the minute within the hour of day defined in earlier parameter, the rateshop is invoked. If the value is "" it is considered as undefined and can be run anytime within the defined hour.

seconds

This parameter can be any value from 0-59 and this value determines the second within the minute of hour defined in earlier parameter, the rateshop is invoked. If the value is "" it is considered as undefined and can be run anytime within the defined minute.

Schedule Request Body Parameters

Schedule Request Parameters Sample (JSON Code)

{
"schedulename" : "string", "rateshopid" : 0, "year": "string", "month" : "string" "dow" : "string" "day" : "string" "hour" : "string" "minute" : "string" "seconds" : "string" "status" : 2 "startdate" : "2023-04-12T13:51:44.523Z" "enddate" : "2023-04-12T13:51:44.523Z" }
Name Requirement (True or False) Data Type Description
schedulename* string minLength: 1 string -
rateshopid* integer($int32) integer -
year* string minLength: 1 string -
month* string minLength: 1 string -
dow* string minLength: 1 string -
day* string minLength: 1 string -
hour* string minLength: 1 string -
minute* string minLength: 1 string -
seconds* string minLength: 1 string -
status* integer($int32) maximum: 2 minimum: 1 integer -
startdate* string($date-time) string -
enddate string($date-time) nullable: true string Nullable

Schedule Responses Codes

Schedule Response Code Sample (JSON Code)

{
"schedulename" : ""X-Mas", "rateshopid" : 0, "year": "", "month" : "" "dow" : "" "day" : "" "hour" : "" "minute" : "" "seconds" : "" "status" : 1 "startdate" : "2023-02-16" "enddate" : "22023-02-16" }
Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -
Name Requirement (True or False) Data Type Description
schedulename* string minLength: 1 True example: X-Mas string Nullable
rateshopid* integer($int32) integer -
year* string minLength: 1 example: * string -
month* string minLength: 1 example: * string -
dow* string minLength: 1 example: * string -
day* string minLength: 1 example: * string -
hour* string minLength: 1 example: 1 string -
minute* string minLength: 1 string -
seconds* string minLength: 1 example: * string -
status* integer($int32) maximum: 2 minimum: 1 integer -
startdate* string($date-time) example: 2023-02-16 string -
enddate string($date-time) nullable: true example: 2023--02-16 string Nullable

GET /Schedule/{scheduleid}

This Scheduleid API call retrieves schedule configuration using the scheduleid as a mandatory parameter.

Scheduleid as integer (($int32)) path parameter.

Scheduleid Request Responses Codes

Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

PUT /Schedule/{Scheduleid}

{
"schedulename" : "string", "rateshopid" : 0, "year": "string", "month" : "string" "dow" : "string" "day" : "string" "hour" : "string" "minute" : "string" "seconds" : "string" "status" : 2 "startdate" : "2023-04-12T15:05:46.242Z" "enddate" : "2023-04-12T15:05:46.243Z" }

This API call deletes a schedule from your account. It accepts the scheduleid as parameter and returns the status of the request.

Name Required / Mandatory (True/ False Data Type Description
scheduleid Required integer The id of the schedule
Name Data Type with Example
schedulename* string minLength: 1
rateshopid* integer($int32)
year* string minLength: 1
month* string minLength: 1
dow* string minLength: 1
day* string minLength: 1
hour* string minLength: 1
minute* string minLength: 1
seconds* string minLength: 1
status* string minLength: 1
startdate* string minLength: 1
enddate string minLength: 1

Scheduleid Request Responses Codes

Schedule Response Code Sample (JSON Code)

{
"schedulename" : ""X-Mas", "rateshopid" : 0, "year": "", "month" : "" "dow" : "" "day" : "" "hour" : "" "minute" : "" "seconds" : "" "status" : 1 "startdate" : "2023-02-16" "enddate" : "22023-02-16" }
Name Requirement (True or False) Data Type Description
schedulename* string minLength: 1 True example: X-Mas string Nullable
rateshopid* integer($int32) integer -
year* string minLength: 1 example: * string -
month* string minLength: 1 example: * string -
dow* string minLength: 1 example: * string -
day* string minLength: 1 example: * string -
hour* string minLength: 1 example: 1 string -
minute* string minLength: 1 string -
seconds* string minLength: 1 example: * string -
status* integer($int32) maximum: 2 minimum: 1 integer -
startdate* string($date-time) example: 2023-02-16 string -
enddate string($date-time) nullable: true example: 2023--02-16 string -
Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

DELETE /Schedule/{Scheduleid}

This API call deletes a schedule from your account. It accepts the scheduleid as parameter and returns the status of the request.

Name Required / Mandatory (True/ False Data Type Description
scheduleid Required integer The id of the schedule
Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

POST /schedulelog

This API call allows you to retrieve the schedule log of active queueids. By default the call will retrieve the schedules executed on the current date. You can filter using rateshopid, scheduleid, startdate and enddate parameters.

No Parameters.

Schedule Log Request Body Parameters

Schedule Log Request Sample (JSON Code)

{
"schedulename" : 0, "startdate" : "2023-02-16", "enddate": 0, }
Name Data Type
scheduleid* integer($int32)
startdate* string($date-time)
enddate* string($date-time)

Schedule Log Response Parameters

Schedule Log Response Sample (JSON Code)

{
"schedulename" : 0, "startdate" : "2023-04-12T15:21:06.665Z", "enddate": "2023-04-12T15:21:06.665Z", }
Name Data Type
scheduleid* integer($int32) example: 0
startdate* string($date-time) example: 2023-02-16
enddate* string($date-time)
Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

GET /Schedulelist

This API call allows you to retrieve the list of schedules defined in your account.

No Parameters are passed.

Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

Hooks

Post

This API calls uses a Web Hook to enable delivery of Queue status to an end-point you define. If you have defined a hook, the status of successful completion or termination due to error, whichever may be the case, is delivered to your end-point. This hook will POST the following JSON Schema to your end-point. No Parameters.

Hooks Queuealerts Request Parameters

Hooks Queuealerts Request Sample (JSON) code

{
"endpoint" : "string", "authtype" : "string", "username": "string", "password": "string", "token": "string", }
Name Data Type Required - True / False
endpoint String minLength: 1 -
authtype string Nullable: true
username string Nullable: true
password string Nullable: true
token string Nullable: true

Hooks Queuealerts Response Codes

Hooks Queuealerts Responses Sample (JSON) code

{
"endpoint" : "", "authtype" : "", "username": "", "password": "", "token": "", }
Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -
Name Data Type Required - True / False
endpoint String minLength: 1 -
authtype string Nullable: true
username string Nullable: true
password string Nullable: true
token string Nullable: true

POST /hooks/rate

This API call uses a WebHook to enable delivery of data generated by your RateShop to an end-point you define. If you have defined a hook, rates are delivered by default to this hook. This hook will POST the following JSON Schema to your end-point.

No Parameters are passed.

Hooks Rate Request Body Parameters

Hooks Queuealerts Responses Sample (JSON) code

{
"endpoint" : "string", "authtype" : "string", "username": "string", "password": "string", "token": "string", }
Name Data Type Required - True / False
endpoint String minLength: 1 -
authtype string Nullable: true
username string Nullable: true
password string Nullable: true
token string Nullable: true

Hooks Rate Request Responses Codes

Hooks Queuealerts Responses Sample (JSON) code

{
"endpoint" : "", "authtype" : "", "username": "", "password": "", "token": "", }
Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
429 Access Limits You have exceeded your access limit -

References

GET /Currencies

This Currencies API call returns a list of supported currencies as well as the format acceptable in the RatesAPI. The currency name is used when passing the currency parameter in the /rateshop method to specify the currency to be used in the search.

No Parameters with Response Code as 200 - Success.

GET /Countries

This Countries API call return list of supported country names as well as the format acceptable in the RatesAPI. This is used in the /hotels method when passing the country parameter while searching for a specific hotelcode.

No Parameters with Response Code as 200 - Success.

GET /Sources

This Sources API call returns a list of available sources as well as the unique identifier assigned to each source in the RatesAPI. This allows you to specify a particular source ID when defining a RateShop

No Parameters with Response Code as 200 - Success.

GET /roomtypes

This roomtypes API call returns a list of room type categories as well as the unique identifier assigned to each room type in the RatesAPI. The API maps source room types into broad categories for comparison.

No Parameters with Response Code as 200 - Success.

GET /mealplans

This mealplans API call returns a list of meal plan categories as well as the unique identifier assigned to each meal plan in the RatesAPI. The API maps source meal plans into broad categories for comparison.

No Parameters with Response Code as 200 - Success.

GET /statuscodes

This statuscodes API calls returns a list of status codes you may receive when using any calls in the Rates section.

No Parameters with Response Code as 200 - Success.

GET /POS

No Parameters with Response Code as 200 - Success.

Meta Search

GET /meta /Countries

This Countries API call return list of supported country names as well as the format acceptable in the RatesAPI. This is used in the /hotels method when passing the country parameter while searching for a specific hotelcode.

No Parameters with Response Code as 200 - Success.

GET /meta /Sources

This Sources API call returns a list of available sources as well as the unique identifier assigned to each source in the RatesAPI. This allows you to specify a particular source ID when defining a RateShop.

No Parameters with Response Code as 200 - Success.

GET /meta /statuscodes

This statuscodes API calls returns a list of status codes you may receive when using any calls in the Rates section.

No Parameters with Response Code as 200 - Success.

GET /meta /hotels

This hotles API call returns a list of all hotels available in the RatesAPI for rate retrieval. If any hotel you wish to retrieves rates for is not in our database, please send a request to support@ratemetrics.com.

We will try to make it available within the next 24 hours. Country or hotelname are mandatory parameters. All other parameters are optional. hotelcode - This is the unique ID assigned to a hotel location and is a mandatory parameter for all rate retrieval calls made on this API. Example: { country: 'United States of America' } {hotelname: 'Hyatt' } No Parameters.

Meta Search Hotels Request Body Parameters

Meta Search Hotels Sample Request (JSON) Code

{
"hotelname" : "string", "country" : "string", "city": "string", "state": "string", "zip": "string", "keyword": "string", }
Name Requirement (True or False) Data Type Description
hotelname true string nullable
city true string nullable
state true string nullable
country true string nullable
zip true string nullable
keyword true string nullable

Meta Search Hotels Response Codes and Response Parameters

Meta Search Hotels Sample Request (JSON) Code

{
"hotelname" : "", "country" : "United States of America", "city": "", "state": "", "zip": "", "keyword": "", }
Name Requirement (True or False) Data Type Description
hotelname true string nullable
city true string nullable
state true string nullable
country true string nullable
zip true string nullable
keyword true string nullable
Status Meaning Description Schema
200 Success Success -
401 Unauthorized Authorization has been denied for this request None

GET /meta/hotelinfo

This hotelinfo API call uses the hotelcode obtained in the previous call to retrieve the list of sources available for that specific hotel.

websitecode --> This is the unique ID assigned to each source in the RatesAPI. This code is used as an input parameter in rate calls to constrain the call to specified sources

snapshotavailable --> This field allows you to understand if you can take a snapshot of the page at the time of data retrieval. This call is chargeable additionally and please contact support@ratemetrics.com for more information.

Example: { hotelcode: 14118 } No Parameters.

Meta Search Hotelinfo Request Parameters

Name Data Type
hotelcode integer($int32) nullable: true
hotelcode nullable: true integer($int32)

Meta Search Hotelinfo Response Codes

Meta Search Hotelinfo Sample Response (JSON) Code

{
"hotelcode" : 0, "country" : [ 0 ] }
Status Meaning Description Schema
200 Success Success -
201 Unauthorized Authorization has been denied for this request None

GET /meta/rates

This API call allows you to make a specific request for a single hotel. This will require building all logic for retrieving rates in your application, but allows customization with the benefit of increased speed of response.

No Parameters.

Meta Search Rates Request Parameters

Meta Search Rates Request Parameters Sample (JSON) Code

{
"hotelcode" : 0, "websitecode" : 0, "checkin" : "2023-04-13T16:16:49.062Z", "checkout" : "2023-04-13T16:16:49.062Z", "pos" : 0 }
Name Requirement (True or False) Data Type Description
hotelcode - Integer ($int32) -
websitecode - Integer ($int32) -
checkin - String ($date-time) -
checkout - Integer ($int32) -
pos true integer nullable

Meta Search Rates Response Codes

Meta Search Rates Sample Response (JSON) Code

{
"checkout" : "2023-03-08", "checkin" : "2023-03-07", "hotelcode" : 0, "websitecode" : 0 }
Status Meaning Description Schema
200 Success Success -
400 Error - -
401 Unauthorized Authorization has been denied for this request None
Name Requirement (True or False) Data Type Description
hotelcode - Integer ($int32) Example : 0
websitecode - Integer ($int32) Example : 0
checkin Nullable String ($date-time) example: 2023-03-08
checkout Nullable String ($date-time) example: 2023-03-07