> 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 # ListAvailabilityTimeSlotConfigurations # Package: timeSlots # Namespace: AvailabilityTimeSlotsConfigurationProvider # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/availability-time-slots-configuration-service-plugin/list-availability-time-slot-configurations.md ## Introduction Retrieves availability time slot configurations for the specified services. Wix calls this method when a customer views available booking times or books a service. For example: - When a customer loads the Bookings calendar to select a time slot, [List Availability Time Slots](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/list-availability-time-slots.md) calls this method. - When a customer books a service, [Get Availability Time Slot](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/get-availability-time-slot.md) calls this method. Wix uses the returned configurations to calculate available time slots, considering: - Service duration. - Split interval and buffer time. - Service locations. - Required resource types and available resources. Your implementation must return a configuration for each service in the request, in the same order. All fields in the response must be returned unless explicitly marked as optional. --- ## REST API ### Schema ``` Method: listAvailabilityTimeSlotConfigurations Description: Retrieves availability time slot configurations for the specified services. Wix calls this method when a customer views available booking times or books a service. For example: - When a customer loads the Bookings calendar to select a time slot, [List Availability Time Slots](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/list-availability-time-slots.md) calls this method. - When a customer books a service, [Get Availability Time Slot](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/get-availability-time-slot.md) calls this method. Wix uses the returned configurations to calculate available time slots, considering: - Service duration. - Split interval and buffer time. - Service locations. - Required resource types and available resources. Your implementation must return a configuration for each service in the request, in the same order. All fields in the response must be returned unless explicitly marked as optional. URL: https://www.wixapis.com/v2/list-availability-time-slot-configurations Method: POST Method parameters: param name: serviceIds | type: array | description: Deprecated. Use `services` instead. param name: services | type: array | description: Services to retrieve configurations for. This list is ordered. Return configurations in the same order as the services in this list. The same service GUID may appear multiple times with different customer choices. - name: serviceId | type: string | description: Service GUID. - name: customerChoices | type: CustomerChoices | description: Customer's selected choices for this service, such as duration from [service options and variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md) or [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md). - name: durationInMinutes | type: integer | description: Duration selected by the customer in minutes. Based on the customer's selection from [service options and variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md). When using [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md), we recommend passing only `addOnIds` instead of `durationInMinutes`. Wix Bookings then calculates the total duration automatically. If you specify both `addOnIds` and `durationInMinutes`, `durationInMinutes` must equal the service duration plus all selected add-on durations. - name: addOnIds | type: array | description: IDs of [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) selected by the customer. When specifying this field, we recommend omitting `durationInMinutes`. Wix Bookings then calculates the total duration based on the service duration plus all selected add-on durations. Return type: ListAvailabilityTimeSlotConfigurationsResponse - name: configurations | type: array | description: Configurations for the requested services. Must contain one configuration per service in the request, in the same order. - name: serviceId | type: string | description: Service GUID. - name: resourceTypes | type: array | description: [Resource types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction.md) required to book this service. For example, a room from the "rooms" resource type and a staff member from the "staff" resource type. - name: resourceTypeId | type: string | description: Resource type GUID. - name: resourceIds | type: array | description: IDs of resources available for booking within this resource type. These may be a subset of all resources in the type. - name: numberOfResourcesRequired | type: integer | description: Number of resources required to book the service. Currently supports only a value of `1`. Default: `1` - name: locations | type: array | description: Locations where this service is offered. You can specify multiple `BUSINESS` locations, but only a single `CUSTOM` or `CUSTOMER` location. - name: id | type: string | description: Location GUID. Returned only for business locations. - name: name | type: string | description: Location name. - name: formattedAddress | type: string | description: Full address of the location. - name: locationType | type: LocationType | description: Location type. - enum: - CUSTOM: Custom location specific to this service, not defined as a business location. - BUSINESS: Business location defined under Business Info in the dashboard. - CUSTOMER: Location determined by the customer at booking time. - name: splitIntervalInMinutes | type: integer | description: Time between available slots' start times in minutes. For example, with 5-minute intervals: `3:00`, `3:05`, and `3:10`. - name: duration | type: Duration | description: Service duration. - name: defaultInMinutes | type: integer | description: Default duration in minutes. - name: bufferTimeInMinutes | type: integer | description: Buffer time in minutes between the end of one slot and the start of the next. - name: scheduleId | type: string | description: GUID of the [schedule](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/introduction.md) for this service. ``` ### Examples ### List the availability time slot configuration - decoded JWT The data payload will include the following object as an encoded JWT. For the purposes of this example, we show the request and response objects decoded. ```curl curl -X POST \ 'https://provider.example.com/v2/list-availability-time-slot-configurations' \ -H 'user-agent: Wix' \ -H 'accept-encoding: gzip, deflate' \ -H 'content-type: text/plain; charset=utf-8' \ -d '{ "data": { "request": { "serviceIds": [ "9bf5cd2d-32fa-4ee7-952c-5e4b6de14714" ] }, "metadata": { "requestId": "1674480822.92546993606315181", "identity": { "identityType": "ANONYMOUS_VISITOR", "anonymousVisitorId": "c7808c1d-e6a5-49e5-bcbe-b3fcf2f72d28" }, "instanceId": "bb2b1658-9855-4598-b1e0-48e8cdb7f98a" } }, "aud": "3467d501-9004-498d-9b5c-d50f6d4ede66", "iss": "wix.com", "iat": 1674480823, "exp": 1678080823 }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.timeSlots.AvailabilityTimeSlotsConfigurationProvider.listAvailabilityTimeSlotConfigurations(request, metadata) Description: Retrieves availability time slot configurations for the specified services. Wix calls this method when a customer views available booking times or books a service. For example: - When a customer loads the Bookings calendar to select a time slot, [List Availability Time Slots](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/list-availability-time-slots.md) calls this method. - When a customer books a service, [Get Availability Time Slot](https://dev.wix.com/docs/api-reference/business-solutions/bookings/time-slots/time-slots-v2/get-availability-time-slot.md) calls this method. Wix uses the returned configurations to calculate available time slots, considering: - Service duration. - Split interval and buffer time. - Service locations. - Required resource types and available resources. Your implementation must return a configuration for each service in the request, in the same order. All fields in the response must be returned unless explicitly marked as optional. Method parameters: param name: metadata | type: Context | description: this message is not directly used by any service, it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. e.g. SPIs, event-handlers, etc.. NOTE: this context object MUST be provided as the last argument in each Velo method signature. Example: ```typescript export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { ... } ``` - name: requestId | type: string | description: A unique identifier of the request. You may print this GUID to your logs to help with future debugging and easier correlation with Wix's logs. - name: currency | type: string | description: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. - name: identity | type: IdentificationData | description: An object that describes the identity that triggered this request. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: languages | type: array | description: A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. - name: instanceId | type: string | description: The service provider app's instance GUID. param name: request | type: ListAvailabilityTimeSlotConfigurationsRequest - name: services | type: array | description: Services to retrieve configurations for. This list is ordered. Return configurations in the same order as the services in this list. The same service GUID may appear multiple times with different customer choices. - name: serviceId | type: string | description: Service GUID. - name: customerChoices | type: CustomerChoices | description: Customer's selected choices for this service, such as duration from [service options and variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md) or [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md). - name: durationInMinutes | type: integer | description: Duration selected by the customer in minutes. Based on the customer's selection from [service options and variants](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/introduction.md). When using [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md), we recommend passing only `addOnIds` instead of `durationInMinutes`. Wix Bookings then calculates the total duration automatically. If you specify both `addOnIds` and `durationInMinutes`, `durationInMinutes` must equal the service duration plus all selected add-on durations. - name: addOnIds | type: array | description: IDs of [add-ons](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/add-ons/introduction.md) selected by the customer. When specifying this field, we recommend omitting `durationInMinutes`. Wix Bookings then calculates the total duration based on the service duration plus all selected add-on durations. Return type: PROMISE - name: configurations | type: array | description: Configurations for the requested services. Must contain one configuration per service in the request, in the same order. - name: serviceId | type: string | description: Service GUID. - name: resourceTypes | type: array | description: [Resource types](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resource-types-v2/introduction.md) required to book this service. For example, a room from the "rooms" resource type and a staff member from the "staff" resource type. - name: resourceTypeId | type: string | description: Resource type GUID. - name: resourceIds | type: array | description: IDs of resources available for booking within this resource type. These may be a subset of all resources in the type. - name: numberOfResourcesRequired | type: integer | description: Number of resources required to book the service. Currently supports only a value of `1`. Default: `1` - name: locations | type: array | description: Locations where this service is offered. You can specify multiple `BUSINESS` locations, but only a single `CUSTOM` or `CUSTOMER` location. - name: _id | type: string | description: Location GUID. Returned only for business locations. - name: name | type: string | description: Location name. - name: formattedAddress | type: string | description: Full address of the location. - name: locationType | type: LocationType | description: Location type. - enum: - CUSTOM: Custom location specific to this service, not defined as a business location. - BUSINESS: Business location defined under Business Info in the dashboard. - CUSTOMER: Location determined by the customer at booking time. - name: splitIntervalInMinutes | type: integer | description: Time between available slots' start times in minutes. For example, with 5-minute intervals: `3:00`, `3:05`, and `3:10`. - name: duration | type: Duration | description: Service duration. - name: defaultInMinutes | type: integer | description: Default duration in minutes. - name: bufferTimeInMinutes | type: integer | description: Buffer time in minutes between the end of one slot and the start of the next. - name: scheduleId | type: string | description: GUID of the [schedule](https://dev.wix.com/docs/api-reference/business-management/calendar/schedules-v3/introduction.md) for this service. ``` ### Examples ### listAvailabilityTimeSlotConfigurations ```javascript import { availabilityTimeSlotsConfiguration } from '@wix/bookings/service-plugins'; async function listAvailabilityTimeSlotConfigurations(request,metadata) { const response = await availabilityTimeSlotsConfiguration.listAvailabilityTimeSlotConfigurations(request,metadata); }; ``` ### listAvailabilityTimeSlotConfigurations (with elevated permissions) ```javascript import { availabilityTimeSlotsConfiguration } from '@wix/bookings/service-plugins'; import { auth } from '@wix/essentials'; async function myListAvailabilityTimeSlotConfigurationsMethod(request,metadata) { const elevatedListAvailabilityTimeSlotConfigurations = auth.elevate(availabilityTimeSlotsConfiguration.listAvailabilityTimeSlotConfigurations); const response = await elevatedListAvailabilityTimeSlotConfigurations(request,metadata); } ``` ### listAvailabilityTimeSlotConfigurations (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 { availabilityTimeSlotsConfiguration } from '@wix/bookings/service-plugins'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { availabilityTimeSlotsConfiguration }, // Include the auth strategy and host as relevant }); async function listAvailabilityTimeSlotConfigurations(request,metadata) { const response = await myWixClient.availabilityTimeSlotsConfiguration.listAvailabilityTimeSlotConfigurations(request,metadata); }; ``` ---