Booking Engine Overview
The following guide is to assist you in building a booking engine using the Resharmonics API. The booking engine will allow you to search for availablity, booking a unit, mark invoices as paid, and more.
The guide is written in TypeScript and is a step-by-step guide to building a booking engine using the Resharmonics API.
Source Code
The source code for the example is available at our public api examples
Introduction
The example assumes you are building a website and will have a content management systems (CMS) in place, or use the Resharmonics API to manage your content.
The majority of the content that is static, such a property information should be cached to reduce the number of API calls.
The process
The example authenticates using client credentials with the OAuth server, before each call the access token is checked to see if it has expired, if it has a new token is requested.
- Iterate through the properties to build the property cache
- Select a billing frequency which determines how the invoices will be created
- Select a booking type which determines the booking behavior and characteristics
- Select a booking channel which determines the source of the booking
- Iterates through the buildings to find an available unit type for the dates
- Create a contact for the booking
- Combine the contact, unit type and availability information to create a booking enquiry, the enquiry holds availability whilst the contact fills in payment details.
- The expection is that you then use a payment gateway to process the payment
- Once the payment is successful, convert the enquiry to a pending status booking, this creates invoices etc on the booking
- Create the payment on the booking
- Convert the booking to a confirmed status, which will cause booking emails and tasks to be scheduled.