Setup
To use the MultiServiceAvailabilityTimeSlots API, install the @wix/bookings
package using npm or Yarn:
1npm install @wix/bookings
or
1yarn add @wix/bookings
Then import { multiServiceAvailabilityTimeSlots }
from @wix/bookings
:
1import { multiServiceAvailabilityTimeSlots } from '@wix/bookings'
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:function getMultiServiceAvailabilityTimeSlot(services: Array<Service>, localStartDate: string, localEndDate: string, timeZone: string, location: Location): Promise<GetMultiServiceAvailabilityTimeSlotResponse>
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 TimeSlot
s 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
, andtimeZone
. You may add additional filters as you wish. - A
cursorPaging
with a validcursor
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 NestedTimeSlot
s 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 10AvailableResources
that match the provided filters. EachAvailableResources
contains up to 10 availableresources
of the same type that match the provided filters. - If an
AvailableResources
has more available resources which are not listed within it, we returnAvailableResources
.hasMoreAvailableResources
as true. - If you wish to get the full available resources list for all
NestedTimeSlot
of a specificTimeSlot
, 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 from2024-01-30T14:30:00
to2024-01-30T15:30:00
, we don't return TimeSlots withNestedTimeSlot
.localStartDate
within this range for this service. - The response contains both
bookable
andun-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 violatingNestedTimeSlot
.localStartDate
, withbookable
asfalse
. If you want to list only bookable TimeSlots you should passbookable
astrue
. - If booking one of the
NestedTimeSlot
s violates one of the corresponding service's booking policies, theTimeSlot
returns withbookable
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 inASC
order.cursorPaging
.limit
is1000
.
Permission Scopes
For app development, you must have one of the following permission scopes:function listMultiServiceAvailabilityTimeSlots(options: ListMultiServiceAvailabilityTimeSlotsOptions): Promise<ListMultiServiceAvailabilityTimeSlotsResponse>