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:
With the Time Slots API, you can:
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.
It’s important to note the following points before starting to code:
For a comprehensive glossary of Table Reservations terms, see Terminology.
To use the TimeSlots API, install the @wix/table-reservations
package using npm or Yarn:
npm install @wix/table-reservations
or
yarn add @wix/table-reservations
Then import { timeSlots }
from @wix/table-reservations
:
import { 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.
Checks a restaurant's availability to accommodate a reservation for a given party size in a given time slot.
checkTimeSlot()
returns availability information for the restaurant's table combinations, and flags any party pacing or seat pacing conflicts that the proposed reservation would cause.
You can only call this method when authenticated as a Wix app or Wix user identity.
function checkTimeSlot(
reservationLocationId: string,
options: CheckTimeSlotOptions,
): Promise<CheckTimeSlotResponse>;
ID of the reservation location for which to check the time slot.
import { timeSlots } from "@wix/table-reservations";
async function checkTimeSlot(reservationLocationId, options) {
const response = await timeSlots.checkTimeSlot(
reservationLocationId,
options,
);
}
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 specified reservation location on a specified date
, and their availability for a specified partySize
.
Without passing optional parameters, the list will contain a single time slot at the specified date
.
Use slotsBefore
and slotsAfter
to get additional time slots before and after the specified 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 specified size.
The interval between startDate
s of time slots in the response is determined by the reservation location's timeSlotInterval
. This interval is not affected by the duration
provided.
function getTimeSlots(
reservationLocationId: string,
date: Date,
partySize: number,
options: GetTimeSlotsOptions,
): Promise<GetTimeSlotsResponse>;
ID of the reservation location for which to retrieve time slots.
Date and time for which to retrieve a time slot in ISO 8601 format.
Size of the party that needs to be seated during this time slot.
Min: 1
Options for retrieving the time slots.
import { timeSlots } from "@wix/table-reservations";
async function getTimeSlots(reservationLocationId, date, partySize, options) {
const response = await timeSlots.getTimeSlots(
reservationLocationId,
date,
partySize,
options,
);
}