Dynamic booking lead time based on existing bookings

Our heaters need about 45 minutes to warm up before a session can start. Because of this, customers should normally be able to book up until 45 minutes before the session starts.

However, if there’s already a booking for an earlier slot on the same day, the heater is already on. In that case, we’d like to allow customers to book up until 5 minutes before the session starts, since the warm-up time is no longer needed.

In other words, the minimum booking lead time should be dynamic:

  • No existing booking that day: 45 minutes before the session
  • Existing booking that day (heater already on): 5 minutes before the session

Is it possible to build this kind of conditional logic through the API if we develop our own front-end? Or are there built-in settings in SimplyBook.me that could support this?

Hi,

There are no built-in settings for this kind of conditional lead time at the moment — the minimum booking time in SimplyBook.me is a single fixed value and can’t switch dynamically based on whether other bookings already exist on the same day.

However, you can absolutely implement this with the API if you build your own front-end and generate the list of available slots yourself. The idea is to set the lead time in SimplyBook to the shorter value (5 minutes), and then filter slots on your side before showing them to the customer.

A simple algorithm would look like this:

  1. The customer picks a date.
  2. Call getStartTimeMatrix (or getAvailableTimeIntervals) to fetch all candidate slots for that date from the API.
  3. Call getBookings for the same date to see if there are already confirmed bookings.
  4. For each candidate slot, decide the required lead time:
    • If there is at least one existing booking on that day that starts before the candidate slot → required lead time = 5 minutes (heater is already on).
    • If there is no earlier booking on that day → required lead time = 45 minutes (heater still needs to warm up).
  5. Compare against the current time:
    • Keep the slot if slot_start_time - now >= required_lead_time.
    • Otherwise hide it.
  6. Display only the filtered slots to the customer.

In pseudocode:

slots = getStartTimeMatrix(date)
bookings = getBookings(date)
now = currentDateTime()

for slot in slots:
    earlier_booking_exists = any(b.start_time < slot.start_time for b in bookings)
    lead_time = 5 if earlier_booking_exists else 45  # minutes
    if (slot.start_time - now).minutes >= lead_time:
        show(slot)

One thing to keep in mind: because SimplyBook itself will still accept bookings up to the configured 5-minute limit, you’ll want to apply the same 45-minute check server-side before sending the final book API call — just so a customer can’t bypass the rule by calling the API directly.

Let me know if you’d like a more detailed example with the exact API method names and parameters.

Best regards