Pre-Book
13min
introduction this document provides the specification for the bonotel pre book api method, which would allow customers to verify that a specific hotel, room, rate plan and occupancy is still available and to verify the rate before they attempt the booking this method bypasses caching and returns the current rate and status if you have any questions, contact us at apisupport\@bonotel com traffic volume bonotel will be monitoring and tracking the pre book requests per customer per day to ensure that the pre book method is only used right before making a reservation request for example, if your account normally generates 20 reservation requests in a day, we expect 20 pre book requests any excessive use of the pre book method will be throttled requirements before making a pre book request, you would need to have already posted an availability request and extracted out the necessary details from the response to generate a pre book request format to help customers leverage existing code, we have modeled the pre book method after our reservation method format the primary difference is that we remove the guest names and comments from the request the response will include a status per room, the total rate per room and for the booking, and any exclusive hotel fees a room can have zero or more hotel fees regardless of the fee type request endpoint {{endpoint prebook}} parent/group element/ attribute name type req data/format description prebookrequest group yes root element prebookrequest control group yes authentication group control username element yes string your username control password element yes string your password prebookrequest requestdetails group yes pre book request details requestdetails timestamp attribute yes iso 8601 utc yyyymmddthh🇲🇲ss requestdetails checkin element yes mm ddd yyy check in date requestdetails checkout element yes mm ddd yyy check out date requestdetails noofrooms element yes integer number of rooms – 9 max requestdetails noofnights element yes integer number of nights – 30 max requestdetails hotelcode element yes integer hotelcode from avail response requestdetails total element yes decimal total including all rooms total currency attribute yes iso 4217 currency, usually usd requestdetails totaltax element yes decimal total including all rooms usually 0 00 totaltax currency attribute yes iso 4217 currency, usually usd requestdetails roomdata group yes room block, 9 max roomdata roomno element yes integer room number, first is 1 roomdata roomcode element yes integer id from avail response roomdata roomtypecode element yes integer id from avail response roomdata bedtypecode element yes integer id from avail response roomdata rateplancode element yes integer id from avail response roomdata noofadults element yes integer num of adults 1 or more roomdata noofchildren element yes integer num of children 0 or more roomdata childages group yes ages for children that are <= 18 childages childage element no integer one age per child, only required for children roomdata total element yes decimal total for current room total currency attribute yes iso 4217 currency, usually usd roomdata totaltax element yes decimal total tax for current room usually 0 00 totaltax currency attribute yes iso 4217 currency, usually usd response parent/group element/ attribute name type required data/ format description prebookresponse group yes root element prebookresponse status attribute yes y/n y=1 or more successful, n=none successful prebookresponse roomdetails group yes roomdetails room element yes y/n room was successful or not note, if a room returns with a rate change, it is successful, it just has a new rate room roomno attribute yes integer the number of the room, starting with 1 roomdetails total element no decimal total rate for the room compare against the availability rate to check for rate changes total currency attribute no iso 4217 currency, usually usd roomdetails totaltax element no decimal total tax for current room usually 0 00 totaltax currency attribute no iso 4217 currency, usually usd roomdetails hotelfees group no all hotelfee groups hotelfees hotelfee group no a specific hotelfee with elements hotelfee feetype element no string amenity, cleaning, national park entrance, resort, security deposit hotelfee feemethod element no string only "exclusive" currently hotelfee requiredfee element no yes/no hotelfee feetotal element no decimal inclusive of any taxes error response – no rooms returned parent/group element/ attribute name type required data/format description prebookresponse group yes root element prebookresponse status attribute yes y/n y=1 or more successful, n=none successful prebookresponse errors group no only one error will ever return errors code element no string see table of result codes errors description element no string description of result code response \<?xml version="1 0" encoding="utf 8" ?> \<prebookresponse status="n"> 	\<errors> 	 \<code>p3\</code> 	 \<description>inventory has expired\</description> 	\</errors> \</prebookresponse> code example request method /prebookcheck do \<?xml version="1 0" encoding="utf 8" ?> \<prebookrequest> 	\<control> 	 \<username>{{username}}\</username> 	 \<password>{{password}}\</password> 	\</control> 	\<requestdetails timestamp="20220120t11 07 33"> 	 \<checkin>01 jan 2023\</checkin> 	 \<checkout>02 jan 2023\</checkout> 	 \<noofrooms>1\</noofrooms> 	 \<noofnights>1\</noofnights> 	 \<hotelcode>79\</hotelcode> 	 \<total currency="usd">390 10\</total> 	 \<totaltax currency="usd">0\</totaltax> 	 \<roomdata> 	 \<roomno>1\</roomno> 	 \<roomcode>131110\</roomcode> 	 \<roomtypecode>131\</roomtypecode> 	 \<bedtypecode>10\</bedtypecode> 	 \<rateplancode>131\</rateplancode> 	 \<noofadults>1\</noofadults> 	 \<noofchildren>2\</noofchildren> 	 \<childages> 	 \<childage>4\</childage> 	 \<childage>6\</childage> 	 \</childages> 	 \<total currency="usd">390 10\</total> 	 \<totaltax currency="usd">0\</totaltax> 	 \</roomdata> 	\</requestdetails> \</prebookrequest> response typical response \<?xml version="1 0" encoding="utf 8" ?> \<prebookresponse status="y"> 	\<roomdetails> 	 \<room roomno="1">n\</room> 	\</roomdetails> 	\<roomdetails> 	 \<room roomno="2">y\</room> 	 \<total currency="usd">390 10\</total> 	 \<totaltax currency="usd">0\</totaltax> 	 \<hotelfees> 	 \<hotelfee> 	 \<feetype>resort\</feetype> 	 \<feemethod>exclusive\</feemethod> 	 \<requiredfee>yes\</requiredfee> 	 \<feetotal>148 65\</feetotal> 	 \</hotelfee> 	 \</hotelfees> 	\</roomdetails> \</prebookresponse> response with varying results it is possible to see a response where one or more rooms are available and one or more other rooms are not available please take note of this example if you support booking two or more rooms the top level status setting is ‘y’ here because at least one of the requested rooms was available \<?xml version="1 0" encoding="utf 8" ?> \<prebookresponse status=" y y "> 	\<roomdetails> 	 \<room roomno="1"> n n \</room> 	\</roomdetails> 	\<roomdetails> 	 \<room roomno="2"> y y \</room> 	 \<total currency="usd">390 10\</total> 	 \<totaltax currency="usd">0\</totaltax> 	 \<hotelfees> 	 \<hotelfee> 	 \<feetype>resort\</feetype> 	 \<feemethod>exclusive\</feemethod> 	 \<requiredfee>yes\</requiredfee> 	 \<feetotal>148 65\</feetotal> 	 \</hotelfee> 	 \</hotelfees> 	\</roomdetails> \</prebookresponse> error response \<?xml version="1 0" encoding="utf 8" ?> \<prebookresponse status="n"> 	\<errors> 	 \<code>p3\</code> 	 \<description>inventory has expired\</description> 	\</errors> \</prebookresponse> response codes code description p1 unspecified error please contact customer support p2 user id not supplied or not valid p3 inventory has expired p6 arrival or departure date format incorrect p7 erroneous or incomplete data in request p8 incorrect hotel id / room type id/ bed type id/ rate plan id combination p9 occupancy details do not match with the number of rooms p13 no xml input detected p14 this request cannot be confirmed due to restrictions p15 the number of nights does not match the check in date and the checkout date p16 access has been suspended p18 room no (#) cannot be occupied with the given number of adults and children p20 reservations require a minimum of one adult per room p21 exceeding request limit please contact support p24 error making this request please try again later p27 please check, rate must be more than zero p28 hotel does not have a valid contract for check in and check out date p29 room net rate is less than the threshold value