Wiki source code of 4. Hotel Search

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

Hide last authors
Giorgi Mdivnishvili 9.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
Giorgi Mdivnishvili 1.1 2
3
Giorgi Mdivnishvili 9.1 4 {{toc/}}
5 {{/box}}
6
Giorgi Mdivnishvili 8.1 7 = Method Description =
8
9
Giorgi Mdivnishvili 1.1 10 With the parameters provided in GetHotels and GetCities reponse, it’s avaible to search hotels with the desired parameters in Hotels Search.
11
12
Giorgi Mdivnishvili 4.1 13 endpoint : [[https:~~/~~/testapi.rustaronline.com/api/Hotels/Search>>url:https://testapi.rustaronline.com/api/Hotels/Search]]
Giorgi Mdivnishvili 1.1 14
Giorgi Mdivnishvili 4.1 15 Method POST
Giorgi Mdivnishvili 3.1 16
Giorgi Mdivnishvili 7.1 17
Giorgi Mdivnishvili 8.1 18 == **Request example:** ==
Giorgi Mdivnishvili 4.1 19
Giorgi Mdivnishvili 3.1 20 {{code language="Json"}}
21 {
Giorgi Mdivnishvili 7.1 22 "MaxResultCount":2,
23 "MaxHotelCount":2,
24 "contragentContactUID": "55a2fcfb-8378-4b73-ab1e-bc8e5c836f4e",
25 "countryMask": "TR",
26 "CheckInDate": "2024-05-06",
27 "CheckOutDate": "2024-05-07",
28 "Adults": 1,
29 "Children": 0,
30 "ChildrenAges": "",
31
Giorgi Mdivnishvili 2.1 32 "arrivalCities": [
Giorgi Mdivnishvili 1.1 33 {
Giorgi Mdivnishvili 7.1 34 "cityUID": "e1344ba0-5273-4fc1-b6c4-72446260f430"
Giorgi Mdivnishvili 2.1 35
Giorgi Mdivnishvili 1.1 36 }
37 ]
Giorgi Mdivnishvili 7.1 38 }
Giorgi Mdivnishvili 1.1 39
Giorgi Mdivnishvili 7.1 40 {{/code}}
41
42
Giorgi Mdivnishvili 22.1 43 == Definition of Request Parameters ==
44
Giorgi Mdivnishvili 11.1 45 (% class="table-bordered" %)
Giorgi Mdivnishvili 13.1 46 (% class="info" %)|**Parameter**|**Value**|**Description**
47 |** "MaxResultCount"**|2,|Maximum number of results to display
48 |** "MaxHotelCount"**|2,|Maximum number of hotels to display results
49 |** "contragentContactUID"**| "55a2fcfb-8378-4b73-ab1e-bc8e5c836f4e",|A unique code assigned to each application user
Giorgi Mdivnishvili 17.1 50 |** "countryMask"**| "TR",|Country code, which can be retrieved in [[Get Cities>>Get Cities]] method, in parameter [countrycode]
Giorgi Mdivnishvili 13.1 51 |** "CheckInDate"**| "2024-05-06",|Check in date "YY-MM-DD"
52 |** "CheckOutDate"**| "2024-05-07",|Check out date "YY-MM-DD"
53 |** "Adults"**| 1,|number of Adults
54 |** "Children"**| 0,|Number of children
55 |** "ChildrenAges"**| "",|children ages, the must be separated with ","
Giorgi Mdivnishvili 15.1 56 |** "cityUID"**| "e1344ba0-5273-4fc1-b6c4-72446260f430"|Code of the city, which is available in method [[Get Cities>>Get Cities]] in parameter [cityid]
Giorgi Mdivnishvili 10.1 57
Giorgi Mdivnishvili 16.1 58
59 (% class="wikigeneratedid" %)
60 In case there is need to display hotels in whole country, no mater cities, it's possible to remove "arrivalCities" parameter.
61
62
Giorgi Mdivnishvili 8.1 63 == Response Example ==
Giorgi Mdivnishvili 7.1 64
65 {{code language="json"}}
66 {
67 "result": [
68 {
69 "resultID": 1656436810005000001,
70 "hotelID": 871186,
71 "providerID": 5,
72 "roomCategoryCode": "ECO",
73 "roomCategoryName": "Economic Room",
74 "mealPlanName": "BB",
75 "placementType": 1,
76 "placementTypeName": "1 Adult",
77 "priceCode": "BASERATE BB ECO",
78 "priceCurrency": "EUR",
79 "priceCurrencySrc": "EUR",
80 "availability": 3,
81 "availableRoomsCount": 1,
82 "totalSellPriceSrc": 40.70,
83 "totalSellPrice": 40.70,
84 "totalPriceSurcharge": 0.00,
85 "cancellationPolicyDescription": "Cancellation Policy: Non refundable",
86 "cancellationPolicy": {
87 "noShowChargeValue": 100.00,
88 "noShowChargeValueType": "%",
89 "earlyDepartureChargeValue": 100.00,
90 "earlyDepartureChargeValueType": "%",
91 "conditions": [
92 {
93 "timeunits": 365,
94 "timeunitType": "Day",
95 "timeOffsetTypeName": "Before Arrival",
96 "chargeValue": 100.00,
97 "chargeValueType": "%"
98 }
99 ]
100 },
101 "searchId": 1656436810,
102 "hotelCode": "10b7bc34-2a03-495e-94bc-1092b07823f7",
103 "id": 1656436810005000001,
104 "hotel": {
105 "hotelCode": "10b7bc34-2a03-495e-94bc-1092b07823f7",
106 "hotelName": "Istanbul Holiday Hotel",
107 "hotelClass": "***",
108 "cityId": "e1344ba0-5273-4fc1-b6c4-72446260f430",
109 "cityName": "Istanbul",
110 "countryCode": "TR",
111 "districtId": "6ca0ed7e-7412-4e45-85b5-dd0d74cabc62",
112 "districtName": "Fatih",
113 "note": ""
114 },
115 "adults": 1,
116 "children": 0,
117 "childrenAges": "",
118 "childrenExeptInfants": 0,
119 "checkInDate": "2024-05-06T00:00:00",
120 "checkOutDate": "2024-05-07T00:00:00",
121 "includedExtrasAmount": 0,
122 "extraServices": []
123 },
124 {
125 "resultID": 1656436810005000003,
126 "hotelID": 871186,
127 "providerID": 5,
128 "roomCategoryCode": "STANDART-2",
129 "roomCategoryName": "Standart Double or Twin Room",
130 "mealPlanName": "BB",
131 "placementType": 1,
132 "placementTypeName": "1 Adult",
133 "priceCode": "BASERATE BB STANDART",
134 "priceCurrency": "EUR",
135 "priceCurrencySrc": "EUR",
136 "availability": 3,
137 "availableRoomsCount": 1,
138 "totalSellPriceSrc": 53.90,
139 "totalSellPrice": 53.90,
140 "totalPriceSurcharge": 0.00,
141 "cancellationPolicyDescription": "Cancellation Policy: Non refundable",
142 "cancellationPolicy": {
143 "noShowChargeValue": 100.00,
144 "noShowChargeValueType": "%",
145 "earlyDepartureChargeValue": 100.00,
146 "earlyDepartureChargeValueType": "%",
147 "conditions": [
148 {
149 "timeunits": 365,
150 "timeunitType": "Day",
151 "timeOffsetTypeName": "Before Arrival",
152 "chargeValue": 100.00,
153 "chargeValueType": "%"
154 }
155 ]
156 },
157 "searchId": 1656436810,
158 "hotelCode": "10b7bc34-2a03-495e-94bc-1092b07823f7",
159 "id": 1656436810005000003,
160 "hotel": {
161 "hotelCode": "10b7bc34-2a03-495e-94bc-1092b07823f7",
162 "hotelName": "Istanbul Holiday Hotel",
163 "hotelClass": "***",
164 "cityId": "e1344ba0-5273-4fc1-b6c4-72446260f430",
165 "cityName": "Istanbul",
166 "countryCode": "TR",
167 "districtId": "6ca0ed7e-7412-4e45-85b5-dd0d74cabc62",
168 "districtName": "Fatih",
169 "note": ""
170 },
171 "adults": 1,
172 "children": 0,
173 "childrenAges": "",
174 "childrenExeptInfants": 0,
175 "checkInDate": "2024-05-06T00:00:00",
176 "checkOutDate": "2024-05-07T00:00:00",
177 "includedExtrasAmount": 0,
178 "extraServices": []
179 }
180 ],
181 "error": false
Giorgi Mdivnishvili 2.1 182 }
183 {{/code}}
Giorgi Mdivnishvili 1.1 184
Giorgi Mdivnishvili 18.1 185
Giorgi Mdivnishvili 22.1 186 == Definition of Response Parameters ==
Giorgi Mdivnishvili 18.1 187
Giorgi Mdivnishvili 25.1 188
189
Giorgi Mdivnishvili 18.1 190 (% class="table-bordered" %)
191 (% class="info" %)|**Parameter**|**value**|**Description**
192 |**{**| |
Giorgi Mdivnishvili 19.1 193 |** "resultID"**| 1656436810005000001,|Unique ID of the Result
194 |** "hotelID"**| 871186,|Unique ID of the hotel
195 |** "providerID"**| 5,|provider id - (system internal)
196 |** "roomCategoryCode"**| "ECO",|Special code for Room Category type
197 |** "roomCategoryName"**| "Economic Room",|Name of the Room Category Type - definition of the ** "roomCategoryCode"**
198 |** "mealPlanName"**| "BB",|Meal Plan code
199 |** "placementType"**| 1,|Placement type code - in this case  1 means  single
200 |** "placementTypeName"**| "1 Adult",|Placement type name - definition of the ** "placementType"**
201 |** "priceCode"**| "BASERATE BB ECO",|price code for the current option
Giorgi Mdivnishvili 18.1 202 |** "priceCurrency"**| "EUR",|
203 |** "priceCurrencySrc"**| "EUR",|
Giorgi Mdivnishvili 19.1 204 |** "availability"**| 3,|Availability
205 |** "availableRoomsCount"**| 1,|Number of available rooms for the current type of options
Giorgi Mdivnishvili 18.1 206 |** "totalSellPriceSrc"**| 40.70,|
207 |** "totalSellPrice"**| 40.70,|
208 |** "totalPriceSurcharge"**| 0.00,|
Giorgi Mdivnishvili 19.1 209 |** "cancellationPolicyDescription"**| "Cancellation Policy  Non refundable",|TEXT DESCRIPTION OF THE CANCELLATION POLICY
Giorgi Mdivnishvili 18.1 210 |** "cancellationPolicy"**| {|
211 |** "noShowChargeValue"**| 100.00,|
212 |** "noShowChargeValueType"**| "%",|
213 |** "earlyDepartureChargeValue"**| 100.00,|
214 |** "earlyDepartureChargeValueType"**| "%",|
215 |** "conditions"**| [|
216 |** {**| |
217 |** "timeunits"**| 365,|
218 |** "timeunitType"**| "Day",|
219 |** "timeOffsetTypeName"**| "Before Arrival",|
220 |** "chargeValue"**| 100.00,|
221 |** "chargeValueType"**| "%"|
222 |** }**| |
223 |** ]**| |
224 |** },**| |
Giorgi Mdivnishvili 19.1 225 |** "searchId"**| 1656436810,|search id of the hotel
226 |** "hotelCode"**| "10b7bc34-2a03-495e-94bc-1092b07823f7",|Unique ID of the Hotel. Full List of the hotels is available in [[Get Hotels>>Get Hotels]] method
Giorgi Mdivnishvili 18.1 227 |** "id"**| 1656436810005000001,|
228 |** "hotel"**| {|
Giorgi Mdivnishvili 20.1 229 |** "hotelCode"**| "10b7bc34-2a03-495e-94bc-1092b07823f7",|Unique ID of the Hotel. Full List of the hotels is available in [[Get Hotels>>Get Hotels]] method
230 |** "hotelName"**| "Istanbul Holiday Hotel",|Full name of the Hotel
231 |** "hotelClass"**| "~*~**",|Hotel Class in Stars
232 |** "cityId"**| "e1344ba0-5273-4fc1-b6c4-72446260f430",|Code of the city where  hotel is located, which is available in method [[Get Cities>>Get Cities]] in parameter [cityid]
233 |** "cityName"**| "Istanbul",|Full Name of the City
234 |** "countryCode"**| "TR",|Country code, which can be retrieved in [[Get Cities>>Get Cities]] method, in parameter [countrycode]
235 |** "districtId"**| "6ca0ed7e-7412-4e45-85b5-dd0d74cabc62",|District unique code, where hotel is located.
236 |** "districtName"**| "Fatih",|Full name of the District
237 |** "note"**| ""|Hotel note - this is optional
Giorgi Mdivnishvili 18.1 238 |** },**| |
Giorgi Mdivnishvili 20.1 239 |** "adults"**| 1,|Number of the adults
240 |** "children"**| 0,|Number of the children
241 |** "childrenAges"**| "",|in case of children, here will be their ages
Giorgi Mdivnishvili 18.1 242 |** "childrenExeptInfants"**| 0,|
Giorgi Mdivnishvili 20.1 243 |** "checkInDate"**| "2024-05-06T00000",|date of the check in
244 |** "checkOutDate"**| "2024-05-07T00000",|date of the check out
Giorgi Mdivnishvili 18.1 245 |** "includedExtrasAmount"**| 0,|
246 |** "extraServices"**| []|
247 |** },**| |
Giorgi Mdivnishvili 25.1 248
249
250
251 == Availability Filters ==
252
253
254 ==== 1. **FreeSale Parameter** ====
255
256 * (((
257 **Description**: The FreeSale parameter controls whether the response should include only "FreeSale" offers or not.
258
259 * **Case 1**:
260 ** When "FreeSale": true is passed, the response will return **only** hotels and offers that are available as "FreeSale".
261 * **Case 2**:
262 ** When "FreeSale": false is passed, there is no restriction based on "FreeSale" status, and the system will return all offers.
263 * **Default Behavior**:
264 ** If the FreeSale parameter is not passed, the system will treat it as false by default.
265 )))
266
267 ==== 2. **OnRequest Parameter** ====
268
269 * (((
270 **Description**: The OnRequest parameter works in combination with the FreeSale parameter to filter the response based on availability status.
271
272 * **Behavior**:
273 ** When "OnRequest": true is passed, the system will return offers that are either "OnRequest" or "FreeSale", depending on the value of the FreeSale parameter.
274 )))
275
276 ==== 3. **Filter Configuration** ====
277
278 * **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.
279
280 ==== 4. **Example Usage** ====
281
282 * If "FreeSale": true is passed, the system returns only FreeSale offers.
283 * If "FreeSale": false or the parameter is omitted, the system returns all offers, including both FreeSale and non-FreeSale offers.
284
285