> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# QueryAvailabilityExceptions

# Package: onlineOrders

# Namespace: AvailabilityExceptionsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/availability-exceptions/query-availability-exceptions.md

## Permission Scopes:
Manage Restaurants - all permissions: SCOPE.RESTAURANTS.MEGA-SCOPES

## Introduction

Retrieves a list of availability exceptions given the specified paging, filtering, and sorting. Up to 100 availability exceptions can be returned per request.

To learn how to query availability exceptions, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).

---

## REST API

### Schema

```
 Method: queryAvailabilityExceptions
 Description: Retrieves a list of availability exceptions given the specified paging, filtering, and sorting. Up to 100 availability exceptions can be returned per request.  To learn how to query availability exceptions, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
 URL: https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/query
 Method: POST
 Method parameters:
   param name: query | type: CursorQuery    
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 4
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 64
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: startTime | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: endTime | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: available | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: affectedFulfillmentMethods.affectedMethods | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: affectedFulfillmentMethods.specificFulfillmentMethodsOptions.fulfillmentMethodIds | operators: $hasSome, $hasAll, $exists, $isEmpty | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryAvailabilityExceptionsResponse
  - name: availabilityExceptions | type: array<AvailabilityException> | description: List of availability exceptions.  
     - name: id | type: string | description: Availability exception GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the availability exception is updated. To prevent conflicting changes, the current revision must be specified when updating the availability exception.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the availability exception was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the availability exception was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | read-only: true | validation: format date-time
     - name: startTime | type: string | description: The start time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | validation: format date-time
     - name: endTime | type: string | description: The end time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | validation: format date-time
     - name: available | type: boolean | description: Whether the exception makes the [`start_time`, `end_time`] range available. If `true`, the exception makes the restaurant available for online ordering during the time range. If `false`, the exception makes the restaurant unavailable for ordering during the time range. Currently, only `false` is supported.  | read-only: true 
     - name: name | type: string | description: Exception name.  | validation: maxLength 500
     - name: affectedFulfillmentMethods | type: AffectedFulfillmentMethods | description: Fulfillment methods for which this exception applies.  
        - ONE-OF: 
           - name: specificFulfillmentMethodsOptions | type: SpecificFulfillmentMethodsImpactScope | description: Settings for specific fulfillment methods.  
              - name: fulfillmentMethodIds | type: array<string> | description: IDs of the fulfillment methods this exception applies to.  | validation: maxItems 500, format GUID
        - name: affectedMethods | type: AffectedMethods | description: The type of the fulfillment methods this exception applies to.  
             - enum:
             -     ALL_FULFILLMENT_METHODS: All fulfillment methods of this operation applied for this exception.
             -     SPECIFIC_FULFILLMENT_METHODS: Specific fulfillment methods applied for this exception.
             -     ALL_PICKUP_FULFILLMENT_METHODS: All pickup fulfillment methods applied for this exception.
             -     ALL_DELIVERY_FULFILLMENT_METHODS: All delivery fulfillment methods applied for this exception.
     - name: operationId | type: string | description: GUID of the restaurant operation this exception is associated with. (See the Restaurants Operations API for more information.)  | validation: format GUID
     - name: extendedFields | type: ExtendedFields | description: Extended fields.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: businessLocationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the operation this availability exception applies to.  | read-only: true | validation: format GUID
     - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of availability exceptions.  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs  | validation: maxItems 100, maxLength 5
        - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Offset that was requested.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page.  


```

### Examples

### Query availability exceptions
```curl
curl -X POST https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/query \
    -H 'Content-Type: application/json' \
    -H 'Authorization: <AUTH>' \
    --data-raw '{
                  "query": {
                    "sort": [],
                    "filter": {
                      "name": {
                        "$startsWith": "ASAP"
                      }
                    }
                  }
                }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.restaurants.availabilityExceptions.queryAvailabilityExceptions(query)
 Description: Retrieves a list of availability exceptions given the specified paging, filtering, and sorting. Up to 100 availability exceptions can be returned per request.  To learn how to query availability exceptions, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: AvailabilityExceptionQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 4
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 64
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _updatedDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: startTime | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: endTime | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: available | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: affectedFulfillmentMethods.affectedMethods | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: affectedFulfillmentMethods.specificFulfillmentMethodsOptions.fulfillmentMethodIds | operators: $hasSome, $hasAll, $exists, $isEmpty | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryAvailabilityExceptionsResponse>
  - name: availabilityExceptions | type: array<AvailabilityException> | description: List of availability exceptions.  
     - name: _id | type: string | description: Availability exception GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the availability exception is updated. To prevent conflicting changes, the current revision must be specified when updating the availability exception.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the availability exception was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the availability exception was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  | read-only: true 
     - name: startTime | type: Date | description: The start time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  
     - name: endTime | type: Date | description: The end time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format.  
     - name: available | type: boolean | description: Whether the exception makes the [`start_time`, `end_time`] range available. If `true`, the exception makes the restaurant available for online ordering during the time range. If `false`, the exception makes the restaurant unavailable for ordering during the time range. Currently, only `false` is supported.  | read-only: true 
     - name: name | type: string | description: Exception name.  | validation: maxLength 500
     - name: affectedFulfillmentMethods | type: AffectedFulfillmentMethods | description: Fulfillment methods for which this exception applies.  
        - ONE-OF: 
           - name: specificFulfillmentMethodsOptions | type: SpecificFulfillmentMethodsImpactScope | description: Settings for specific fulfillment methods.  
              - name: fulfillmentMethodIds | type: array<string> | description: IDs of the fulfillment methods this exception applies to.  | validation: maxItems 500, format GUID
        - name: affectedMethods | type: AffectedMethods | description: The type of the fulfillment methods this exception applies to.  
             - enum:
             -     ALL_FULFILLMENT_METHODS: All fulfillment methods of this operation applied for this exception.
             -     SPECIFIC_FULFILLMENT_METHODS: Specific fulfillment methods applied for this exception.
             -     ALL_PICKUP_FULFILLMENT_METHODS: All pickup fulfillment methods applied for this exception.
             -     ALL_DELIVERY_FULFILLMENT_METHODS: All delivery fulfillment methods applied for this exception.
     - name: operationId | type: string | description: GUID of the restaurant operation this exception is associated with. (See the Restaurants Operations API for more information.)  | validation: format GUID
     - name: extendedFields | type: ExtendedFields | description: Extended fields.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: businessLocationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the operation this availability exception applies to.  | read-only: true | validation: format GUID
     - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of availability exceptions.  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs  | validation: maxItems 100, maxLength 5
        - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Offset that was requested.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page.  


```

### Examples

### queryAvailabilityExceptions
```javascript
// @title Query Availability Exceptions
import { availabilityExceptions } from "@wix/restaurants";

async function queryAvailabilityExceptions() {
  const response = await availabilityExceptions
    .queryAvailabilityExceptions()
    .startsWith("name", "ASAP")
    .find();
  return response;
}

```

### queryAvailabilityExceptions (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { availabilityExceptions } from '@wix/restaurants';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { availabilityExceptions },
  // Include the auth strategy and host as relevant
});


async function queryAvailabilityExceptions(query) {
  const response = await myWixClient.availabilityExceptions.queryAvailabilityExceptions(query);
};
```

---