Booking Features
Covers duration types, multi-resource bookings, and capacity/inventory management.
Covers duration types, multi-resource bookings, and capacity/inventory management.
Duration Types
Set on each service via the durationType field. Controls how endTime is calculated.
Fixed (default)
endTime = startTime + service.duration
The standard appointment mode. The service duration is fixed and always applied. Used for haircuts, consultations, classes with defined runtimes.
Flexible
endTime is provided by the caller in the booking request. The service duration field acts as the minimum; if the provided endTime results in less than duration minutes the booking is rejected.
Used for open-ended services where the customer specifies how long they need — workspace rentals, recording studios, vehicle bays.
When creating a flexible booking, pass both startTime and endTime:
Full-Day
endTime = end of the calendar day (23:59:59) relative to startTime.
Used for day-rate resources: hotel rooms, venue hire, equipment daily rental.
Multi-Resource Bookings
A single reservation can include multiple resources simultaneously using the items array. This is used for bookings that require a combination of resources — a couple's massage (two therapists), a wedding (venue + catering team), a film shoot (studio + equipment set).
The top-level service, resource, and startTime fields represent the primary booking. Additional resources go in the items array:
Each item in the items array has its own resource, optional service, optional startTime/endTime (for staggered scheduling), and optional guestCount.
Inheritance rules: Items missing startTime, endTime, service, or guestCount inherit the parent reservation's values.
Validation:
- Every item must have a
resourceandstartTime(either its own or inherited from the parent). Items missing required fields throw aValidationErroridentifying which item is incomplete (e.g.,items.1.resource). - Duplicate
(resource, startTime)pairs within the same booking are rejected. - Conflict errors include the item index (e.g.,
items.2.startTime) so you know which item failed.
Conflict detection runs independently for each resource in the items array. Each item's own service determines its buffer times (bufferTimeBefore/bufferTimeAfter), so different items can have different buffer windows.
Capacity and Inventory
By default, each resource allows only one concurrent booking. Set quantity > 1 to enable inventory mode.
quantity
The number of concurrent bookings the resource can accept for overlapping time windows.
With quantity: 20, up to 20 reservations can overlap. The 21st booking for the same time window is rejected.
capacityMode
Controls how the quantity limit is counted. Only relevant when quantity > 1.
per-reservation (default): Each booking occupies one unit, regardless of how many guests it contains. Use this for hotel rooms, parking spaces, equipment units, or any resource where each booking takes one slot.
per-guest: Each booking occupies guestCount units. Use this for group venues, yoga classes, boat tours, or any resource with a total people capacity.