New Booking Engine


Currently under development

The New Booking Engine (NBE) is the newest generation booking engine for BookyFlow. The goal is to provide a headless solution for creating bookings using a simple, clear and modular set of endpoints.

To use these endpoints you will need to install the API Feature Booking plugin, and the NBE Common plugin.

Authentication

No authentication is required to access the Booking REST API endpoints.

Every query should include a session id in the header of the query :

X-BOOKYFLOW-BOOKING-SESSION-ID

This session id can be anything you choose, but it must be unique to each guest/booking. Booking sessions are reset after a booking is committed, otherwise they are deleted after 24 hours.

The booking process

The BookyFlow NBE endpoints provide a variety of features that allow you to create a booking. Some of them are utilities, and some of them are critical to the creation of a booking.

The endpoint you will call first is the Initialise endpoint, sending the property uid of the property you want to book, and the language you want responses to be in. This endpoint will respond with a large amount of information which you are then free to use to build your UI.

After that you have three main stages required to create a booking :

  • Send booking information
  • Present prices to the guest
  • Confirm the booking

Generally this is the order you will call the API in :

  1. Initialise
  2. Set Dates
  3. Set Guest Numbers
  4. Set Property Booking
  5. Get Prices
  6. Set Address
  7. Validate booking

After the booking is validated, if the property has one or more payment gateways configured and enabled then you will need to redirect the guest to the confirmation_url returned during the initialisation step. If they do not you can call the /booking/create endpoint which will insert the booking and trigger any emails required without the guest needing to visit the confirmation page.

Set Address can be done at any stage, but typically it's done after the guest has made their booking selections.

Note:

There are two main property types in BookyFlow, MRPs and SRPs.

MRPS are properties where you book out a room in a property, for example in a hotel, a B&B, or even a camp site. SRPs are properties where you book out the entire property. An example would be a villa, an apartment or a cottage.

For both you will use the POST set/property/booking endpoint to fix the booking's state. For MRPs there's no need to send the room/tariff hatPair, but for MRPs you need to send them to indicate the guest's choice of room type/room.

Plugins

There are three main sets of code for the NBE.

NBE Common

The NBE Common plugin is responsible for collating property information required for taking a booking, providing that information to endpoints, and storing temporary booking data.

API Feature Booking

This is the plugin that provides the endpoints that Booking Form User Interfaces will communicate with BookyFlow through. They are responsible for receiving and validating information and confirming when a booking is ready to be committed to BookyFlow. If you like, they're the Meat and 2 Veg part of the booking engine.

The Booking Form

The booking form is entirely CMS and BookyFlow agnostic, javascript driven and communicates directly with the REST API. The current iteration relies heavily on Bootstrap and jQuery, but you can build it using whatever technology you like, using this booking form as a pattern to work from.