> 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 # GetTimeSlots # Package: reservations # Namespace: TimeSlotsService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/reservations/time-slots/get-time-slots.md ## Permission Scopes: Manage Reservations (Basic): SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC ## Introduction 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. --- ## REST API ### Schema ``` Method: getTimeSlots Description: 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. URL: https://www.wixapis.com/v1/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, date, partySize Method parameters: param name: date | type: date | description: Date and time for which to retrieve a time slot in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. | required: true param name: duration | type: duration | description: Duration in minutes of the time slot. Min: `5` 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: slotsAfter | type: slotsAfter | description: The number of time slots to retrieve after the specified `date`. param name: slotsBefore | type: slotsBefore | description: The number of time slots to retrieve before the specified `date`. Return type: GetTimeSlotsResponse - 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 time slots ```curl curl -X POST 'https://www.wixapis.com/table-reservations/reservations/v1/time-slots' \ -H 'Authorization: ' --data-binary '{"slotsBefore":7,"slotsAfter":7,"date":"2023-06-08T11:30:00.000Z","partySize":2,"reservationLocationId":"b3d165aa-52bb-49bb-a3e4-a673d9a1cb9d"}' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.reservations.TimeSlotsService.getTimeSlots(reservationLocationId, date, partySize, options) Description: 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. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: reservationLocationId, date, partySize Method parameters: param name: date | type: string | description: Date and time for which to retrieve a time slot in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. | required: true param name: options | type: GetTimeSlotsOptions none - name: duration | type: integer | description: Duration in minutes of the time slot. Min: `5` - name: slotsBefore | type: integer | description: The number of time slots to retrieve before the specified `date`. - name: slotsAfter | type: integer | description: The number of time slots to retrieve after the specified `date`. 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 ### getTimeSlots ```javascript import { timeSlots } from '@wix/table-reservations'; async function getTimeSlots(reservationLocationId,date,partySize,options) { const response = await timeSlots.getTimeSlots(reservationLocationId,date,partySize,options); }; ``` ### getTimeSlots (with elevated permissions) ```javascript import { timeSlots } from '@wix/table-reservations'; import { auth } from '@wix/essentials'; async function myGetTimeSlotsMethod(reservationLocationId,date,partySize,options) { const elevatedGetTimeSlots = auth.elevate(timeSlots.getTimeSlots); const response = await elevatedGetTimeSlots(reservationLocationId,date,partySize,options); } ``` ### getTimeSlots (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 getTimeSlots(reservationLocationId,date,partySize,options) { const response = await myWixClient.timeSlots.getTimeSlots(reservationLocationId,date,partySize,options); }; ``` ---