Gets the available slots for a specific service.
The getServiceAvailability()
function returns a Promise that resolves to a
list of slots from the given service that have open spots, and can therefore
still be booked. If the service is offered in multiple locations, a slot is returned for each location.
Note: location
in the slot object is not yet available to all users.
Service availability means different things for the different service types:
AvailabilityOptions
or within the default time frame if no options are specified.AvailabilityOptions
or within
the default time frame if no options are specified.AvailabilityOptions
or within the default time frame if no options are specified.To understand how getServiceAvailability()
is used in a typical booking lifecycle,
see Typical Booking Lifecycle.
The passed serviceId
must be an ID from your site's Bookings/Services
collection. Typically, you retrieve the ID from from the collection using a
query or through a dataset.
Optionally, you can pass an AvailabilityOptions
object that defines a date range for which slots should be returned. If you
do not pass an an AvailabilityOptions
object, the
default date range is from the date and time the function is called until one
week later.
The ID of the service for which to check slot availability.
Options that refine which slots should be returned.