Wiki source code of 2. Hotel Prices

Version 5.1 by Giorgi Mdivnishvili on 2024/02/26 18:01

Show last authors
1
2 **https:~/~/restapi.rustaronline.com/v1.01/api/hotelprices**
3
4 Method: GET
5
6 Parameters to pass: agentid, agentpassword, hotelid
7
8 Sample URL:
9
10 **https:~/~/restapi.rustaronline.com/v1.01/api/hotelprices?agentid=test.test&agentpassword=TestP@ssw0rd&hotelid=d6f9299f-5d94-4955-85e7-003e0383023c&removedublicates=false**
11
12
13 The method returns the object with three list of prices for specified hotel. ContractPrices, Promotions, PromotionsWithConditions
14
15 Note: Parameter removedublicates is optional, used for removing duplicate seasons from the list and split prices by seasons. False is default value of this parameter.
16
17 Return value example:
18
19
20 {{code language="json"}}
21 {
22 "Code": "00",
23 "Message": "",
24 "Timestamp": "2016-06-27T20:12:05.3985798+04:00",
25 "Version": “1.01”,
26 "ResponseID": "6554e641-5e96-45a8-b3ef-44e9e5581673",
27 "Data": {
28 "ContractPrices": [
29 {
30 "priceid":"aa55f001-42d5-4f8c-87fd-a5284d766c49",
31 "hotelid": "78468066-fca7-472c-aabd-2143df1dc718",
32 "roomcategory": "6f3c7364-46fa-4226-8582-ec3c3d54cd7e",
33 "roomcategorytype": "7f3c7364-46fa-4226-8582-ec3c3d54cd7e",
34 "roomcategoryname": "Deluxe Room",
35 "startdate": "2016-05-12T00:00:00",
36 "enddate": "2016-09-30T00:00:00",
37 "mealplan": "BB",
38 "adults": 1,
39 "teens": 0,
40 "children": 0,
41 "infants": 1,
42 "teenswithextrabeds": 0,
43 "childrenwithextrabeds": 1,
44 "childpolicy": {
45 "infantmaxage": 2.99,
46 "childmaxage": 13.99,
47 "teenmaxage": 15.99
48 },
49 "placement": "SGL+1CHDEB(3-13,99)+1CHD(0-2,99)",
50 "price": 382.00000000000000,
51 "currency": "USD",
52 "promotioncode": "",
53 "promotion": {
54 "staydays": null,
55 "paydays": null,
56 "discount": 0.0,
57 "cashback": 0.0
58 },
59 "conditions": {
60 "bookingstartdate": null,
61 "bookingenddate": null,
62 "bookbefore": null,
63 "minimumstay": 0,
64 "maximumstay": 0
65 },
66 "isactive":true
67
68 }
69 ],
70 "Promotions": [
71 {
72 "priceid":"49fb3c67-71ac-478c-9714-e2aa4249d303",
73 "hotelid": "78468066-fca7-472c-aabd-2143df1dc718",
74 "roomcategory": "6f3c7364-46fa-4226-8582-ec3c3d54cd7e",
75 "roomcategorytype": "7f3c7364-46fa-4226-8582-ec3c3d54cd7e",
76 "roomcategoryname": "Deluxe Room",
77 "startdate": "2016-06-15T00:00:00",
78 "enddate": "2016-07-05T00:00:00",
79 "mealplan": "BB",
80 "adults": 1,
81 "teens": 0,
82 "children": 0,
83 "infants": 0,
84 "teenswithextrabeds": 0,
85 "childrenwithextrabeds": 0,
86 "childpolicy": {
87 "infantmaxage": 2.99,
88 "childmaxage": 13.99,
89 "teenmaxage": 15.99
90 },
91 "placement": "SGL",
92 "price": 143.00000000000000,
93 "currency": "USD",
94 "promotioncode": "Rixos Summer Special 2016",
95 "promotion": {
96 "staydays": null,
97 "paydays": null,
98 "discount": 0.0,
99 "cashback": 0.0
100 },
101 "conditions": {
102 "bookingstartdate": null,
103 "bookingenddate": null,
104 "bookbefore": null,
105 "minimumstay": 0,
106 "maximumstay": 0
107 },
108 "isactive":true
109 }
110 ],
111 "PromotionsWithConditions": [
112 {
113 "priceid":"aa55f001-42d5-4f8c-87fd-a5284d766c49",
114 "hotelid": "78468066-fca7-472c-aabd-2143df1dc718",
115 "roomcategory": "6f3c7364-46fa-4226-8582-ec3c3d54cd7e",
116 "roomcategorytype": "7f3c7364-46fa-4226-8582-ec3c3d54cd7e",
117 "roomcategoryname": "Deluxe Room",
118 "startdate": "2016-07-06T00:00:00",
119 "enddate": "2016-07-08T00:00:00",
120 "mealplan": "BB",
121 "adults": 1,
122 "teens": 0,
123 "children": 0,
124 "infants": 0,
125 "teenswithextrabeds": 0,
126 "childrenwithextrabeds": 1,
127 "childpolicy": {
128 "infantmaxage": 2.99,
129 "childmaxage": 13.99,
130 "teenmaxage": 15.99
131 },
132 "placement": "SGL+1CHDEB(3-13,99)",
133 "price": 234.00000000000000,
134 "currency": "USD",
135 "promotioncode": "Rixos Summer Special 2016",
136 "promotion": {
137 "staydays": null,
138 "paydays": null,
139 "discount": 0.0,
140 "cashback": 0.0
141 },
142 "conditions": {
143 "bookingstartdate": null,
144 "bookingenddate": null,
145 "bookbefore": null,
146 "minimumstay": 3,
147 "maximumstay": 5
148 },
149 "isactive":true
150 },
151 {
152 "priceid":"aa55f001-42d5-4f8c-87fd-a5284d766c49",
153 "hotelid": "78468066-fca7-472c-aabd-2143df1dc718",
154 "roomcategory": "6f3c7364-46fa-4226-8582-ec3c3d54cd7e",
155 "roomcategorytype": "7f3c7364-46fa-4226-8582-ec3c3d54cd7e",
156 "roomcategoryname": "Deluxe Room",
157 "startdate": "2016-07-06T00:00:00",
158 "enddate": "2016-07-08T00:00:00",
159 "mealplan": "BB",
160 "adults": 1,
161 "teens": 0,
162 "children": 0,
163 "infants": 2,
164 "teenswithextrabeds": 0,
165 "childrenwithextrabeds": 0,
166 "childpolicy": {
167 "infantmaxage": 2.99,
168 "childmaxage": 13.99,
169 "teenmaxage": 15.99
170 },
171 "placement": "SGL+2CHD(0-2,99)(0-2,99)",
172 "price": 234.00000000000000,
173 "currency": "USD",
174 "promotioncode": "Rixos Summer Special 2016",
175 "promotion": {
176 "staydays": null,
177 "paydays": null,
178 "discount": 0.0,
179 "cashback": 0.0
180 },
181 "conditions": {
182 "bookingstartdate": null,
183 "bookingenddate": null,
184 "bookbefore": null,
185 "minimumstay": 3,
186 "maximumstay": 5
187 },
188 "isactive":true
189 },
190 {
191 "priceid":"aa55f001-42d5-4f8c-87fd-a5284d766c49",
192 "hotelid": "78468066-fca7-472c-aabd-2143df1dc718",
193 "roomcategory": "6f3c7364-46fa-4226-8582-ec3c3d54cd7e",
194 "roomcategoryname": "Deluxe Room",
195 "startdate": "2016-07-06T00:00:00",
196 "enddate": "2016-07-08T00:00:00",
197 "mealplan": "BB",
198 "adults": 1,
199 "teens": 0,
200 "children": 1,
201 "infants": 1,
202 "teenswithextrabeds": 0,
203 "childrenwithextrabeds": 0,
204 "childpolicy": {
205 "infantmaxage": 2.99,
206 "childmaxage": 13.99,
207 "teenmaxage": 15.99
208 },
209 "placement": "SGL+2CHD(3-13,99)(0-2,99)",
210 "price": 234.00000000000000,
211 "currency": "USD",
212 "promotioncode": "Rixos Summer Special 2016",
213 "promotion": {
214 "staydays": null,
215 "paydays": null,
216 "discount": 0.0,
217 "cashback": 0.0
218 },
219 "conditions": {
220 "bookingstartdate": null,
221 "bookingenddate": null,
222 "bookbefore": null,
223 "minimumstay": 3,
224 "maximumstay": 5
225 },
226 "isactive":true
227 }
228 ]
229 }
230 }
231
232 {{/code}}
233
234
235
236 **priceid:**                          GUID of the unique price id in the database of Rustar. This field together with placement creates unique combination of price for room/promotion/mealplan
237
238 **hotelid:**                          GUID of the hotel in the database of Rustar.
239
240 **roomcategory:               **GUID of the Room category
241
242 **roomcategorytype:         **GUID of the Room category type. Unique by description of the room
243
244 **roomcategoryname:       **string. The name of the room category
245
246 **startdate:                       **Date. Start date of the price period
247
248 **enddate:                        **Date. End date of the price period
249
250 **mealplan:                       **CHAR(2). “RO”,"BB",”HB”,”FB”,”AL”
251
252 **adults:                           **Integer. Number of Aduts with beds
253
254 **teens:                            **Integer. Number of children (Teenagers) **without** extra bed
255
256 **children:                        **Integer. Number of children between infant and teen ages **without** extra bed
257
258 **infants:                          **Integer. Number of infants
259
260 **teenswithextrabeds:      **Integer. Number of children (Teenagers) **with** extra bed
261
262 **childrenwithextrabeds: **Integer. Number of children between infant and teen ages **with** extra bed
263
264 **childpolicy: {**
265
266 **infantmaxage:                **Decimal. Max age of the infant by the policy of the hotel
267
268 **childmaxage:                 **Decimal. Max age of the child by the policy of the hotel
269
270 **teenmaxage:                  **Decimal. Max age of the teenager by the policy of the hotel
271
272 **}**
273
274 **placement:                     **string. Accomodation of all guests in following format e.g.
275
276 **"SGL+1CHDEB(3-13,99)+1CHD(0-2,99)"**
277
278 **price:                             **Decimal. Price for the accommodation/placement
279
280 **currency:                       **CHAR(3). Currency of the price above
281
282 **promotioncode:              **string. Optional. Promotion code if any of the specified price
283
284 **promotion: {                  **Promotion terms if any
285
286 **staydays:                       **Integer. Number of days to stay for stay/pay promotion (n nights free)
287
288 **paydays:                        **Integer. Number of days that will be charged in case of “staydays” stay
289
290 **discount:                       **Decimal. Discount % that was applied for this promotion
291
292 **cashback:                      **Decimal. Cashback in specified currency that was applied for this promotion
293
294 **}**
295
296
297 **conditions": {                **Optional conditions for using this price
298
299 **bookingstartdate:          **Date. When it is allowed to start the reservation for this promotion/accomodation
300
301 **bookingenddate:            **Date. Date, after when the sale of this promotion should be stopped.
302
303 **bookbefore:                   **Integer. Number of days before checkin to use this promotion (Early Bird)
304
305 **minimumstay:                **Integer. Minimal stay of nights to use this promotion
306
307 **maximumstay:               **Integer. Maximal stay of nights to use this promotion
308
309 **}**
310
311 **isactive:                         **Boolean. True if the price is active and can be used. False if the price is deactivated/inactive.
312
313
314 Please be noted, that the prices are already calculated with all possible discounts.