Wiki source code of 1. SearchHotelPrices
Version 14.1 by Giorgi Mdivnishvili on 2024/04/11 17:55
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | {{box cssClass="floatinginfobox" title="**Contents**"}} |
![]() |
2.1 | 2 | |
3 | |||
![]() |
1.1 | 4 | {{toc/}} |
5 | {{/box}} | ||
6 | |||
![]() |
2.1 | 7 | = Method Description = |
![]() |
1.1 | 8 | |
9 | |||
![]() |
14.1 | 10 | 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. |
![]() |
1.1 | 11 | |
![]() |
14.1 | 12 | **Parameters:** |
13 | |||
14 | * stayDays (integer): Indicates the starting point of the stay duration in days. A default value of 0 signifies immediate date pricing retrieval. | ||
15 | * 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. | ||
16 | |||
17 | **Constraints:** | ||
18 | |||
19 | * 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. | ||
20 | |||
21 | **Implementation:** | ||
22 | |||
23 | 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. | ||
24 | 1. **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. | ||
25 | 1. **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. | ||
26 | |||
27 | **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.) | ||
28 | |||
29 | **Notes:** | ||
30 | |||
31 | * 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. | ||
32 | |||
33 | 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. | ||
34 | |||
35 | |||
![]() |
4.1 | 36 | == Endpoint URL - [POST] == |
![]() |
1.1 | 37 | |
![]() |
2.1 | 38 | {{info}} |
![]() |
10.1 | 39 | [[https:~~/~~/integration.kazunion.com/api/OnlyHotelPackages/SearchHotelPrices>>https://integration.kazunion.com/api/OnlyHotelPackages/SearchHotelPrices]] |
![]() |
2.1 | 40 | {{/info}} |
![]() |
1.1 | 41 | |
42 | |||
![]() |
2.1 | 43 | == Request Parameters == |
![]() |
1.1 | 44 | |
![]() |
2.1 | 45 | (% class="box infomessage" %) |
46 | ((( | ||
![]() |
3.1 | 47 | None |
48 | ))) | ||
![]() |
1.1 | 49 | |
![]() |
3.1 | 50 | == Request Body == |
![]() |
1.1 | 51 | |
![]() |
3.1 | 52 | {{code language="Json"}} |
53 | { | ||
54 | "countryCode": "string", | ||
55 | "locations": [ | ||
56 | { | ||
57 | "type": "string", | ||
58 | "parent": "string", | ||
59 | "label": "string", | ||
60 | "subLabel": "string", | ||
61 | "value": "string", | ||
62 | "tag": "string" | ||
63 | } | ||
64 | ], | ||
![]() |
13.1 | 65 | "checkInDate": "2023-12-14", |
66 | "checkInDateTo": "2023-12-14", | ||
67 | "checkOutDate": "2023-12-14", | ||
![]() |
3.1 | 68 | "stayDays": 0, |
69 | "stayDaysTo": 0, | ||
70 | "adults": 0, | ||
71 | "children": 0, | ||
72 | "childrenAges": [ | ||
73 | 0 | ||
74 | ], | ||
75 | "extendedSearch": true, | ||
76 | "totalPriceFrom": 0, | ||
77 | "totalPriceTo": 0, | ||
78 | "recommended": true, | ||
79 | "popular": true, | ||
80 | "freeSale": true, | ||
81 | "groupByHotel": true, | ||
82 | "hotelCodes": [ | ||
83 | "string" | ||
84 | ], | ||
85 | "mealPlans": [ | ||
86 | "string" | ||
87 | ], | ||
88 | "hotelClasses": [ | ||
89 | "string" | ||
90 | ], | ||
91 | "hotelTypes": [ | ||
92 | "CityHotel" | ||
93 | ], | ||
94 | "hotelServices": [ | ||
95 | "HasAlcohol" | ||
96 | ], | ||
97 | "pagingId": "string", | ||
98 | "pageNumber": 0, | ||
99 | "pageRowCount": 0 | ||
100 | } | ||
101 | {{/code}} | ||
![]() |
1.1 | 102 | |
![]() |
3.1 | 103 | == Request Body example == |
![]() |
1.1 | 104 | |
105 | |||
![]() |
2.1 | 106 | {{code language="Json"}} |
![]() |
3.1 | 107 | { |
108 | "countryCode": "AE", | ||
![]() |
13.1 | 109 | "checkInDate": "2024-02-15", |
110 | "checkInDateTo": "2024-02-20", | ||
![]() |
3.1 | 111 | |
112 | "stayDays": 4, | ||
113 | "stayDaysTo": 6, | ||
114 | "adults": 1, | ||
115 | "children": 1, | ||
116 | "childrenAges": [ | ||
117 | 1 | ||
118 | ], | ||
119 | "extendedSearch": false, | ||
120 | "totalPriceFrom": 10, | ||
121 | "totalPriceTo": 10000, | ||
122 | "recommended": false, | ||
123 | "popular": true, | ||
124 | "freeSale": true, | ||
125 | "groupByHotel": true, | ||
126 | "hotelCodes": [ | ||
127 | |||
128 | ], | ||
129 | "mealPlans": [ | ||
130 | |||
131 | ], | ||
132 | "hotelClasses": [ | ||
133 | |||
134 | ], | ||
135 | "hotelTypes": [ | ||
136 | |||
137 | ], | ||
138 | "hotelServices": [ | ||
139 | |||
140 | ], | ||
141 | "pagingId": "", | ||
142 | "pageNumber": 3, | ||
143 | "pageRowCount": 10 | ||
144 | } | ||
![]() |
2.1 | 145 | {{/code}} |
![]() |
1.1 | 146 | |
![]() |
2.1 | 147 | == Response Body == |
148 | |||
149 | {{code language="json"}} | ||
150 | [ | ||
151 | { | ||
152 | "hotelCode": "string", | ||
153 | "hotelName": "string", | ||
154 | "hotelClass": "string", | ||
155 | "cityUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6", | ||
156 | "countryCode": "string", | ||
157 | "countryName": "string", | ||
158 | "districtUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6", | ||
159 | "cityName": "string", | ||
160 | "districtName": "string", | ||
161 | "hotelType": "CityHotel", | ||
162 | "latitude": "string", | ||
163 | "longitude": "string", | ||
164 | "hasAlcohol": true, | ||
165 | "hasFreeWifi": true, | ||
166 | "hasMetro": true, | ||
167 | "hasPool": true, | ||
168 | "hasMall": true | ||
169 | } | ||
170 | ] | ||
171 | {{/code}} | ||
172 | |||
173 | |||
![]() |
3.1 | 174 | === Response Body example === |
![]() |
2.1 | 175 | |
176 | {{code language="Json"}} | ||
177 | { | ||
![]() |
3.1 | 178 | "packages": [ |
179 | { | ||
180 | "id": "onlyhotel:c4e23e7e-3d54-4efa-a3db-88508230ce91:504f63ca-6dd5-4d84-8245-cf7e77ccff73", | ||
181 | "priceCurrency": "USD", | ||
182 | "totalPrice": 381.7, | ||
183 | "agentCommissionPercent": 0.0, | ||
184 | "agentCommissionAmount": 0.0, | ||
185 | "hotel": { | ||
186 | "hotelPriceId": "504f63ca-6dd5-4d84-8245-cf7e77ccff73", | ||
187 | "providerId": 13, | ||
188 | "hotelName": "Golden Tulip Al Barsha Hotel", | ||
189 | "hotelCode": "ed0820c5-29b0-4e1b-8bcf-9f3c181e7961", | ||
190 | "nigths": 4, | ||
191 | "mealPlan": "RO", | ||
192 | "hotelClass": "4", | ||
193 | "availabilityType": "FreeSale", | ||
194 | "availableRoomsCount": 0, | ||
195 | "fewRooms": true, | ||
196 | "roomCategoryCode": "e63ea5ac-4883-4059-bb0a-795a534bbbfb", | ||
197 | "roomCategoryName": "Superior Twin", | ||
198 | "placementTypeName": "SNGL + CHILD(6-11.99)sharing", | ||
199 | "checkInDate": "2024-02-17T08:00:00.000Z", | ||
200 | "checkOutDate": "2024-02-21T08:00:00.000Z", | ||
201 | "adults": 1, | ||
202 | "children": 1, | ||
203 | "districtUID": "4c65f6ed-902b-4fd8-9419-af7884c22c5e", | ||
204 | "districtName": "Al Barsha", | ||
205 | "cityUID": "f5185fa3-3f56-44ed-bf6b-80386a33caa2", | ||
206 | "cityName": "Dubai", | ||
207 | "countryCode": "AE", | ||
208 | "countryName": "United Arab Emirates", | ||
209 | "hasAlcohol": true, | ||
210 | "hasFreeWifi": true, | ||
211 | "hasMetro": false, | ||
212 | "hasPool": true, | ||
213 | "hasMall": false, | ||
214 | "cancellationPolicyDescription": "Cancellation Policy: 15 Day Before Arrival: 100.00 %, Early Departure: 100.00 %, NoShow: 100.00 %", | ||
215 | "cancellationPolicy": { | ||
216 | "noShowChargeValue": 100.0, | ||
217 | "noShowChargeValueType": "%", | ||
218 | "earlyDepartureChargeValue": 100.0, | ||
219 | "earlyDepartureChargeValueType": "%", | ||
220 | "conditions": [ | ||
221 | { | ||
222 | "timeunits": 15, | ||
223 | "timeunitType": "Day", | ||
224 | "timeOffsetTypeName": "Before Arrival", | ||
225 | "chargeValue": 100.0, | ||
226 | "chargeValueType": "%" | ||
227 | } | ||
228 | ] | ||
229 | } | ||
230 | }, | ||
231 | "extraServices": [] | ||
232 | }, | ||
![]() |
2.1 | 233 | {{/code}} |
234 | |||
235 | |||
236 | === Schema === | ||
237 | |||
![]() |
6.1 | 238 | {{success}} |
![]() |
3.1 | 239 | SearchOnlyHotelPackagesResponse{ |
![]() |
6.1 | 240 | |
241 | |packages|[ | ||
242 | nullable: trueOnlyHotelPackage{((( | ||
243 | |id|string | ||
244 | nullable: true | ||
245 | |priceCurrency|string | ||
246 | nullable: true | ||
247 | |totalPrice|number($double) | ||
248 | |agentCommissionPercent|number($double) | ||
249 | |agentCommissionAmount|number($double) | ||
250 | |hotel|PackageHotel{((( | ||
251 | |hotelPriceId|string | ||
252 | nullable: true | ||
253 | |providerId|integer($int32) | ||
254 | |hotelName|string | ||
255 | nullable: true | ||
256 | |hotelCode|string | ||
257 | nullable: true | ||
258 | |nigths|integer($int32) | ||
259 | |mealPlan|string | ||
260 | nullable: true | ||
261 | |hotelClass|string | ||
262 | nullable: true | ||
263 | |availabilityType|RoomAvailabilityTypeEnumstringEnum: | ||
264 | [ OnRequest, FreeSale, StopSale ] | ||
265 | |availableRoomsCount|integer($int32) | ||
266 | |fewRooms|boolean | ||
267 | |roomCategoryCode|string | ||
268 | nullable: true | ||
269 | |roomCategoryName|string | ||
270 | nullable: true | ||
271 | |placementTypeName|string | ||
272 | nullable: true | ||
273 | |placementDescription|string | ||
274 | nullable: true | ||
275 | |checkInDate|string($date-time) | ||
276 | |checkOutDate|string($date-time) | ||
277 | |adults|integer($int32) | ||
278 | |children|integer($int32) | ||
279 | |districtUID|string($uuid) | ||
280 | nullable: true | ||
281 | |districtName|string | ||
282 | nullable: true | ||
283 | |cityUID|string($uuid) | ||
284 | nullable: true | ||
285 | |cityName|string | ||
286 | nullable: true | ||
287 | |countryCode|string | ||
288 | nullable: true | ||
289 | |countryName|string | ||
290 | nullable: true | ||
291 | |hasAlcohol|boolean | ||
292 | |hasFreeWifi|boolean | ||
293 | |hasMetro|boolean | ||
294 | |hasPool|boolean | ||
295 | |hasMall|boolean | ||
296 | |cancellationPolicyDescription|string | ||
297 | nullable: true | ||
298 | |cancellationPolicy|CancellationPolicyExchange{((( | ||
299 | |cancellationPolicyCode|string | ||
300 | nullable: true | ||
301 | |noShowChargeValue|number($double) | ||
302 | nullable: true | ||
303 | |noShowChargeValueType|string | ||
304 | nullable: true | ||
305 | |earlyDepartureChargeValue|number($double) | ||
306 | nullable: true | ||
307 | |earlyDepartureChargeValueType|string | ||
308 | nullable: true | ||
309 | |conditions|[ | ||
310 | nullable: trueCancellationPolicyConditionExchange{((( | ||
311 | |timeunits|integer($int32) | ||
312 | |timeunitType|string | ||
313 | nullable: true | ||
314 | |timeOffsetTypeName|string | ||
315 | nullable: true | ||
316 | |chargeValue|number($double) | ||
317 | nullable: true | ||
318 | |chargeValueType|string | ||
319 | nullable: true | ||
320 | |||
![]() |
2.1 | 321 | }] |
![]() |
6.1 | 322 | ))) |
323 | |||
![]() |
3.1 | 324 | } |
![]() |
6.1 | 325 | ))) |
326 | |||
![]() |
3.1 | 327 | } |
![]() |
6.1 | 328 | ))) |
329 | |extraServices|[ | ||
330 | nullable: trueHotelExtraServiceBase{((( | ||
331 | |extraServiceCode|string | ||
332 | nullable: true | ||
333 | |extraServiceTypeCode|string | ||
334 | nullable: true | ||
335 | |isMandatory|integer($int32) | ||
336 | |extraServiceName|string | ||
337 | nullable: true | ||
338 | |minimalServiceAmount|number($double) | ||
339 | |includedPriceCode|string | ||
340 | nullable: true | ||
341 | |prices|[ | ||
342 | nullable: trueHotelExtraServicePriceBase{((( | ||
343 | |extraServicePriceCode|string | ||
344 | nullable: true | ||
345 | |displayName|string | ||
346 | nullable: true | ||
347 | |restrictionInfo|string | ||
348 | nullable: true | ||
349 | |additionalInfo|string | ||
350 | nullable: true | ||
351 | |price|number($double) | ||
352 | |extraPrice|number($double) | ||
353 | |currency|string | ||
354 | nullable: true | ||
355 | |||
![]() |
3.1 | 356 | }] |
![]() |
6.1 | 357 | ))) |
358 | |||
![]() |
3.1 | 359 | }] |
![]() |
6.1 | 360 | ))) |
361 | |||
![]() |
3.1 | 362 | }] |
![]() |
6.1 | 363 | ))) |
364 | |pagingId|string | ||
365 | nullable: true | ||
366 | |pageNumber|integer($int64) | ||
367 | |pageCount|integer($int64) | ||
368 | |||
![]() |
3.1 | 369 | } |
![]() |
6.1 | 370 | {{/success}} |
371 | |||
![]() |
8.1 | 372 | |
![]() |
9.1 | 373 | == Definitions == |
![]() |
8.1 | 374 | |
![]() |
9.1 | 375 | |
376 | === Paging and Caching === | ||
377 | |||
378 | 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: | ||
379 | |||
380 | |||
381 | ==== first request ==== | ||
382 | |||
383 | {{code language="Json"}} | ||
384 | { | ||
385 | "pagingId": "", | ||
386 | "pageNumber": 1, | ||
387 | "pageRowCount":10 | ||
388 | } | ||
389 | {{/code}} | ||
390 | |||
391 | |||
392 | ==== Request with caching ==== | ||
393 | |||
394 | 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 | ||
395 | |||
396 | {{code language="Json"}} | ||
397 | { | ||
398 | "pagingId": "80", | ||
399 | "pageNumber": 1, | ||
400 | "pageRowCount":10 | ||
401 | } | ||
402 | {{/code}} | ||
403 | |||
404 | |||
405 | |||
406 | == Important == | ||
407 | |||
![]() |
8.1 | 408 | {{error}} |
409 | It's Important to in every other request header, put Auth token | ||
410 | |||
411 | **Key **- Authorization | ||
412 | |||
413 | **Value **- Bearer Token what is given in this response. | ||
414 | |||
415 | |||
416 | **also note in headers that:** | ||
417 | |||
418 | Content-Type - application/json | ||
419 | |||
420 | **Key - **X-nugios-timezone | ||
421 | |||
422 | **Value **- 240 | ||
423 | {{/error}} |