Book API

The Book API is the final step in the booking flow. It submits the reservation to the supplier and returns a bookingId and confirmation voucher. Before calling Book, you must have called Pricing — and you should have called BookInit first if your flow takes the user through a payment page.

BookInit → Book — the recommended sequence

BookInit and Book accept the same request structure. The difference is timing and purpose.

1

User clicks Pay

Before redirecting to the payment page, call BookInit. For suppliers that support hold bookings, this reserves the rate for up to 10 minutes. For others, it creates a database entry with no supplier action. Implement it regardless — as more suppliers adopt hold booking, you will be ready with no code changes.

POST{baseEndpoint}/api/hotel/{hotelId}/{token}/bookinit
2

Payment succeeds

Call Book immediately after payment confirmation. ZentrumHub submits the booking to the supplier and returns a bookingId and voucher to send to the customer.

POST{baseEndpoint}/api/hotel/{hotelId}/{token}/book

What to pass in the request

Both BookInit and Book require the same fields:

Guest information — check the allGuestInfoRequired field from the Price API response. If true, you must pass full details for every guest. If false, type and age (for children) is sufficient.

Payment details — depends on your account configuration and supplier requirements. If a credit card is required, pass it in the request. ZentrumHub forwards it to the supplier and does not store or charge it.

👻 Handling ghost bookings — required implementation

A ghost booking occurs when the Book API times out or returns a failure, but the supplier has actually processed the reservation in the background. If you show the user a hard failure and let them retry, you risk a duplicate booking.

Ghost booking recovery — implement this

When Book returns a timeout (error 5002) or non-confirmed status, do not show a hard error. Instead, start polling Get Booking Details:

1

Call Get Booking Details every 3-5 seconds

2

Continue for up to 3 minutes (approximately 20–30 polling attempts)

3

If status returns confirmed — show the user the booking confirmation

4

If still unconfirmed after 5 minutes — show an error and advise the user to contact support with their correlationId

Error codes

CodeMessage
4000Mandatory fields missing in request
4001Invalid data in request — refer to fields[] for details
4004Hotel is sold out
4005Price has changed — re-run Pricing and show new price to user
4006Rate has expired — restart from search
4007Booking with same details already exists
4008Insufficient funds on credit card
5000Unknown system error — contact support with correlationId
5001Unknown supplier error — contact support with correlationId
5002Timeout — start ghost booking recovery flow immediately
5004Booking confirmation pending from supplier — start ghost booking recovery flow


What’s Next