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 Wix user must install the Wix Table Reservations app.
  • The Wix user must have at least 1 location configured in the Dashboard under Business Info.

Terminology

For a comprehensive glossary of Table Reservations terms, see Terminology.

Did this help?

Setup

To use the TimeSlots API, install the @wix/table-reservations package using npm or Yarn:

Copy
npm install @wix/table-reservations

or

Copy
yarn add @wix/table-reservations

Then import { timeSlots } from @wix/table-reservations:

Copy
import { timeSlots } from "@wix/table-reservations";
Did this help?

checkTimeSlot( )


Developer Preview

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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Reservations (Full)
Manage Reservations (Medium)
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
function checkTimeSlot(
  reservationLocationId: string,
  options: CheckTimeSlotOptions,
): Promise<CheckTimeSlotResponse>;
Method Parameters
reservationLocationIdstringRequired

ID of the reservation location for which to check the time slot.


optionsCheckTimeSlotOptions
Returns
Return Type:Promise<CheckTimeSlotResponse>
JavaScript
import { timeSlots } from "@wix/table-reservations"; async function checkTimeSlot(reservationLocationId, options) { const response = await timeSlots.checkTimeSlot( reservationLocationId, options, ); }
Did this help?

getTimeSlots( )


Developer Preview

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 startDates of time slots in the response is determined by the reservation location's timeSlotInterval. This interval is not affected by the duration provided.

Permissions
Manage Reservations (Basic)
Manage Reservations (Full)
Manage Reservations (Medium)
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
function getTimeSlots(
  reservationLocationId: string,
  date: Date,
  partySize: number,
  options: GetTimeSlotsOptions,
): Promise<GetTimeSlotsResponse>;
Method Parameters
reservationLocationIdstringRequired

ID of the reservation location for which to retrieve time slots.


dateDateRequired

Date and time for which to retrieve a time slot in ISO 8601 format.


partySizenumberRequired

Size of the party that needs to be seated during this time slot.

Min: 1


optionsGetTimeSlotsOptions

Options for retrieving the time slots.

Returns
Return Type:Promise<GetTimeSlotsResponse>
JavaScript
import { timeSlots } from "@wix/table-reservations"; async function getTimeSlots(reservationLocationId, date, partySize, options) { const response = await timeSlots.getTimeSlots( reservationLocationId, date, partySize, options, ); }
Did this help?