7. Book

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

https://restapi.rustaronline.com/v1.01/api/book

Method: POST

Parameters to pass (IN URL): agented and agentpassword

Sample URL:

https://restapi.rustaronline.com/v1.01/api/book?agentid=test.test&agentpassword=TestP@ssw0rd

The method registers a booking request from the agent into Rustar’s database

Post value example:

{
 "reservationcode": "RES001",
 "customers": [{
     "customercode": "1",
     "title": "Mr",
     "gender": "M",
     "firstname": "John",
     "lastname": "Smith",
     "birthdate": "1990-01-01T00:00:00",
     "citizenship": "AE",
     "visarequired": true,
     "arrivaldate": "2018-03-20T13:00:00",
     "arrivalflightnumber": "FL001",
     "arrivalairport": "DXB",
     "departuredate": "2018-03-25T15:00:00",
     "departureflightnumber": "FL002",
     "departureairport": "DXB",
     "countryaccesscode": "971",
     "areacitycode": "4",
     "phonenumber": "000-00-00",
     "email": "",
     "passportnumber": "",
     "passporttype": "",
     "issuedate": null,
     "expirydate": null,
     "issuecity": null,
     "note": ""
    },{
     "customercode": "2",
     "title": "Mrs",
     "gender": "F",
     "firstname": "Jane",
     "lastname": "Smith",
     "birthdate": "1990-02-02T00:00:00",
     "citizenship": "AE",
     "visarequired": true,
     "arrivaldate": "2018-03-20T13:00:00",
     "arrivalflightnumber": "FL001",
     "arrivalairport": "DXB",
     "departuredate": "2018-03-25T15:00:00",
     "departureflightnumber": "FL002",
     "departureairport": "DXB",
     "countryaccesscode": "971",
     "areacitycode": "4",
     "phonenumber": "000-00-00",
     "email": "",
     "passportnumber": "",
     "passporttype": "",
     "issuedate": null,
     "expirydate": null,
     "issuecity": null,
     "note": ""
    }
  ],
 "hotels": [{
     "hotelname": "Rixos Premium Dubai",
     "checkindate": "2018-03-20T00:00:00",
     "checkoutdate": "2018-03-25T00:00:00",
     "placement": "DBL",
     "roomcategoryname": "1 B/R Deluxe Suite",
     "promotioncodes": "",
     "mealplan": "BB",
     "adults": 2,
     "children": 0,
     "infants": 0,
     "hotelnote": "VIP Guest",
     "customercodes": [
       "1","2"
      ]
    }
  ],
 "transfers": [{
     "transferdate": "2018-03-20T00:00:00",
     "transfertype": "GROUP",
     "fromairport": "DXB",
     "toairport": null,
     "tohotelname": "Rixos Premium Dubai",
     "customercodes": [
       "1","2"
      ]
    },{
     "transferdate": "2018-03-25T00:00:00",
     "transfertype": "GROUP",
     "fromairport": null,
     "fromhotelname": "Rixos Premium Dubai",
     "toairport": "DXB",
     "tohotelid": null,
     "customercodes": [
       "1","2"
      ]
    }
  ],
 "hotelextras": []
}
ValueDescription
reservationcodestring. Reservation/Booking ID from Agent’s system. Might be null
customersArray of all tourists of this booking
customercodestring. Unique ID of the customer from Agent. Mandatory
titlestring. Tile (“Mr”, “Mrs”…). Optional
genderstring. “M” or “F” only. Mandatory
firstnameFirst name of the customer. Mandatory
lastnameLast name of the customer. Mandatory
birthdateBirth date of the customer. Optional. If empty, then the customer will be registered as adult
citizenshipstring. ISO2 format of the country code. For example “KZ”, “UA”. . Mandatory
visarequiredBoolean. Is customer applying for a visa service from rustar. Mandatory
arrivaldatedatetime. Mandatory. Addival date AND time of the customer
arrivalflightnumberstring. Mandatory. Flight code of the customer for arrival
arrivalairportstring. IATA 3 character code of the airpot. Mandatory. Example  “DXB”,”SHJ”
departuredatedatetime. Mandatory. Departure date AND time of the customer
departureflightnumberstring. Mandatory. Flight code of the customer for arrival
departureairportstring. IATA 3 character code of the airpot. Mandatory. Example  “DXB”,”SHJ”
countryaccesscodestring. Phone code for the country. Optional. Example “971”
areacitycodestring. Phone code for city or mobile operator. Optional. Example “050”
phonenumberstring. Phone number of the customer. Optional
email string. Email address of the customer. Optional
passportnumber  string. Passport number of the customer. Optional
passporttypestring. “ID” or “PS”. Optional. Passport type.
issuedatedate. Optional. Issue date of the passport
expirydatedate. Optional. Expire date of the passport
issuecitystring. Optional. City where the passport was issued
notestring. Optional.
hotelsArray of the hotels to book for this reservation
hotelidguid. Optional. Hotelid returned by “hotels” method (page 2)
hotelnamestring. Optional. Hotel name. Will be taken from hotelid if empty
placementstring. Mandatory. Placement returned by hotelprices method. (see page 4)
roomcategoryguid. Optional. Room category ID returned by hotelprices method. (see page 4)
roomcategorynamestring. Optional. Room type name. Will be taken from roomcategory if empty
priceidguid. Optional. Priceid returned by hotelprices method. (see page 4)
promotioncodesstring. Optional. PromotionCodes separated by “;” to book
mealplanstring. Optional. Meal plan of the price. Will be taken from priceid if empty
checkindatedate. Mandatory. Check in date for this price. Must be within the range of the price
checkoutdatedate. Mandatory. Check out date for this price. Must be within the range of the price
adultsint. Mandatory. Number of adults in booking
childrenint. Number of children in booking
infantsint. Number of infants in booking
hotelnotestring. Note for the booking. Optional
customercodesarray of strings. Codes of the customers staying in this hotel reservation for these dates
transfersArray of the transfers for this booking
transferdatedate. Mandatory. Date of the transfer
transfertypestring. Mandatory. VehicleName taken from vehicletypes method. Page 15 (“GROUP”, “TOYOTA PREVIA”…)
fromairportstring. IATA code of the airport to pick up the tourists
fromhotelidguid. Hotelid returned by hotels method. Hotel to pick up the tourists.
fromhotelnamestring. HotelName returned by hotels method.
toairportstring. IATA code of the airport to drop the tourists
tohotelidguid. Hotelid returned by hotels method. Hotel to drop the tourists.
tohotelnamestring. HotelName returned by hotels method.
customercodesarray of strings. Codes of the customers for this transfer
hotelextrasArray of the extra services, like gala dinners for this booking
servicedatedate. Mandatory. Date of the service/gala dinner
extraserviceidguid. Mandatory. extraserviceid returned by hotelextras method. Page 9
customerpricesarray of customercodes and priceid-s from hotelextras
customercodestring. Mandatory. CustomerCode from Customer’s object.
priceidguid. Mandatory. Price id from Adult, Teen, Child, Infant from hotelextras

Return value example:

{
 "Code": "00",
 "Message": "",
 "Timestamp": "2018-01-06T03:35:50.0365078+04:00",
 "Version": "1.01",
 "ResponseID": "506decf4-7deb-46fd-b10f-35d8baf6ee3f",
 "Data": {
   "ReservationID": "b36f6534-c5ce-4bc7-b8b6-8ee39fc6f913",
   "ReservationNumber": "68440",
   "ReservationDate": "2018-01-06T03:35:46.257",
   "ReservationAmount": 6877.00,
   "ReservationStatus": 0,
   "ReservationStatusName": "Draft",
   "ReservationTourists": [{
     "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
     "FirstName": "John",
     "LastName": "Smith",
     "ChildFlag": 0,
     "BirthDate": "1990-01-01T00:00:00",
     "CountryCode": "AE",
     "CountryID": "fead4059-3958-42d9-ab98-4446de89c0f1",
     "CountryAccessCode": "971",
     "AreaCityCode": "4",
     "PhoneNumber": "000-00-00",
     "Gender": 1,
     "ArrivalDate": "2018-03-20T13:00:00",
     "ArrivalFlightNumber": "FL001",
     "ArrivalTerminalName": "DXB",
     "DepartureDate": "2018-03-25T15:00:00",
     "DepartureFlightNumber": "FL002",
     "DepartureTerminalName": "DXB",
     "Email": "",
     "PassportNumber": "",
     "PassportType": "",
     "IssueCity": null,
     "IssueDate": null,
     "ExpiryDate": null,
     "Note": ""
    }, {
     "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
     "FirstName": "Jane",
     "LastName": "Smith",
     "ChildFlag": 0,
     "BirthDate": "1990-02-02T00:00:00",
     "CountryCode": "AE",
     "CountryID": "fead4059-3958-42d9-ab98-4446de89c0f1",
     "CountryAccessCode": "971",
     "AreaCityCode": "4",
     "PhoneNumber": "000-00-00",
     "Gender": 2,
     "ArrivalDate": "2018-03-20T13:00:00",
     "ArrivalFlightNumber": "FL001",
     "ArrivalTerminalName": "DXB",
     "DepartureDate": "2018-03-25T15:00:00",
     "DepartureFlightNumber": "FL002",
     "DepartureTerminalName": "DXB",
     "Email": "",
     "PassportNumber": "",
     "PassportType": "",
     "IssueCity": null,
     "IssueDate": null,
     "ExpiryDate": null,
     "Note": ""
    }],
   "ReservationHotels": [{
     "ReservationHotelID": "19be0332-a305-4343-b2a2-ff2f012461d9",
     "AgentConfirmationNumber": "RES001",
     "CheckInDate": "2018-03-20T00:00:00",
     "CheckOutDate": "2018-03-25T00:00:00",
     "HotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
     "HotelName": "Rixos Premium Dubai",
     "RoomCategoryID": "64c30364-80db-4634-ad24-5b15eb1adf44",
     "RoomCategoryName": "1 B/R Deluxe Suite",
     "PriceID": "5ed4e543-9af3-42b3-b367-b4dfce0b2042",
     "MealPlanName": "BB",
     "Placement": 3,
     "PlacementTypeName": "DBL",
     "Note": "VIP Guest",
     "Tourists": ["942dd874-cd3b-4f3c-b3bc-c2a92b38c392", "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61"]
    }],
   "ReservationTransferServices": [{
     "ReservationTransferID": "47608d83-7205-4a60-9498-055516ad4328",
     "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
     "TransferDate": "2018-03-25T00:00:00",
     "ServiceName": "DEPARTURE",
     "FromTerminalName": null,
     "ToTerminalName": "DXB",
     "FromHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
     "FromHotelName": "Rixos Premium Dubai",
     "ToHotelID": null,
     "ToHotelName": null,
     "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
     "VehicleTypeName": "GROUP"
    }, {
     "ReservationTransferID": "14730745-5ce8-4045-b032-b3c0fe956a96",
     "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
     "TransferDate": "2018-03-20T00:00:00",
     "ServiceName": "ARRIVAL",
     "FromTerminalName": "DXB",
     "ToTerminalName": null,
     "FromHotelID": null,
     "FromHotelName": null,
     "ToHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
     "ToHotelName": "Rixos Premium Dubai",
     "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
     "VehicleTypeName": "GROUP"
    }, {
     "ReservationTransferID": "128930a5-996e-4581-8be0-0126a4d460ec",
     "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
     "TransferDate": "2018-03-20T00:00:00",
     "ServiceName": "ARRIVAL",
     "FromTerminalName": "DXB",
     "ToTerminalName": null,
     "FromHotelID": null,
     "FromHotelName": null,
     "ToHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
     "ToHotelName": "Rixos Premium Dubai",
     "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
     "VehicleTypeName": "GROUP"
    }, {
     "ReservationTransferID": "1d0630a4-547e-452d-b0c9-448b5423fe94",
     "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
     "TransferDate": "2018-03-25T00:00:00",
     "ServiceName": "DEPARTURE",
     "FromTerminalName": null,
     "ToTerminalName": "DXB",
     "FromHotelID": "ed1b48cc-c0d1-47f4-8b17-03e509f705bc",
     "FromHotelName": "Rixos Premium Dubai",
     "ToHotelID": null,
     "ToHotelName": null,
     "VehicleTypeId": "a9252005-0a92-4ed1-9603-0f2f14295c29",
     "VehicleTypeName": "GROUP"
    }],
   "ReservationServices": [{
     "ReservationServiceID": "d026ba62-c193-4c5b-956d-458dc5e6a00a",
     "TouristID": "18c4ac33-05e6-49b5-b9cd-3f3cc1a30b61",
     "ServiceDate": "2018-03-20T13:00:00",
     "ServiceName": "Visa / Visa Charges"
    }, {
     "ReservationServiceID": "180538a7-34f5-4899-a47c-f732cf1e29fd",
     "TouristID": "942dd874-cd3b-4f3c-b3bc-c2a92b38c392",
     "ServiceDate": "2018-03-20T13:00:00",
     "ServiceName": "Visa / Visa Charges"
    }]
  }
}

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:

ValueDescription
ReservationID guid. Unique ID assigned to the booking by Rustar
ReservationNumber string. Unique booking number assigned by Rustar. Can be used for searching on web portal
ReservationDate date and time of the reservation.
ReservationAmount decimal. Total amount of the booking in USD
ReservationStatus int. Status id of the reservation.
ReservationStatusName string. Description of the status of the reservation