> 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`). > - 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/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: partySize | type: partySize | description: Size of the party that needs to be seated during this time slot. Min: `1` | required: true param name: reservationLocationId | type: reservationLocationId | description: GUID of the reservation location for which to retrieve time slots. | required: true 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 - 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 Return type: GetScheduledTimeSlotsResponse - name: timeSlots | type: array | description: A list of time slots and their availability according to the specified party size. - name: startDate | type: string | 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 ### Get scheduled time slots ```curl curl -X POST 'https://www.wixapis.com/table-reservations/reservations/v1/scheduled-time-slots' \ -H 'Authorization: ' --data-binary '{"timeRange":{"startDate":"2023-06-08T9:30:00.000Z", "endDate":"2023-06-09T13:40:00.000Z"},"partySize":2,"reservationLocationId":"b3d165aa-52bb-49bb-a3e4-a673d9a1cb9d"}' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.reservations.TimeSlotsService.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: 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 param name: partySize | type: integer | description: Size of the party that needs to be seated during this time slot. Min: `1` | required: true param name: reservationLocationId | type: string | description: GUID of the reservation location for which to retrieve time slots. | required: true Return type: PROMISE - name: timeSlots | type: array | description: A list of time slots and their availability according to the specified party size. - 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-hosted) Self-hosted 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); }; ``` ---