Booking API kit

A self-contained HTTP API for taking appointments: services with buffers, weekly hours, closed days, free slots in the business's time zone, bookings that can't double up, and cancellations with a private token.

Stack: JavaScript (ES modules), Node.js 20+, no dependencies. Version: 1.0.0 (2026-11-17).

  • Time zones and daylight-saving changes handled
  • Buffers before and after each service
  • Double-booking protection, tested under load
  • Admin token and private cancel tokens
  • JSON file store, easy to swap for a database
  • Tests and API reference included

It running

A copy of the kit, started on its own, answering five requests: add a 45-minute service with a 15-minute buffer, open 9 to 12 on Tuesdays, list the free times, book the first one, and list them again (the next free time moves to 10:00 because of the buffer). Long lists are cut short and ids shortened.

$ POST /services (admin)

{"name":"Haircut","minutes":45,"bufferAfter":15,"price":4000}

201

{
 "id": "9acbb889…",
 "name": "Haircut",
 "minutes": 45,
 "bufferBefore": 0,
 "bufferAfter": 15,
 "price": 4000,
 "active": true
}

$ PUT /hours (admin)

{"2":[["09:00","12:00"]]}

200

{
 "2": [
  [
   "09:00",
   "12:00"
  ]
 ]
}

$ GET /slots?service=<id>&day=2026-12-01

200

[
 {
  "start": "2026-12-01T14:00:00.000Z",
  "end": "2026-12-01T14:45:00.000Z",
  "local": "09:00"
 },
 {
  "start": "2026-12-01T14:15:00.000Z",
  "end": "2026-12-01T15:00:00.000Z",
  "local": "09:15"
 },
 {
  "start": "2026-12-01T14:30:00.000Z",
  "end": "2026-12-01T15:15:00.000Z",
  "local": "09:30"
 },
 "… 7 more"
]

$ POST /bookings

{"serviceId":"9acbb889…","start":"2026-12-01T14:00:00.000Z","name":"Sample Customer","email":"customer@example.com"}

201

{
 "id": "45523152…",
 "serviceId": "9acbb889…",
 "start": "2026-12-01T14:00:00.000Z",
 "end": "2026-12-01T14:45:00.000Z",
 "name": "Sample Customer",
 "status": "confirmed",
 "cancelToken": "…shown once…"
}

$ GET /slots?service=<id>&day=2026-12-01

200

[
 {
  "start": "2026-12-01T15:00:00.000Z",
  "end": "2026-12-01T15:45:00.000Z",
  "local": "10:00"
 },
 {
  "start": "2026-12-01T15:15:00.000Z",
  "end": "2026-12-01T16:00:00.000Z",
  "local": "10:15"
 },
 {
  "start": "2026-12-01T15:30:00.000Z",
  "end": "2026-12-01T16:15:00.000Z",
  "local": "10:30"
 },
 "… 3 more"
]

Choose a licence

The same code under three licences. The licence you buy is written into the download.

Basic

Use the code in one project for your own business. Not for client work or products you sell.

$49 one-time

Buy Basic

Commercial

Use the code in any number of projects for your own business and for your clients, including sites and apps you sell to a client.

$149 one-time

Buy Commercial

Extended

Everything in Commercial, plus products you sell to many customers (such as a hosted service or an app), and every later version of the kit.

$399 one-time

Buy Extended

Not Cayro's own code. Each kit is written separately for the marketplace, with no third-party dependencies, so there are no other licences to check.

Support: Source code kits: help with installing the kit only, within 3 business days. Custom changes aren't included.

Refunds: Templates, documents, kits and automations can be refunded until they are first downloaded, installed or applied. After that they can't be refunded. Set-up services can be refunded until the work starts.

Before you buy

What you get, how it reaches your workspace and what happens if it can't. No Cayro plan is needed to buy it.

Source code kits

You receive
The kit's source code with tests, docs and the licence you bought written in.
How it's installed
Download the zip and follow its README. It has no third-party dependencies.
If it can't be done
Templates, documents, kits and automations can be refunded until they are first downloaded, installed or applied. After that they can't be refunded. Set-up services can be refunded until the work starts.
Support
Source code kits: help with installing the kit only, within 3 business days. Custom changes aren't included.
After you pay
Paid options go through a secure Stripe checkout and are added to the workspace you chose as soon as Stripe confirms the payment. They're listed under Marketplace in that workspace, with your orders.
Set-up help
Not included. Everything here is set up by you in your own workspace, with the steps shown.
Refunds
Templates, documents, kits and automations can be refunded until they are first downloaded, installed or applied. After that they can't be refunded. Set-up services can be refunded until the work starts.
How to install and use source code kitsStep by step, from buying to using it in your workspace.Read the guide
  • Software

    Website audit

    Check the site you build for search, phones and accessibility.

    From $19 per report