Setup

To use the MultiServiceAvailabilityTimeSlots API, install the @wix/bookings package using npm or Yarn:

Copy
1
npm install @wix/bookings

or

Copy
1
yarn add @wix/bookings

Then import { multiServiceAvailabilityTimeSlots } from @wix/bookings:

Copy
1
import { multiServiceAvailabilityTimeSlots } from '@wix/bookings'
Was this helpful?
Yes
No

getMultiServiceAvailabilityTimeSlot( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves an available multiService TimeSlot that match the provided filters.

Throws SlotNotFound if there is no such available time slot.

Important:
Currently supported only for services of type APPOINTMENT.

By default, if you don't provide a service.includeResourceTypeIds or service.resourceIds in request, we return for each TimeSlot.NestedTimeSlot all AvailableResources with all AvailableResources.resources which are available to provide the corresponding service within the time slot.

If you specify service.includeResourceTypeIds or service.resourceIds in request, the returned TimeSlot.NestedTimeSlot for this service will contain only AvailableResources with at least one available resource which match the given resources filters, each contains all available resources out of those requested.

  • Notes:
  • All nested time slots share the same location.
  • You can pass up to 8 services.

Tip:
Use this API in order to get the availability of a specific TimeSlot out of those returned from ListMultiServiceAvailabilityTimeSlots API.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Bookings - Public Data
Manage Bookings Services and Settings
Read Bookings - Including Participants
Read Bookings - all read permissions
Read Bookings Calendar Availability
Manage Bookings - all permissions
Learn more about permission scopes.
Copy
function getMultiServiceAvailabilityTimeSlot(services: Array<Service>, localStartDate: string, localEndDate: string, timeZone: string, location: Location): Promise<GetMultiServiceAvailabilityTimeSlotResponse>
Method Parameters
servicesArray<Service>Required
Services for which the multiService TimeSlots are being returned for. Each service contains its own resources filters within. MinSize: 2. MaxSize: 8.

localStartDatestringRequired
Local start date of the time slot, in ISO-8601 format. For example, "2024-01-30T13:30:00".

localEndDatestringRequired
Local end date of the time slot, in ISO-8601 format. For example, "2024-01-30T14:30:00".

timeZonestringRequired
Time zone, in IANA time zone format.

locationLocationRequired
The location of the time slot. You must provide a specific locationType. If locationType is BUSINESS, you must also provide a locationId.
Supports filtering by location type, or by location ID. Other fields like name are ignored.
Returns
Return Type:Promise<GetMultiServiceAvailabilityTimeSlotResponse>
Was this helpful?
Yes
No

listMultiServiceAvailabilityTimeSlots( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a list of multiService TimeSlots that match the provided filters.

Important:
Currently supported only for services of type APPOINTMENT.

The request body must include either:

  • All of the following filters: service.serviceId, fromLocalDate, toLocalDate, location, and timeZone. You may add additional filters as you wish.
  • A cursorPaging with a valid cursor from previous response.

Each TimeSlot in response represents the availability of the given sequence of services in a specific order, location, and within a given range of time.

Each TimeSlot.NestedTimeSlot represents a single service from the given list. The order of the NestedTimeSlots is the same as the order of the given services in request. The first NestedTimeSlot has localStartDate within the given fromLocalDate and toLocalDate exclusive, and each following NestedTimeSlot has a localStartDate that equals to the previous NestedTimeSlot's localEndDate.

By default, the response contains at most 1000 results. If there are more than 1000 results, we return a cursorPagingMetadata with a cursor for the next page of results, regardless of whether a cursorPaging was provided in request.

Notes:

  • All nested time slots share the same location.
  • You can pass up to 8 services in request.

AvailableResources in response:

The TimeSlot.NestedTimeSlot's AvailableResources contains information about the resources that are available to provide the service within the NestedTimeSlot range of time. Each AvailableResources contains information about available resources of the same type.

Important:
By default, if you don't specify service.includeResourceTypeIds or service.resourceIds filters in request, we return TimeSlots with NestedTimeSlots with an empty AvailableResources.
Note:
Not specifying resources filters can be handy in case you want to avoid large response in flows that only interested of whether the time slots are available. [Finding the next available slot within the next 3 months](https://bo.wix.com/wix-docs/rest/all-apis/service-availability/multi-service-availability-time-slots/sample-flows?localViewerId=inbari#all-apis_service-availability_multi-service-availability-time-slots_sample-flows_find-the-first-date-within-the-next-3-months-that-all-selected-services-are-available-for) is an example for such flow.

If you wish to get a list of available resources for a TimeSlot.NestedTimeSlot you should either:

  • provide service.resourceIds in request.
  • provide service.includeResourceTypeIds in request.

Notes:

  • In both cases the returned TimeSlot.NestedTimeSlot contains up to 10 AvailableResources that match the provided filters. Each AvailableResources contains up to 10 available resources of the same type that match the provided filters.
  • If an AvailableResources has more available resources which are not listed within it, we return AvailableResources.hasMoreAvailableResources as true.
  • If you wish to get the full available resources list for all NestedTimeSlot of a specific TimeSlot, you should call GetMultiServiceAvailabilityTimeSlot.

Availability VS Bookability

An available time slot is not necessarily bookable. The bookable field of a TimeSlot indicates whether the customer can book all of the of the services within the given time slot, at a specific period of time. Read more about Availability VS Bookability.

By default,

  • The response does not contains unavailable TimeSlots.For example, if there are no available resources to provide one of the services from 2024-01-30T14:30:00 to 2024-01-30T15:30:00, we don't return TimeSlots with NestedTimeSlot.localStartDate within this range for this service.
  • The response contains both bookable and un-bookable TimeSlots.For example, if one of the services has a booking policy which enforces booking the service up to 10 minutes before the session starts, we return TimeSlots with the violating NestedTimeSlot.localStartDate, with bookable as false. If you want to list only bookable TimeSlots you should pass bookable as true.
  • If booking one of the NestedTimeSlots violates one of the corresponding service's booking policies, the TimeSlot returns with bookable as false. There is no indication which service's policy was violated.

Important: Because of DST, there are edge cases where certain times either do not exist or exist twice for a local time zone. Read more about DST Handling

ListAvailabilityTimeSlots runs with the following defaults:

  • localStartDate is sorted in ASC order.
  • cursorPaging.limit is 1000.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Bookings - Public Data
Manage Bookings Services and Settings
Read Bookings - Including Participants
Read Bookings - all read permissions
Read Bookings Calendar Availability
Manage Bookings - all permissions
Learn more about permission scopes.
Copy
function listMultiServiceAvailabilityTimeSlots(options: ListMultiServiceAvailabilityTimeSlotsOptions): Promise<ListMultiServiceAvailabilityTimeSlotsResponse>
Method Parameters
optionsListMultiServiceAvailabilityTimeSlotsOptions
Returns
Return Type:Promise<ListMultiServiceAvailabilityTimeSlotsResponse>
Was this helpful?
Yes
No