Wiki source code of 7. Book

Last modified by Giorgi Mdivnishvili on 2024/02/28 09:26

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 **Return value example:**
179
180
181 {{code language="json"}}
182 {
183 "Code": "00",
184 "Message": "",
185 "Timestamp": "2018-01-06T03:35:50.0365078+04:00",
186 "Version": "1.01",
187 "ResponseID": "506decf4-7deb-46fd-b10f-35d8baf6ee3f",
188 "Data": {
189 "ReservationID": "b36f6534-c5ce-4bc7-b8b6-8ee39fc6f913",
190 "ReservationNumber": "68440",
191 "ReservationDate": "2018-01-06T03:35:46.257",
192 "ReservationAmount": 6877.00,
193 "ReservationStatus": 0,
194 "ReservationStatusName": "Draft",
195 "ReservationTourists": [{
196 "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
197 "FirstName": "John",
198 "LastName": "Smith",
199 "ChildFlag": 0,
200 "BirthDate": "1990-01-01T00:00:00",
201 "CountryCode": "AE",
202 "CountryID": "fead4059-3958-42d9-ab98-4446de89c0f1",
203 "CountryAccessCode": "971",
204 "AreaCityCode": "4",
205 "PhoneNumber": "000-00-00",
206 "Gender": 1,
207 "ArrivalDate": "2018-03-20T13:00:00",
208 "ArrivalFlightNumber": "FL001",
209 "ArrivalTerminalName": "DXB",
210 "DepartureDate": "2018-03-25T15:00:00",
211 "DepartureFlightNumber": "FL002",
212 "DepartureTerminalName": "DXB",
213 "Email": "",
214 "PassportNumber": "",
215 "PassportType": "",
216 "IssueCity": null,
217 "IssueDate": null,
218 "ExpiryDate": null,
219 "Note": ""
220 }, {
221 "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
222 "FirstName": "Jane",
223 "LastName": "Smith",
224 "ChildFlag": 0,
225 "BirthDate": "1990-02-02T00:00:00",
226 "CountryCode": "AE",
227 "CountryID": "fead4059-3958-42d9-ab98-4446de89c0f1",
228 "CountryAccessCode": "971",
229 "AreaCityCode": "4",
230 "PhoneNumber": "000-00-00",
231 "Gender": 2,
232 "ArrivalDate": "2018-03-20T13:00:00",
233 "ArrivalFlightNumber": "FL001",
234 "ArrivalTerminalName": "DXB",
235 "DepartureDate": "2018-03-25T15:00:00",
236 "DepartureFlightNumber": "FL002",
237 "DepartureTerminalName": "DXB",
238 "Email": "",
239 "PassportNumber": "",
240 "PassportType": "",
241 "IssueCity": null,
242 "IssueDate": null,
243 "ExpiryDate": null,
244 "Note": ""
245 }],
246 "ReservationHotels": [{
247 "ReservationHotelID": "19be0332-a305-4343-b2a2-ff2f012461d9",
248 "AgentConfirmationNumber": "RES001",
249 "CheckInDate": "2018-03-20T00:00:00",
250 "CheckOutDate": "2018-03-25T00:00:00",
251 "HotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
252 "HotelName": "Rixos Premium Dubai",
253 "RoomCategoryID": "64c30364-80db-4634-ad24-5b15eb1adf44",
254 "RoomCategoryName": "1 B/R Deluxe Suite",
255 "PriceID": "5ed4e543-9af3-42b3-b367-b4dfce0b2042",
256 "MealPlanName": "BB",
257 "Placement": 3,
258 "PlacementTypeName": "DBL",
259 "Note": "VIP Guest",
260 "Tourists": ["942dd874-cd3b-4f3c-b3bc-c2a92b38c392", "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61"]
261 }],
262 "ReservationTransferServices": [{
263 "ReservationTransferID": "47608d83-7205-4a60-9498-055516ad4328",
264 "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
265 "TransferDate": "2018-03-25T00:00:00",
266 "ServiceName": "DEPARTURE",
267 "FromTerminalName": null,
268 "ToTerminalName": "DXB",
269 "FromHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
270 "FromHotelName": "Rixos Premium Dubai",
271 "ToHotelID": null,
272 "ToHotelName": null,
273 "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
274 "VehicleTypeName": "GROUP"
275 }, {
276 "ReservationTransferID": "14730745-5ce8-4045-b032-b3c0fe956a96",
277 "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
278 "TransferDate": "2018-03-20T00:00:00",
279 "ServiceName": "ARRIVAL",
280 "FromTerminalName": "DXB",
281 "ToTerminalName": null,
282 "FromHotelID": null,
283 "FromHotelName": null,
284 "ToHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
285 "ToHotelName": "Rixos Premium Dubai",
286 "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
287 "VehicleTypeName": "GROUP"
288 }, {
289 "ReservationTransferID": "128930a5-996e-4581-8be0-0126a4d460ec",
290 "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
291 "TransferDate": "2018-03-20T00:00:00",
292 "ServiceName": "ARRIVAL",
293 "FromTerminalName": "DXB",
294 "ToTerminalName": null,
295 "FromHotelID": null,
296 "FromHotelName": null,
297 "ToHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
298 "ToHotelName": "Rixos Premium Dubai",
299 "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
300 "VehicleTypeName": "GROUP"
301 }, {
302 "ReservationTransferID": "1d0630a4-547e-452d-b0c9-448b5423fe94",
303 "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
304 "TransferDate": "2018-03-25T00:00:00",
305 "ServiceName": "DEPARTURE",
306 "FromTerminalName": null,
307 "ToTerminalName": "DXB",
308 "FromHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
309 "FromHotelName": "Rixos Premium Dubai",
310 "ToHotelID": null,
311 "ToHotelName": null,
312 "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
313 "VehicleTypeName": "GROUP"
314 }],
315 "ReservationServices": [{
316 "ReservationServiceID": "d026ba62-c193-4c5b-956d-458dc5e6a00a",
317 "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
318 "ServiceDate": "2018-03-20T13:00:00",
319 "ServiceName": "Visa / Visa Charges"
320 }, {
321 "ReservationServiceID": "180538a7-34f5-4899-a47c-f732cf1e29fd",
322 "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
323 "ServiceDate": "2018-03-20T13:00:00",
324 "ServiceName": "Visa / Visa Charges"
325 }]
326 }
327 }
328
329
330 {{/code}}
331
332
333
334 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:
335
336 (% class="table-bordered" %)
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