Skip to content

Booking Slots

Returns the runtime availability of slots for a booking product on a specific date. The Bagisto booking system supports five booking types (default, appointment, rental, event, table); the slot-config block lives on the parent product (see bookingProducts[] in Single Product). This endpoint converts that config + a target date into the actual bookable time slots.

Endpoint

GET /api/shop/booking-slots

Request Headers

HeaderRequiredDescription
AcceptYesapplication/json
X-STOREFRONT-KEYYesStorefront API key (pk_storefront_…)
X-LocaleNoOverride request locale
X-ChannelNoOverride channel scope

Query Parameters

ParameterTypeRequiredDescription
idintegerYesBooking product ID — i.e. bookingProducts[].id from a parent product, not the parent product's id.
datestringYesTarget date in YYYY-MM-DD format. Times in the response are computed against the channel's timezone for that date.

Pagination headers are not emitted — the response is the full list of slots for the date in one shot.

Response shape — by booking type

The internal structure depends on the booking product's type field. The API auto-routes to the right shape based on the parent booking product, so you don't pick which response — you get the right one for the product.

Flat slots (default · appointment · event · table)

json
[
  { "slotId": "...", "from": "12:00 PM", "to": "06:00 PM", "timestamp": "1777876200-1777897800", "qty": "5" }
]
FieldTypeDescription
slotIdstringStable identifier — pass it back to the cart endpoint when adding the slot.
fromstringSlot start time (hh:mm AM/PM)
tostringSlot end time
timestampstringUnix from-to range — server-computed, useful for logging and analytics
qtystring | nullRemaining capacity. null for types that don't track per-slot inventory

Grouped slots (rental hourly)

json
[
  {
    "slotId": "1",
    "time": "10:00 AM - 12:00 PM",
    "slots": [
      { "from": "10:00 AM", "to": "11:00 AM", "timestamp": "1777867200-1777870800", "qty": "5" }
    ]
  }
]
FieldTypeDescription
slotIdstringSequential index of the time-range group
timestringGroup label (e.g. "10:00 AM - 12:00 PM")
slotsarrayNested hourly sub-slots — same { from, to, timestamp, qty } shape as flat slots

Typical Flow

GET /api/shop/products/110
   └─ response.type            = "booking"
   └─ response.bookingProducts = [{ id: 1, type: "default", … }]

GET /api/shop/booking-slots?id=1&date=2026-05-04
   └─ [{ slotId: "...", from: "12:00 PM", to: "06:00 PM", … }]

The id you pass to /booking-slots is the booking product ID (the entry from the parent's bookingProducts[] array), not the parent product ID.

Empty results

A 200 OK with an empty array [] means "the product is bookable in principle but has no slots on this date". Common causes:

  • The booking product's weekly schedule excludes that day of the week.
  • All slots for the date are sold out.
  • The date is before/after the booking product's allowed window.

Use Cases

  • Render a date-picker on a booking-product detail page that shows available slots when a date is selected.
  • Validate a chosen slotId before adding it to the cart (re-fetch with the same date to confirm it's still in the response).
  • Power an admin "view today's bookings" tool — combine ?date= with each active booking product.

Released under the MIT License.