Introduction
The Time Slots API allows you to retrieve availability information for time slots at a reservation location on and around a given date and for a given party size.
A time slot represents a period of time in a restaurant’s calendar. Time slots can have any duration, and restaurants generally set their durations based on party size.
The following factors influence whether a time slot at a reservation location is available:
- The size of the party that must be seated.
- The reservation location’s table and seat pacing rules.
- The reservation location’s business schedule (operating hours).
- Existing reservations at the reservation location.
With the Time Slots API, you can:
- Get time slots for a reservation location.
A time slot can have the following statuses:
AVAILABLE
- The restaurant is open and available to seat a party of the given size at the given date and time.UNAVAILABLE
- The restaurant is open but unable to seat a party of the given size at the given date and time.NON_WORKING_HOURS
- The restaurant is not open at this time.
timeSlot
objects also indicate whether manual approval is required to make a reservation at the given reservation location.
Before you begin
It’s important to note the following points before starting to code:
- The site or project owner must install the Wix Table Reservations app.
- The site or project owner must have at least 1 location configured in their Dashboard under Business Info.
Terminology
For a comprehensive glossary of Table Reservations terms, see Terminology.
Setup
To use the TimeSlots API, install the @wix/table-reservations
package using npm or Yarn:
1npm install @wix/table-reservations
or
1yarn add @wix/table-reservations
Then import { timeSlots }
from @wix/table-reservations
:
1import { timeSlots } from '@wix/table-reservations'
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Returns a list of time slots at a given restaurant on a given date
, and their availability for a given partySize
.
Without passing optional parameters, the list will contain a single time slot at the given date
.
Use slotsBefore
and slotsAfter
to get additional time slots before and after the given date
.
If you do not provide a duration
, the duration will be calculated automatically based on the reservation location's configuration.
The reservation location's settings used to determine the duration are its defaultTurnoverTime
and turnoverTimeRules
. These specify how much time should be allotted for a reservation of a party of a given size.
The startDate
s of time slots in the response are 15 minutes apart regardless of the duration
provided.
Permission Scopes
For app development, you must have one of the following permission scopes:function getTimeSlots(reservationLocationId: string, date: , partySize: number, options: GetTimeSlotsOptions): Promise<GetTimeSlotsResponse>