Complex booking logic solved with API script

By | October 24, 2019
The website developer got a simple solution to solve complex needs and signed up as affiliate to get recurring revenues.

Sometimes there can be rather complex needs from companies that have been running on paper when they move on to an appointment booking system and may at first glance seem impossible to solve.

A website developer, working for a client was helping him to establish a web presence as well as making it possible for the clients to make bookings directly on the new website. This client had quite specific booking needs because he offered 7 courses (classes) and they were all available during opening hours but as soon as one class is booked the others should become unavailable while the one booked should still allow 2 more bookings.

So when I first heard about this requirement, I thought this was too complicated, and we could not solve it but while talking with the developer on the other side who was now thinking about doing this all using our API, an idea came to my mind. If the developer was ready to program all the interface in API, there was in fact a much quicker way to solve this using our automatic Call back function and then a simple script that the developer could program for his clients in a couple of hours.

First of all I directed the developer to our call back demo script. This script can be called by our servers each time a booking is placed in a certain system. The callback demo script then gets all relevant information about the booking which can now be used to trigger local stuff for this user. However in this case we would use the call back script just a little bit differently. When called up, the script would get info about the service being booked, and then this script would simply set all other services with special time as off during the booked time. The provider or class would still allow a total of 3 to be booked so, the service first booked during this period would continue to accept bookings until the class is filled.

Here is link to the SimplyBook.me callback function demo. https://github.com/vetalsimplybook/simplybook_callback_example_php

and here is link to the API funtion that can be used to set special times for service/provider or company. https://simplybook.me/api/developer-api/tab/doc_api#setWorkDayInfodefaultadmin

The task of the developer would simply be to setup this callback script on a server, get the ID’s of all services used (event_id), and then when callback script says that certain service (event-id) is booked at certain time, he takes this info and sends back via API to our servers and blocks this same time for the other services (event_id s).


If event_id is set, then function will set special time for services, if unit_group_id (provider) is set, then the special time is set for provider, if neither of these has id set, the special time is set for the whole company.

A complicated business logic was thereby solved in an easy way and there was no need to program everything via API for the developer, and our widget solution could still be used on the site that the website developer was creating for his client.

The developer was referred to the SimplyBook.me affiliate program so he could get part of the payments from the user that he was referring to SimplyBook.me and other future users.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.