Wiki source code of 7. Book

Version 5.1 by Giorgi Mdivnishvili on 2024/02/28 09:25

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