Create a booking rule set
hub_create_booking_rulesCreate a booking policy. Call get_booking_rules FIRST and reuse a matching set instead — these are shared company-wide, not per product. weeklyHours are LOCAL wall-clock times at the outlet; if neither the outlet nor the company has a timezone the engine refuses availability with a 400, so fix the outlet rather than guessing an offset. bufferMinutes consumes grid time for slot bookings (cleaning between appointments); for overnight stays use checkInTime/checkOutTime instead and leave the buffer at 0 — the cleaning window lives in the gap and does not consume a night.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | How the merchant refers to it, e.g. "Haircuts 9–18" | |
| ratePeriod | Yes | What ONE unit of price buys. `slot` for appointments and hourly rental. `week` and `month` are in the enum but NOT offered: the grid still cuts them one day at a time, so a weekly rate would be charged per day | |
| bookingType | Yes | appointment = a person's time; rental = an asset; overnight = nights; group = a class | |
| checkInTime | No | Overnight only, "15:00" | |
| holdMinutes | No | How long an unpaid hold survives before the window frees itself. Default 10 | |
| weeklyHours | Yes | Opening hours per weekday, local time. Days left out are closed. For overnight stays leave hours off only if the property has none — an empty list there means every day. | |
| checkOutTime | No | Overnight only, "11:00" | |
| bufferMinutes | No | Dead time after each booking, e.g. 15 for cleaning. Consumes the grid | |
| maxAdvanceDays | No | How far ahead bookings open. 0 = no limit | |
| minNoticeMinutes | No | Shortest notice accepted, e.g. 60 | |
| slotLengthMinutes | Yes | How long one booking lasts, e.g. 30 |