Availability Calendar: Supported Filters

Query Availability (SDK | REST) allows you to retrieve appointment slots and class events based on a query filter.

Filtering

The filter object in Query Availability is limited compared to other Query methods in Wix APIs, requiring you to adhere to a specific format and fewer supported comparison operators.

Filter operators

filter supports only the implied equal operator, no other comparison operators from the API Query Language (SDK | REST) are supported.

Filter format

You're also limited in how you format the filter object, compared to other Query methods in Wix APIs.

Important:

You must specify filter like this:

Copy

You must not use following format when specifying filter:

Copy

Filter fields

The following table shows supported filter fields.

FieldRequiredNotes
startDateRequiredReturns appointment slots/class events that start at this time or later. Specify startDate in YYYY-MM-DDThh:mm:ss.sssZ format.
endDateRequiredReturns appointment slots/class events that end at this time or earlier. Specify endDate in YYYY-MM-DDThh:mm:ss.sssZ format.
serviceIdRequired
resourceId
timezoneSpecifying timezone doesn't return only slots/events specified in the timezone. Instead, startDate and endDate filters are adjusted by the specified timezone.
bookableSpecifying {"bookable": true} returns only available slots/events. By default, both available and non-available slots are returned.
bookingPolicyViolations.tooEarlyToBookBy default, all slots/events are returned. Specifying {"tooEarlyToBook": false} returns only those that customers can already book, while specifying {"tooEarlyToBook": true} returns only those that can't be booked yet.
bookingPolicyViolations.tooLateToBookBy default, all slots/events are returned. Specifying {"tooLateToBook": false} returns only those that customers can still book, while specifying {"tooLateToBook": true} returns only those that can no longer be booked.
location.businessLocation.idYou can specify location.businessLocation.id more than once in the filter. Then, available slots/events are returned for all specified locations.
openSpotsSpecifying openSpots returns only slots/events with at least the specified number of open spots. For appointment-based services, specifying any number greater than 1 returns no appointment slots at all. By default, all class events are returned, including those with zero open spots, while only appointment slots that are available (i.e., with at least 1 open spot) are returned.

Sorting

Currently, only sorting by startDate is supported. You can sort both in ascending and descending order.

Specify the sort object like this.

Copy

If you retrieve both available and unavailable slots/events, all available slots/events appear first, followed by any unavailable slot/event.

Did this help?