4. Hotel Search

Last modified by Giorgi Mdivnishvili on 2024/09/04 09:58

Method Description

With the parameters provided in GetHotels and GetCities reponse, it’s avaible to search hotels with the desired parameters in Hotels Search.

endpoint : https://testapi.rustaronline.com/api/Hotels/Search

Method POST

Request example:

{
 "MaxResultCount":2,
 "MaxHotelCount":2,
 "contragentContactUID": "55a2fcfb-8378-4b73-ab1e-bc8e5c836f4e",
 "countryMask": "TR",
 "CheckInDate": "2024-05-06",
 "CheckOutDate": "2024-05-07",
 "Adults": 1,
 "Children": 0,
 "ChildrenAges": "",

   "arrivalCities": [
    {
     "cityUID": "e1344ba0-5273-4fc1-b6c4-72446260f430"
 
    }
  ]
}

Definition of Request Parameters

ParameterValueDescription
 "MaxResultCount"2,Maximum number of results to display
 "MaxHotelCount"2,Maximum number of hotels to display results
 "contragentContactUID" "55a2fcfb-8378-4b73-ab1e-bc8e5c836f4e",A unique code assigned to each application user
 "countryMask" "TR",Country code, which can be retrieved in Get Cities method, in parameter [countrycode] 
 "CheckInDate" "2024-05-06",Check in date "YY-MM-DD"
 "CheckOutDate" "2024-05-07",Check out date "YY-MM-DD"
 "Adults" 1,number of Adults
 "Children" 0,Number of children
 "ChildrenAges" "",children ages, the must be separated with "," 
 "cityUID" "e1344ba0-5273-4fc1-b6c4-72446260f430"Code of the city, which is available in method Get Cities in parameter [cityid]

In case there is need to display hotels in whole country, no mater cities, it's possible to remove "arrivalCities" parameter.

Response Example

{
   "result": [
        {
           "resultID": 1656436810005000001,
           "hotelID": 871186,
           "providerID": 5,
           "roomCategoryCode": "ECO",
           "roomCategoryName": "Economic Room",
           "mealPlanName": "BB",
           "placementType": 1,
           "placementTypeName": "1 Adult",
           "priceCode": "BASERATE BB ECO",
           "priceCurrency": "EUR",
           "priceCurrencySrc": "EUR",
           "availability": 3,
           "availableRoomsCount": 1,
           "totalSellPriceSrc": 40.70,
           "totalSellPrice": 40.70,
           "totalPriceSurcharge": 0.00,
           "cancellationPolicyDescription": "Cancellation Policy: Non refundable",
           "cancellationPolicy": {
               "noShowChargeValue": 100.00,
               "noShowChargeValueType": "%",
               "earlyDepartureChargeValue": 100.00,
               "earlyDepartureChargeValueType": "%",
               "conditions": [
                    {
                       "timeunits": 365,
                       "timeunitType": "Day",
                       "timeOffsetTypeName": "Before Arrival",
                       "chargeValue": 100.00,
                       "chargeValueType": "%"
                    }
                ]
            },
           "searchId": 1656436810,
           "hotelCode": "10b7bc34-2a03-495e-94bc-1092b07823f7",
           "id": 1656436810005000001,
           "hotel": {
               "hotelCode": "10b7bc34-2a03-495e-94bc-1092b07823f7",
               "hotelName": "Istanbul Holiday Hotel",
               "hotelClass": "***",
               "cityId": "e1344ba0-5273-4fc1-b6c4-72446260f430",
               "cityName": "Istanbul",
               "countryCode": "TR",
               "districtId": "6ca0ed7e-7412-4e45-85b5-dd0d74cabc62",
               "districtName": "Fatih",
               "note": ""
            },
           "adults": 1,
           "children": 0,
           "childrenAges": "",
           "childrenExeptInfants": 0,
           "checkInDate": "2024-05-06T00:00:00",
           "checkOutDate": "2024-05-07T00:00:00",
           "includedExtrasAmount": 0,
           "extraServices": []
        },
        {
           "resultID": 1656436810005000003,
           "hotelID": 871186,
           "providerID": 5,
           "roomCategoryCode": "STANDART-2",
           "roomCategoryName": "Standart Double or Twin Room",
           "mealPlanName": "BB",
           "placementType": 1,
           "placementTypeName": "1 Adult",
           "priceCode": "BASERATE BB STANDART",
           "priceCurrency": "EUR",
           "priceCurrencySrc": "EUR",
           "availability": 3,
           "availableRoomsCount": 1,
           "totalSellPriceSrc": 53.90,
           "totalSellPrice": 53.90,
           "totalPriceSurcharge": 0.00,
           "cancellationPolicyDescription": "Cancellation Policy: Non refundable",
           "cancellationPolicy": {
               "noShowChargeValue": 100.00,
               "noShowChargeValueType": "%",
               "earlyDepartureChargeValue": 100.00,
               "earlyDepartureChargeValueType": "%",
               "conditions": [
                    {
                       "timeunits": 365,
                       "timeunitType": "Day",
                       "timeOffsetTypeName": "Before Arrival",
                       "chargeValue": 100.00,
                       "chargeValueType": "%"
                    }
                ]
            },
           "searchId": 1656436810,
           "hotelCode": "10b7bc34-2a03-495e-94bc-1092b07823f7",
           "id": 1656436810005000003,
           "hotel": {
               "hotelCode": "10b7bc34-2a03-495e-94bc-1092b07823f7",
               "hotelName": "Istanbul Holiday Hotel",
               "hotelClass": "***",
               "cityId": "e1344ba0-5273-4fc1-b6c4-72446260f430",
               "cityName": "Istanbul",
               "countryCode": "TR",
               "districtId": "6ca0ed7e-7412-4e45-85b5-dd0d74cabc62",
               "districtName": "Fatih",
               "note": ""
            },
           "adults": 1,
           "children": 0,
           "childrenAges": "",
           "childrenExeptInfants": 0,
           "checkInDate": "2024-05-06T00:00:00",
           "checkOutDate": "2024-05-07T00:00:00",
           "includedExtrasAmount": 0,
           "extraServices": []
        }
    ],
   "error": false
}

Definition of Response Parameters

ParametervalueDescription
{  
           "resultID" 1656436810005000001,Unique ID of the Result
           "hotelID" 871186,Unique ID of the hotel
           "providerID" 5,provider id - (system internal)
           "roomCategoryCode" "ECO",Special code for Room Category type
           "roomCategoryName" "Economic Room",Name of the Room Category Type - definition of the  "roomCategoryCode"
           "mealPlanName" "BB",Meal Plan code
           "placementType" 1,Placement type code - in this case  1 means  single
           "placementTypeName" "1 Adult",Placement type name - definition of the  "placementType"
           "priceCode" "BASERATE BB ECO",price code for the current option 
           "priceCurrency" "EUR", 
           "priceCurrencySrc" "EUR", 
           "availability" 3,Availability 
           "availableRoomsCount" 1,Number of available rooms for the current type of options
           "totalSellPriceSrc" 40.70, 
           "totalSellPrice" 40.70, 
           "totalPriceSurcharge" 0.00, 
           "cancellationPolicyDescription" "Cancellation Policy  Non refundable",TEXT DESCRIPTION OF THE CANCELLATION POLICY
           "cancellationPolicy" { 
               "noShowChargeValue" 100.00, 
               "noShowChargeValueType" "%", 
               "earlyDepartureChargeValue" 100.00, 
               "earlyDepartureChargeValueType" "%", 
               "conditions" [ 
                    {  
                       "timeunits" 365, 
                       "timeunitType" "Day", 
                       "timeOffsetTypeName" "Before Arrival", 
                       "chargeValue" 100.00, 
                       "chargeValueType" "%" 
                    }  
                ]  
            },  
           "searchId" 1656436810,search id of the hotel 
           "hotelCode" "10b7bc34-2a03-495e-94bc-1092b07823f7",Unique ID of the Hotel. Full List of the hotels is available in Get Hotels method
           "id" 1656436810005000001, 
           "hotel" { 
               "hotelCode" "10b7bc34-2a03-495e-94bc-1092b07823f7",Unique ID of the Hotel. Full List of the hotels is available in Get Hotels method
               "hotelName" "Istanbul Holiday Hotel",Full name of the Hotel
               "hotelClass" "***",Hotel Class in Stars
               "cityId" "e1344ba0-5273-4fc1-b6c4-72446260f430",Code of the city where  hotel is located, which is available in method Get Cities in parameter [cityid]
               "cityName" "Istanbul",Full Name of the City
               "countryCode" "TR",Country code, which can be retrieved in Get Cities method, in parameter [countrycode] 
               "districtId" "6ca0ed7e-7412-4e45-85b5-dd0d74cabc62",District unique code, where hotel is located. 
               "districtName" "Fatih",Full name of the District
               "note" ""Hotel note - this is optional
            },  
           "adults" 1,Number of the adults
           "children" 0,Number of the children
           "childrenAges" "",in case of children, here will be their ages
           "childrenExeptInfants" 0, 
           "checkInDate" "2024-05-06T00000",date of the check in 
           "checkOutDate" "2024-05-07T00000",date of the check out
           "includedExtrasAmount" 0, 
           "extraServices" [] 
        },  

Availability Filters

1. FreeSale Parameter

  • Description: The FreeSale parameter controls whether the response should include only "FreeSale" offers or not.

    • Case 1:
      • When "FreeSale": true is passed, the response will return only hotels and offers that are available as "FreeSale".
    • Case 2:
      • When "FreeSale": false is passed, there is no restriction based on "FreeSale" status, and the system will return all offers.
    • Default Behavior:
      • If the FreeSale parameter is not passed, the system will treat it as false by default.

2. OnRequest Parameter

  • Description: The OnRequest parameter works in combination with the FreeSale parameter to filter the response based on availability status.

    • Behavior:
      • When "OnRequest": true is passed, the system will return offers that are either "OnRequest" or "FreeSale", depending on the value of the FreeSale parameter.

3. Filter Configuration

  • Note: Whether the specific API endpoint or instance applies these filters depends on the system configuration. The ability to return only FreeSale offers or a combination of OnRequest and FreeSale is determined by the setup of each instance or endpoint.

4. Example Usage

  • If "FreeSale": true is passed, the system returns only FreeSale offers.
  • If "FreeSale": false or the parameter is omitted, the system returns all offers, including both FreeSale and non-FreeSale offers.