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: [email protected]

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:



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


Code Example

Request

Method: /PreBookCheck.do

XML


Response

Typical Response

XML


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"> <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>

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