Wiki source code of 7. Book

Version 2.1 by Giorgi Mdivnishvili on 2024/02/26 15:42

Show last authors
1 **https:~/~/restapi.rustaronline.com/v1.01/api/book**
2
3 Method: POST
4
5 Parameters to pass (IN URL): agented and agentpassword
6
7 Sample URL:
8
9 [[**https:~~/~~/restapi.rustaronline.com/v1.01/api/book?agentid=test.test&agentpassword=TestP@ssw0rd**>>url:https://restapi.rustaronline.com/v1.01/api/book?agentid=test.test&agentpassword=TestP@ssw0rd]]
10
11 [[**https:~~/~~/restapigeo.rustaronline.com/v1.01/api/hotelprices?agentid=DidaTravel.Jackson&agentpassword=didatravel123!.&HotelId=A95535D0-1F0C-4CBA-A0A1-9A4E2ABF46B5**>>url:https://restapigeo.rustaronline.com/v1.01/api/hotelprices?agentid=DidaTravel.Jackson&agentpassword=didatravel123!.&HotelId=A95535D0-1F0C-4CBA-A0A1-9A4E2ABF46B5]]
12
13
14 [[**https:~~/~~/restapi.rustaronline.com/v1.01/api/book?** **agentid=DidaTravel.Jackson&agentpassword=didatravel123!.**>>url:https://restapi.rustaronline.com/v1.01/api/book?agentid=test.test&agentpassword=TestP@ssw0rd]]
15
16
17 The method registers a booking request from the agent into Rustar’s database
18
19 Post value example:
20
21
22 {{code language="json"}}
23 {
24 "reservationcode": "RES001",
25 "customers": [{
26 "customercode": "1",
27 "title": "Mr",
28 "gender": "M",
29 "firstname": "John",
30 "lastname": "Smith",
31 "birthdate": "1990-01-01T00:00:00",
32 "citizenship": "AE",
33 "visarequired": true,
34 "arrivaldate": "2018-03-20T13:00:00",
35 "arrivalflightnumber": "FL001",
36 "arrivalairport": "DXB",
37 "departuredate": "2018-03-25T15:00:00",
38 "departureflightnumber": "FL002",
39 "departureairport": "DXB",
40 "countryaccesscode": "971",
41 "areacitycode": "4",
42 "phonenumber": "000-00-00",
43 "email": "",
44 "passportnumber": "",
45 "passporttype": "",
46 "issuedate": null,
47 "expirydate": null,
48 "issuecity": null,
49 "note": ""
50 },{
51 "customercode": "2",
52 "title": "Mrs",
53 "gender": "F",
54 "firstname": "Jane",
55 "lastname": "Smith",
56 "birthdate": "1990-02-02T00:00:00",
57 "citizenship": "AE",
58 "visarequired": true,
59 "arrivaldate": "2018-03-20T13:00:00",
60 "arrivalflightnumber": "FL001",
61 "arrivalairport": "DXB",
62 "departuredate": "2018-03-25T15:00:00",
63 "departureflightnumber": "FL002",
64 "departureairport": "DXB",
65 "countryaccesscode": "971",
66 "areacitycode": "4",
67 "phonenumber": "000-00-00",
68 "email": "",
69 "passportnumber": "",
70 "passporttype": "",
71 "issuedate": null,
72 "expirydate": null,
73 "issuecity": null,
74 "note": ""
75 }
76 ],
77 "hotels": [{
78 "hotelname": "Rixos Premium Dubai",
79 "checkindate": "2018-03-20T00:00:00",
80 "checkoutdate": "2018-03-25T00:00:00",
81 "placement": "DBL",
82 "roomcategoryname": "1 B/R Deluxe Suite",
83 "promotioncodes": "",
84 "mealplan": "BB",
85 "adults": 2,
86 "children": 0,
87 "infants": 0,
88 "hotelnote": "VIP Guest",
89 "customercodes": [
90 "1","2"
91 ]
92 }
93 ],
94 "transfers": [{
95 "transferdate": "2018-03-20T00:00:00",
96 "transfertype": "GROUP",
97 "fromairport": "DXB",
98 "toairport": null,
99 "tohotelname": "Rixos Premium Dubai",
100 "customercodes": [
101 "1","2"
102 ]
103 },{
104 "transferdate": "2018-03-25T00:00:00",
105 "transfertype": "GROUP",
106 "fromairport": null,
107 "fromhotelname": "Rixos Premium Dubai",
108 "toairport": "DXB",
109 "tohotelid": null,
110 "customercodes": [
111 "1","2"
112 ]
113 }
114 ],
115 "hotelextras": []
116 }
117
118 {{/code}}
119
120
121
122 **reservationcode:**  string. Reservation/Booking ID from Agent’s system. Might be null
123
124 **customers:**  Array of all tourists of this booking
125
126 **~ customercode:**  string. Unique ID of the customer from Agent. Mandatory
127
128 **title:**  string. Tile (“Mr”, “Mrs”…). Optional
129
130 **gender:**  string. “M” or “F” only. Mandatory
131
132 **firstname:**  First name of the customer. Mandatory
133
134 **lastname:**  Last name of the customer. Mandatory
135
136 **birthdate:**  Birth date of the customer. Optional. If empty, then the customer will be registered as adult
137
138 **citizenship:**  string. ISO2 format of the country code. For example “KZ”, “UA”. . Mandatory
139
140 **visarequired:**  Boolean. Is customer applying for a visa service from rustar. Mandatory
141
142 **arrivaldate:**  datetime. Mandatory. Addival date AND time of the customer
143
144 **arrivalflightnumber:**  string. Mandatory. Flight code of the customer for arrival
145
146 **arrivalairport:**  string. IATA 3 character code of the airpot. Mandatory. Example: “DXB”,”SHJ”
147
148 **departuredate:**  datetime. Mandatory. Departure date AND time of the customer
149
150 **departureflightnumber:**  string. Mandatory. Flight code of the customer for arrival
151
152 **departureairport:**  string. IATA 3 character code of the airpot. Mandatory. Example: “DXB”,”SHJ”
153
154 **countryaccesscode:**  string. Phone code for the country. Optional. Example: “971”
155
156 **areacitycode:**  string. Phone code for city or mobile operator. Optional. Example: “050”
157
158 **phonenumber:**  string. Phone number of the customer. Optional
159
160 **email:**  string. Email address of the customer. Optional
161
162 **passportnumber:**  string. Passport number of the customer. Optional
163
164 **passporttype:**  string. “ID” or “PS”. Optional. Passport type.
165
166 **issuedate:**  date. Optional. Issue date of the passport
167
168 **expirydate:**  date. Optional. Expire date of the passport
169
170 **issuecity:**  string. Optional. City where the passport was issued
171
172 **note:**  string. Optional.
173
174 **hotels:**  Array of the hotels to book for this reservation
175
176 **hotelid:  **guid. Optional. Hotelid returned by “hotels” method (page 2)
177
178 **hotelname:**  string. Optional. Hotel name. Will be taken from hotelid if empty
179
180 **placement:**  string. Mandatory. Placement returned by hotelprices method. (see page 4)
181
182 **roomcategory:**  guid. Optional. Room category ID returned by hotelprices method. (see page 4)
183
184 **roomcategoryname:**  string. Optional. Room type name. Will be taken from roomcategory if empty
185
186 **priceid:**  guid. Optional. Priceid returned by hotelprices method. (see page 4)
187
188 **~ promotioncodes: **string. Optional. PromotionCodes separated by “;” to book
189
190 **mealplan:**  string. Optional. Meal plan of the price. Will be taken from priceid if empty
191
192 **checkindate:**  date. Mandatory. Check in date for this price. Must be within the range of the price
193
194 **checkoutdate:**  date. Mandatory. Check out date for this price. Must be within the range of the price
195
196 **adults:**  int. Mandatory. Number of adults in booking
197
198 **children:**  int. Number of children in booking
199
200 **infants:**  int. Number of infants in booking
201
202 **hotelnote:**  string. Note for the booking. Optional
203
204 **customercodes:**  array of strings. Codes of the customers staying in this hotel reservation for these dates
205
206 **transfers:**  Array of the transfers for this booking
207
208 **transferdate:  **date. Mandatory. Date of the transfer
209
210 **transfertype:**  string. Mandatory. VehicleName taken from vehicletypes method. Page 15 (“GROUP”, “TOYOTA PREVIA”…)
211
212 **fromairport:**  string. IATA code of the airport to pick up the tourists
213
214 **fromhotelid:**  guid. Hotelid returned by hotels method. Hotel to pick up the tourists.
215
216 **fromhotelname:**  string. HotelName returned by hotels method.
217
218 **toairport:**  string. IATA code of the airport to drop the tourists
219
220 **tohotelid:**  guid. Hotelid returned by hotels method. Hotel to drop the tourists.
221
222 **tohotelname:**  string. HotelName returned by hotels method.
223
224 **customercodes:**  array of strings. Codes of the customers for this transfer
225
226 **hotelextras:**  Array of the extra services, like gala dinners for this booking
227
228 **servicedate:  **date. Mandatory. Date of the service/gala dinner
229
230 **extraserviceid:**  guid. Mandatory. extraserviceid returned by hotelextras method. Page 9
231
232 **customerprices:**  array of customercodes and priceid-s from hotelextras
233
234 **customercode:**  string. Mandatory. CustomerCode from Customer’s object.
235
236 **priceid:**  guid. Mandatory. Price id from Adult, Teen, Child, Infant from hotelextras
237
238
239
240 **Return value example:**
241
242
243 {{code language="json"}}
244 {
245 "Code": "00",
246 "Message": "",
247 "Timestamp": "2018-01-06T03:35:50.0365078+04:00",
248 "Version": "1.01",
249 "ResponseID": "506decf4-7deb-46fd-b10f-35d8baf6ee3f",
250 "Data": {
251 "ReservationID": "b36f6534-c5ce-4bc7-b8b6-8ee39fc6f913",
252 "ReservationNumber": "68440",
253 "ReservationDate": "2018-01-06T03:35:46.257",
254 "ReservationAmount": 6877.00,
255 "ReservationStatus": 0,
256 "ReservationStatusName": "Draft",
257 "ReservationTourists": [{
258 "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
259 "FirstName": "John",
260 "LastName": "Smith",
261 "ChildFlag": 0,
262 "BirthDate": "1990-01-01T00:00:00",
263 "CountryCode": "AE",
264 "CountryID": "fead4059-3958-42d9-ab98-4446de89c0f1",
265 "CountryAccessCode": "971",
266 "AreaCityCode": "4",
267 "PhoneNumber": "000-00-00",
268 "Gender": 1,
269 "ArrivalDate": "2018-03-20T13:00:00",
270 "ArrivalFlightNumber": "FL001",
271 "ArrivalTerminalName": "DXB",
272 "DepartureDate": "2018-03-25T15:00:00",
273 "DepartureFlightNumber": "FL002",
274 "DepartureTerminalName": "DXB",
275 "Email": "",
276 "PassportNumber": "",
277 "PassportType": "",
278 "IssueCity": null,
279 "IssueDate": null,
280 "ExpiryDate": null,
281 "Note": ""
282 }, {
283 "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
284 "FirstName": "Jane",
285 "LastName": "Smith",
286 "ChildFlag": 0,
287 "BirthDate": "1990-02-02T00:00:00",
288 "CountryCode": "AE",
289 "CountryID": "fead4059-3958-42d9-ab98-4446de89c0f1",
290 "CountryAccessCode": "971",
291 "AreaCityCode": "4",
292 "PhoneNumber": "000-00-00",
293 "Gender": 2,
294 "ArrivalDate": "2018-03-20T13:00:00",
295 "ArrivalFlightNumber": "FL001",
296 "ArrivalTerminalName": "DXB",
297 "DepartureDate": "2018-03-25T15:00:00",
298 "DepartureFlightNumber": "FL002",
299 "DepartureTerminalName": "DXB",
300 "Email": "",
301 "PassportNumber": "",
302 "PassportType": "",
303 "IssueCity": null,
304 "IssueDate": null,
305 "ExpiryDate": null,
306 "Note": ""
307 }],
308 "ReservationHotels": [{
309 "ReservationHotelID": "19be0332-a305-4343-b2a2-ff2f012461d9",
310 "AgentConfirmationNumber": "RES001",
311 "CheckInDate": "2018-03-20T00:00:00",
312 "CheckOutDate": "2018-03-25T00:00:00",
313 "HotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
314 "HotelName": "Rixos Premium Dubai",
315 "RoomCategoryID": "64c30364-80db-4634-ad24-5b15eb1adf44",
316 "RoomCategoryName": "1 B/R Deluxe Suite",
317 "PriceID": "5ed4e543-9af3-42b3-b367-b4dfce0b2042",
318 "MealPlanName": "BB",
319 "Placement": 3,
320 "PlacementTypeName": "DBL",
321 "Note": "VIP Guest",
322 "Tourists": ["942dd874-cd3b-4f3c-b3bc-c2a92b38c392", "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61"]
323 }],
324 "ReservationTransferServices": [{
325 "ReservationTransferID": "47608d83-7205-4a60-9498-055516ad4328",
326 "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
327 "TransferDate": "2018-03-25T00:00:00",
328 "ServiceName": "DEPARTURE",
329 "FromTerminalName": null,
330 "ToTerminalName": "DXB",
331 "FromHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
332 "FromHotelName": "Rixos Premium Dubai",
333 "ToHotelID": null,
334 "ToHotelName": null,
335 "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
336 "VehicleTypeName": "GROUP"
337 }, {
338 "ReservationTransferID": "14730745-5ce8-4045-b032-b3c0fe956a96",
339 "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
340 "TransferDate": "2018-03-20T00:00:00",
341 "ServiceName": "ARRIVAL",
342 "FromTerminalName": "DXB",
343 "ToTerminalName": null,
344 "FromHotelID": null,
345 "FromHotelName": null,
346 "ToHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
347 "ToHotelName": "Rixos Premium Dubai",
348 "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
349 "VehicleTypeName": "GROUP"
350 }, {
351 "ReservationTransferID": "128930a5-996e-4581-8be0-0126a4d460ec",
352 "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
353 "TransferDate": "2018-03-20T00:00:00",
354 "ServiceName": "ARRIVAL",
355 "FromTerminalName": "DXB",
356 "ToTerminalName": null,
357 "FromHotelID": null,
358 "FromHotelName": null,
359 "ToHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
360 "ToHotelName": "Rixos Premium Dubai",
361 "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
362 "VehicleTypeName": "GROUP"
363 }, {
364 "ReservationTransferID": "1d0630a4-547e-452d-b0c9-448b5423fe94",
365 "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
366 "TransferDate": "2018-03-25T00:00:00",
367 "ServiceName": "DEPARTURE",
368 "FromTerminalName": null,
369 "ToTerminalName": "DXB",
370 "FromHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
371 "FromHotelName": "Rixos Premium Dubai",
372 "ToHotelID": null,
373 "ToHotelName": null,
374 "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
375 "VehicleTypeName": "GROUP"
376 }],
377 "ReservationServices": [{
378 "ReservationServiceID": "d026ba62-c193-4c5b-956d-458dc5e6a00a",
379 "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
380 "ServiceDate": "2018-03-20T13:00:00",
381 "ServiceName": "Visa / Visa Charges"
382 }, {
383 "ReservationServiceID": "180538a7-34f5-4899-a47c-f732cf1e29fd",
384 "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
385 "ServiceDate": "2018-03-20T13:00:00",
386 "ServiceName": "Visa / Visa Charges"
387 }]
388 }
389 }
390
391
392 {{/code}}
393
394
395
396 The values are self-descriptive and most of them just are the same as passed to this booking. The values to pay attention apart crosschecking the booking parameters are:
397
398
399 **ReservationID**: guid. Unique ID assigned to the booking by Rustar
400
401 **ReservationNumber**: string. Unique booking number assigned by Rustar. Can be used for searching on web portal
402
403 **ReservationDate**: date and time of the reservation.
404
405 **ReservationAmount**: decimal. Total amount of the booking in USD
406
407 **ReservationStatus**: int. Status id of the reservation.
408
409 **ReservationStatusName**: string. Description of the status of the reservation
410
411