> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetScheduledTimeSlots

# Package: reservations

# Namespace: TimeSlotsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/reservations/time-slots/get-scheduled-time-slots.md

## Permission Scopes:
Manage Reservations (Basic): SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC

## Introduction

Returns a list of scheduled time slots at a specified reservation location for a specified time range, and their availability for a specified `partySize`.

Scheduled time slots are sequential time periods whose start times fall within a restaurant's opening hours. Opening hours are defined in the reservation location's `businessSchedule`.

[Experiences](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/wix-restaurants-new/reservations/experiences/introduction.md) have their own business schedules that override that of the reservation location. To get scheduled time slots for an experience, pass the ID of that experience to this method.

If a restaurant is open during distinct time periods throughout the week, the `startDate` of the first scheduled time slot returned for each period is the same as starting time of that time period.
If a restaurant is always open, the `startDate` of the first returned scheduled time slot for each week is Sunday at `00:00`.

The duration of scheduled time slots and the interval between their `startDate`s is determined by the reservation location's `timeSlotInterval`.

For example:

A restaurant is open every night from `22:30` to `03:55` with a `timeSlotInterval` of 1 hour.
If you called this method with the time range `23:00` to `02:50`, it would return time slots starting at `23:30`, `00:30`, `01:30`, and `02:30`.

---

## REST API

### Schema

```
 Method: getScheduledTimeSlots
 Description: Returns a list of scheduled time slots at a specified reservation location for a specified time range, and their availability for a specified `partySize`.  Scheduled time slots are sequential time periods whose start times fall within a restaurant's opening hours. Opening hours are defined in the reservation location's `businessSchedule`.  [Experiences](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/wix-restaurants-new/reservations/experiences/introduction.md) have their own business schedules that override that of the reservation location. To get scheduled time slots for an experience, pass the GUID of that experience to this method.  If a restaurant is open during distinct time periods throughout the week, the `startDate` of the first scheduled time slot returned for each period is the same as starting time of that time period. If a restaurant is always open, the `startDate` of the first returned scheduled time slot for each week is Sunday at `00:00`.  The duration of scheduled time slots and the interval between their `startDate`s is determined by the reservation location's `timeSlotInterval`.  For example:  A restaurant is open every night from `22:30` to `03:55` with a `timeSlotInterval` of 1 hour. If you called this method with the time range `23:00` to `02:50`, it would return time slots starting at `23:30`, `00:30`, `01:30`, and `02:30`.
 URL: https://www.wixapis.com/table-reservations/reservations/v1/scheduled-time-slots
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  reservationLocationId, timeRange, timeRange.startDate, timeRange.endDate, partySize
 Method parameters: 
   param name: areaId | type: areaId | description: GUID of the area for which to retrieve scheduled time slots. When provided, only tables belonging to this area are considered for availability.  | validation: format GUID
   param name: experienceId | type: experienceId | description: GUID of the experience for which to check the time slot.  | validation: format GUID
   param name: partySize | type: partySize | description: Size of the party that needs to be seated during this time slot.  Min: `1` | required: true | validation: minimum 1, maximum 10000, format int32
   param name: reservationLocationId | type: reservationLocationId | description: GUID of the reservation location for which to retrieve time slots. | required: true | validation: format GUID
   param name: timeRange | type: TimeRange   | required: true 
        - name: startDate | type: string | description: Date and time from which to retrieve time slots in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. | required: true | validation: format date-time
        - name: endDate | type: string | description: Date and time to which to retrieve time slots in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. | required: true | validation: format date-time
 Return type: GetScheduledTimeSlotsResponse
  - name: timeSlots | type: array<TimeSlot> | description: A list of time slots and their availability according to the specified party size.  | validation: minItems 0, maxItems 100
     - name: startDate | type: string | description: Start date and time of this time slot.  | validation: format date-time
     - name: duration | type: integer | description: Duration in minutes of this time slot.  
     - name: status | type: Status | description: Availability status of this time slot.  
         - enum:
         -     AVAILABLE: The restaurant can accommodate a party of the given size in this time slot.
         -     UNAVAILABLE: The restaurant can't accommodate a party of the given size in this time slot.
         -     NON_WORKING_HOURS: The restaurant is not open during this time slot. Time slots retrieved by Get Scheduled Time Slots never have this status.
     - name: manualApproval | type: boolean | description: Whether manual approval is required to make a reservation in this time slot.  


```

### Examples

### Get scheduled time slots
```curl
curl -X POST 'https://www.wixapis.com/table-reservations/reservations/v1/scheduled-time-slots' \
    -H 'Authorization: <AUTH>' \
    --data-binary '{"timeRange":{"startDate":"2023-06-08T09:30:00.000Z", "endDate":"2023-06-08T13:40:00.000Z"},"partySize":2,"reservationLocationId":"b3d165aa-52bb-49bb-a3e4-a673d9a1cb9d"}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.tableReservations.timeSlots.getScheduledTimeSlots(reservationLocationId, partySize, options)
 Description: Returns a list of scheduled time slots at a specified reservation location for a specified time range, and their availability for a specified `partySize`.  Scheduled time slots are sequential time periods whose start times fall within a restaurant's opening hours. Opening hours are defined in the reservation location's `businessSchedule`.  [Experiences](https://dev.wix.com/docs/api-reference/business-solutions/restaurants/wix-restaurants-new/reservations/experiences/introduction.md) have their own business schedules that override that of the reservation location. To get scheduled time slots for an experience, pass the GUID of that experience to this method.  If a restaurant is open during distinct time periods throughout the week, the `startDate` of the first scheduled time slot returned for each period is the same as starting time of that time period. If a restaurant is always open, the `startDate` of the first returned scheduled time slot for each week is Sunday at `00:00`.  The duration of scheduled time slots and the interval between their `startDate`s is determined by the reservation location's `timeSlotInterval`.  For example:  A restaurant is open every night from `22:30` to `03:55` with a `timeSlotInterval` of 1 hour. If you called this method with the time range `23:00` to `02:50`, it would return time slots starting at `23:30`, `00:30`, `01:30`, and `02:30`.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  reservationLocationId, options.timeRange, options.timeRange.startDate, options.timeRange.endDate, partySize, options
 Method parameters: 
   param name: reservationLocationId | type: string | description: GUID of the reservation location for which to retrieve time slots. | required: true | validation: format GUID
   param name: partySize | type: integer | description: Size of the party that needs to be seated during this time slot.  Min: `1` | required: true | validation: minimum 1, maximum 10000, format int32
   param name: options | type: GetScheduledTimeSlotsOptions  none | required: true 
        - name: timeRange | type: TimeRange | description: Time range from which to retrieve time slots. | required: true 
           - name: startDate | type: Date | description: Date and time from which to retrieve time slots in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. | required: true 
           - name: endDate | type: Date | description: Date and time to which to retrieve time slots in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. | required: true 
        - name: experienceId | type: string | description: GUID of the experience for which to check the time slot.  | validation: format GUID
        - name: areaId | type: string | description: GUID of the area for which to retrieve scheduled time slots. When provided, only tables belonging to this area are considered for availability.  | validation: format GUID
 Return type: PROMISE<GetScheduledTimeSlotsResponse>
  - name: timeSlots | type: array<TimeSlot> | description: A list of time slots and their availability according to the specified party size.  | validation: minItems 0, maxItems 100
     - name: startDate | type: Date | description: Start date and time of this time slot.  
     - name: duration | type: integer | description: Duration in minutes of this time slot.  
     - name: status | type: Status | description: Availability status of this time slot.  
         - enum:
         -     AVAILABLE: The restaurant can accommodate a party of the given size in this time slot.
         -     UNAVAILABLE: The restaurant can't accommodate a party of the given size in this time slot.
         -     NON_WORKING_HOURS: The restaurant is not open during this time slot. Time slots retrieved by Get Scheduled Time Slots never have this status.
     - name: manualApproval | type: boolean | description: Whether manual approval is required to make a reservation in this time slot.  


```

### Examples

### getScheduledTimeSlots
```javascript
import { timeSlots } from '@wix/table-reservations';

async function getScheduledTimeSlots(reservationLocationId,partySize,options) {
  const response = await timeSlots.getScheduledTimeSlots(reservationLocationId,partySize,options);
};
```

### getScheduledTimeSlots (with elevated permissions)
```javascript
import { timeSlots } from '@wix/table-reservations';
import { auth } from '@wix/essentials';

async function myGetScheduledTimeSlotsMethod(reservationLocationId,partySize,options) {
  const elevatedGetScheduledTimeSlots = auth.elevate(timeSlots.getScheduledTimeSlots);
  const response = await elevatedGetScheduledTimeSlots(reservationLocationId,partySize,options);
}
```

### getScheduledTimeSlots (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { timeSlots } from '@wix/table-reservations';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { timeSlots },
  // Include the auth strategy and host as relevant
});


async function getScheduledTimeSlots(reservationLocationId,partySize,options) {
  const response = await myWixClient.timeSlots.getScheduledTimeSlots(reservationLocationId,partySize,options);
};
```

---