Book API
The Booking API represents the final step in our search-to-book flow. It requires passing essential details such as passenger information, contact information, and payment information to facilitate the booking process for the selected hotel at the quoted price.
Booking API details:
HTTP:POST
Endpoint:: {baseEndpoint}/api/hotel/{hotelId}/{token}/book
FAQs
Do I need to pass a credit card to complete the booking?
It depends on your payment terms and account configurations with the supplier. If the supplier needs a credit card, you need to pass it in the Booking API. ZentrumHub API will forward that to the supplier. ZentrumHub Api does not store or charge the credit card.
Do I need to pass the details of all the guests during the booking?
This depends on the allGuestInfoRequired field of the Price API response. If the value for this field is true, you need to pass the details of all the guests. Otherwise, the type and age (in case of a child) of the guests is enough.
What should I do in case of a timeout error or non-confirmed booking status?
Solution: To ensure seamless booking experiences, we recommend implementing a polling mechanism in your booking process. Here's how it works:
Error Handling on Timeout: Upon encountering a timeout error or receiving a non-confirmed booking status in the response, your system should initiate the following steps:
Polling Calls to getBookingDetails API: Make successive calls to the getBookingDetails API at intervals of 10 seconds.
Polling Time Limit: Continue polling for a maximum duration of 5 minutes (30 polling attempts).
Confirmation Check: Check the booking status received from each polling call. If the status is confirmed, proceed with the booking process as usual.
Handling Non-Confirmation: If the booking status remains unconfirmed after 5 minutes of polling, implement appropriate error handling mechanisms on your end. This may include informing users about the status and advising them on further steps.
Benefits of Implementation:
Minimizes the risk of failed bookings due to timeout errors.
Ensures that clients receive accurate booking statuses promptly.
Reduces the occurrence of duplicate bookings and associated complications.
Conclusion: Implementing a polling mechanism as part of your error handling strategy will significantly enhance the reliability and efficiency of your booking process, providing a seamless experience for both your clients and end-users.
Error Codes
Error Code | Error Message |
---|---|
4000 | Mandatory fields are missing in the request - {0} |
4001 | Invalid data in request - Please refer to the fields[] for more details. |
4004 | The hotel you selected is sold out |
4005 | Price for the selected room(s) has changed |
4006 | The rate you tried to book has expired. Please try again with a new search. |
4007 | Booking with same details already exists |
4008 | Booking due to insufficient funds in credit card |
4012 | Booking failed due to insufficient funds in account |
5000 | Your request failed due to an unknown system error. Please contact support team with the correlationId. |
5001 | Your request failed due to an unknown error returned by the supplier. Please contact support team with the correlationId. |
5002 | Timeout occurred while processing your booking request. Please contact support team with the correlationId. |
5003 | Booking failed due to credit card error |
5004 | Booking confirmation pending from supplier end |
Updated 6 months ago
Please visit the following link:
https://zentrumhub-hotel-api.readme.io/reference/post_api-hotel-hotelid-token-book