1. SearchHotelPrices

Version 14.1 by Giorgi Mdivnishvili on 2024/04/11 17:55

Method Description

This method is specifically designed for the retrieval of hotel pricing information. It supports queries for both current date prices and for prices over a specified date range.

Parameters:

  • stayDays (integer): Indicates the starting point of the stay duration in days. A default value of 0 signifies immediate date pricing retrieval.
  • stayDaysTo (integer): Specifies the endpoint of the stay duration in days. The initial value is set to 0, indicating the system will fetch prices for the immediate date by default.

Constraints:

  • The difference between stayDays and stayDaysTo must not exceed 7 days. This limitation is imposed to optimize the query performance and ensure the relevance of the returned data.

Implementation:

  1. Query Initialization: Begin by defining the stayDays and stayDaysTo parameters to frame your search criteria. These parameters enable the system to understand the desired duration for which the hotel pricing information is required.
  2. Data Retrieval: Execute the method with the provided parameters. The system processes the input and queries the database for hotel prices that match the specified duration, taking into account the constraint on the maximum duration difference.
  3. Result Processing: Upon successful retrieval, the system presents the hotel pricing data. This data is either for the current date (when both parameters are set to 0) or for the defined date range, adhering to the specified duration constraints.

Example Usage: (Examples of API calls or function usage would typically be provided here, demonstrating how to correctly implement the method to retrieve hotel prices based on immediate dates or a specified date range.)

Notes:

  • This method ensures efficient access to hotel pricing information, catering to both immediate and short-term planning needs by leveraging a simple, parameter-driven query mechanism.

This documentation provides a detailed guide for developers on utilizing the hotel pricing retrieval method, emphasizing parameter usage, operational constraints, and the process flow for executing queries and handling results.

Endpoint URL - [POST]

Request Parameters

None

Request Body

{
 "countryCode": "string",
 "locations": [
    {
     "type": "string",
     "parent": "string",
     "label": "string",
     "subLabel": "string",
     "value": "string",
     "tag": "string"
    }
  ],
 "checkInDate": "2023-12-14",
 "checkInDateTo": "2023-12-14",
 "checkOutDate": "2023-12-14",
 "stayDays": 0,
 "stayDaysTo": 0,
 "adults": 0,
 "children": 0,
 "childrenAges": [
   0
  ],
 "extendedSearch": true,
 "totalPriceFrom": 0,
 "totalPriceTo": 0,
 "recommended": true,
 "popular": true,
 "freeSale": true,
 "groupByHotel": true,
 "hotelCodes": [
   "string"
  ],
 "mealPlans": [
   "string"
  ],
 "hotelClasses": [
   "string"
  ],
 "hotelTypes": [
   "CityHotel"
  ],
 "hotelServices": [
   "HasAlcohol"
  ],
 "pagingId": "string",
 "pageNumber": 0,
 "pageRowCount": 0
}

Request Body example

{
 "countryCode": "AE",
 "checkInDate": "2024-02-15",
 "checkInDateTo": "2024-02-20",

 "stayDays": 4,
 "stayDaysTo": 6,
 "adults": 1,
 "children": 1,
 "childrenAges": [
   1
  ],
 "extendedSearch": false,
 "totalPriceFrom": 10,
 "totalPriceTo": 10000,
 "recommended": false,
 "popular": true,
 "freeSale": true,
 "groupByHotel": true,
 "hotelCodes": [
  
  ],
 "mealPlans": [
   
  ],
 "hotelClasses": [
  
  ],
 "hotelTypes": [

  ],
 "hotelServices": [
  
  ],
 "pagingId": "",
 "pageNumber": 3,
 "pageRowCount": 10
}

Response Body

[
  {
   "hotelCode": "string",
   "hotelName": "string",
   "hotelClass": "string",
   "cityUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "countryCode": "string",
   "countryName": "string",
   "districtUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "cityName": "string",
   "districtName": "string",
   "hotelType": "CityHotel",
   "latitude": "string",
   "longitude": "string",
   "hasAlcohol": true,
   "hasFreeWifi": true,
   "hasMetro": true,
   "hasPool": true,
   "hasMall": true
  }
]

Response Body example

{
   "packages": [
        {
           "id": "onlyhotel:c4e23e7e-3d54-4efa-a3db-88508230ce91:504f63ca-6dd5-4d84-8245-cf7e77ccff73",
           "priceCurrency": "USD",
           "totalPrice": 381.7,
           "agentCommissionPercent": 0.0,
           "agentCommissionAmount": 0.0,
           "hotel": {
               "hotelPriceId": "504f63ca-6dd5-4d84-8245-cf7e77ccff73",
               "providerId": 13,
               "hotelName": "Golden Tulip Al Barsha Hotel",
               "hotelCode": "ed0820c5-29b0-4e1b-8bcf-9f3c181e7961",
               "nigths": 4,
               "mealPlan": "RO",
               "hotelClass": "4",
               "availabilityType": "FreeSale",
               "availableRoomsCount": 0,
               "fewRooms": true,
               "roomCategoryCode": "e63ea5ac-4883-4059-bb0a-795a534bbbfb",
               "roomCategoryName": "Superior Twin",
               "placementTypeName": "SNGL + CHILD(6-11.99)sharing",
               "checkInDate": "2024-02-17T08:00:00.000Z",
               "checkOutDate": "2024-02-21T08:00:00.000Z",
               "adults": 1,
               "children": 1,
               "districtUID": "4c65f6ed-902b-4fd8-9419-af7884c22c5e",
               "districtName": "Al Barsha",
               "cityUID": "f5185fa3-3f56-44ed-bf6b-80386a33caa2",
               "cityName": "Dubai",
               "countryCode": "AE",
               "countryName": "United Arab Emirates",
               "hasAlcohol": true,
               "hasFreeWifi": true,
               "hasMetro": false,
               "hasPool": true,
               "hasMall": false,
               "cancellationPolicyDescription": "Cancellation Policy: 15 Day Before Arrival: 100.00 %, Early Departure: 100.00 %, NoShow: 100.00 %",
               "cancellationPolicy": {
                   "noShowChargeValue": 100.0,
                   "noShowChargeValueType": "%",
                   "earlyDepartureChargeValue": 100.0,
                   "earlyDepartureChargeValueType": "%",
                   "conditions": [
                        {
                           "timeunits": 15,
                           "timeunitType": "Day",
                           "timeOffsetTypeName": "Before Arrival",
                           "chargeValue": 100.0,
                           "chargeValueType": "%"
                        }
                    ]
                }
            },
           "extraServices": []
        },

Schema

Success

SearchOnlyHotelPackagesResponse{

packages[
nullable: trueOnlyHotelPackage{
idstring
nullable: true
priceCurrencystring
nullable: true
totalPricenumber($double)
agentCommissionPercentnumber($double)
agentCommissionAmountnumber($double)
hotelPackageHotel{
hotelPriceIdstring
nullable: true
providerIdinteger($int32)
hotelNamestring
nullable: true
hotelCodestring
nullable: true
nigthsinteger($int32)
mealPlanstring
nullable: true
hotelClassstring
nullable: true
availabilityTypeRoomAvailabilityTypeEnumstringEnum:
[ OnRequest, FreeSale, StopSale ]
availableRoomsCountinteger($int32)
fewRoomsboolean
roomCategoryCodestring
nullable: true
roomCategoryNamestring
nullable: true
placementTypeNamestring
nullable: true
placementDescriptionstring
nullable: true
checkInDatestring($date-time)
checkOutDatestring($date-time)
adultsinteger($int32)
childreninteger($int32)
districtUIDstring($uuid)
nullable: true
districtNamestring
nullable: true
cityUIDstring($uuid)
nullable: true
cityNamestring
nullable: true
countryCodestring
nullable: true
countryNamestring
nullable: true
hasAlcoholboolean
hasFreeWifiboolean
hasMetroboolean
hasPoolboolean
hasMallboolean
cancellationPolicyDescriptionstring
nullable: true
cancellationPolicyCancellationPolicyExchange{
cancellationPolicyCodestring
nullable: true
noShowChargeValuenumber($double)
nullable: true
noShowChargeValueTypestring
nullable: true
earlyDepartureChargeValuenumber($double)
nullable: true
earlyDepartureChargeValueTypestring
nullable: true
conditions[
nullable: trueCancellationPolicyConditionExchange{
timeunitsinteger($int32)
timeunitTypestring
nullable: true
timeOffsetTypeNamestring
nullable: true
chargeValuenumber($double)
nullable: true
chargeValueTypestring
nullable: true

}]

}

}

extraServices[
nullable: trueHotelExtraServiceBase{
extraServiceCodestring
nullable: true
extraServiceTypeCodestring
nullable: true
isMandatoryinteger($int32)
extraServiceNamestring
nullable: true
minimalServiceAmountnumber($double)
includedPriceCodestring
nullable: true
prices[
nullable: trueHotelExtraServicePriceBase{
extraServicePriceCodestring
nullable: true
displayNamestring
nullable: true
restrictionInfostring
nullable: true
additionalInfostring
nullable: true
pricenumber($double)
extraPricenumber($double)
currencystring
nullable: true

}]

}]

}]

pagingIdstring
nullable: true
pageNumberinteger($int64)
pageCountinteger($int64)

}

Definitions

Paging and Caching

During the first request, Paging id must be  empty like this  ( "pagingId": "",)  pagenumber is the number of the page, pagerowcount means number of the given result in one page. So in the first request we can search like this:

first request

 {
 "pagingId": "",
 "pageNumber": 1,
 "pageRowCount":10
 }

Request with caching

as we receive response, in the end we can see pagingId- number, chich we can use for caching, and then just switch pagenumbers. for cleaning cache, it's important to make new request without pagingID

 {
 "pagingId": "80",
 "pageNumber": 1,
 "pageRowCount":10
 }

Important

Error

It's Important to in every other request header, put Auth token

Key - Authorization

Value - Bearer Token what is given in this response.

also note in headers that:

Content-Type - application/json

Key - X-nugios-timezone

Value - 240