queryAvailability( )


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 appointment slots or class events that match specified filters.

Query Availability doesn't use a query builder, instead it uses API query language.

Course limitations

Course events can't be retrieved with this method. Follow this sample flow (SDK | REST) to check course availability.

Query filter

You must include serviceId in your query filter. For performance, also specify both startDate and endDate. Refer to the supported filters article (SDK | REST) for a complete list of supported filters.

Limit the number of slots returned per day

To limit the maximum number of appointment slots returned for each date, specify slotsPerDay. For example, specifying {"slotsPerDay": 3} returns a maximum of 3 appointment slots/class events for each day that's within the query filter's date range.

Unavailable slots

By default, both available and unavailable appointment slots/ class events are returned. To retrieve only available slots/events, specify {"bookable": true} in the filter.

Sorting

Slots/events can be sorted only by startDate. Unavailable slots/events always appear after available ones.

Availability calculation

Wix Bookings calculates availability differently for appointment-based services and classes.

Appointment availability

An appointment slot is bookable if:

  • The slot's startDate is later than or equal to query.filter.startDate.
  • The slot's endDate is before or equal to query.filter.endDate.
  • The service's onlineBooking.enabled is true.
  • The service's early/late booking policies are either not enabled or the current time is within the defined limits.

Class event availability

A class event is bookable if:

  • The event's startDate is later than or equal to query.filter.startDate.
  • The event's endDate is before or equal to query.filter.endDate.
  • The event's remainingCapacity is greater than 0.
  • The service's onlineBooking.enabled is true.
  • The service's early/late booking policies are either not enabled or the current time is within the defined limits.

If you want to restrict returned class events to those with a minimum number of remaining spots, specify openSpots in the filter. By default, all class events, even those with no open spot, are returned.

Daylight Savings Time (DST)

Due to DST, some local times may not exist or may occur twice. For example, in Santiago, Chile, on September 7, 2025, 0:05 AM doesn't exist because the clock advances from 0:00 AM to 1:00 AM.

Query Availability automatically adjusts for these gaps. Non-existent times are moved forward by 1 hour, while existing times remain unchanged. For instance, if you call Query Availability with a startDate of 2025-09-07T00:00:01.000 and an endDate of 2025-09-08T00:00:02.000, the adjusted query will use 2025-09-07T01:00:01.000 as the new start time.

Permissions
Manage Bookings Services and Settings
Manage Bookings - all permissions
Read Bookings - all read permissions
Manage Bookings
Read Bookings - Public Data
Read Bookings - Including Participants
Read Bookings Calendar Availability
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
queryQueryV2Required

Query options. Refer to the supported filters article (SDK | REST) for a complete list of supported filters.


optionsQueryAvailabilityOptions

Options to use for querying availability.

Returns
Return Type:Promise<QueryAvailabilityResponse>
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?