> 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`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # QueryCategories # Package: services # Namespace: ServicesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-categories.md ## Permission Scopes: Wix Multilingual - Nile Wrapper Domain Events Read: SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ ## Introduction Retrieves a list of [service categories](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/introduction.md), given the provided filtering. --- ## REST API ### Schema ``` Method: queryCategories Description: Retrieves a list of [service categories](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/introduction.md), given the provided filtering. ### Defaults Query Categories has the following default setting, which you can't override: Sorted by `id` in ascending order. ### Filters When using date filters, you must use [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). ### See also To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md) and [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md). URL: https://www.wixapis.com/_api/bookings/v2/services/categories/query Method: POST Method parameters: param name: filter | type: QueryCategoriesFilter - name: services | type: object | description: Service filter. See [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md) for a list of supported filters. - name: categoryIds | type: array | description: List of category GUIDs to filter by. Return type: QueryCategoriesResponse - name: categories | type: array | description: Retrieved categories. - name: id | type: string | description: Category GUID. - name: name | type: string | description: Category name. - name: sortOrder | type: integer | description: Order of a category within a category list. ``` ### Examples ### Query categories ```curl curl -X POST 'https://www.wixapis.com/bookings/v2/services/categories/query' \ -H 'Authorization: ' \ -d '{ "filter": { "name": { "$startsWith": "Our" } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.services.ServicesService.queryCategories(options) Description: Retrieves a list of [service categories](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/categories-v2/introduction.md), given the provided filtering. ### Defaults Query Categories has the following default setting, which you can't override: Sorted by `id` in ascending order. ### Filters When using date filters, you must use [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). ### See also To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md) and [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md). Method parameters: param name: options | type: QueryCategoriesOptions none - name: filter | type: QueryCategoriesFilter | description: Filter. - name: services | type: object | description: Service filter. See [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md) for a list of supported filters. - name: categoryIds | type: array | description: List of category GUIDs to filter by. Return type: PROMISE - name: categories | type: array | description: Retrieved categories. - name: _id | type: string | description: Category GUID. - name: name | type: string | description: Category name. - name: sortOrder | type: integer | description: Order of a category within a category list. ``` ### Examples ### queryCategories ```javascript import { services } from '@wix/bookings'; async function queryCategories(options) { const response = await services.queryCategories(options); }; ``` ### queryCategories (with elevated permissions) ```javascript import { services } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myQueryCategoriesMethod(options) { const elevatedQueryCategories = auth.elevate(services.queryCategories); const response = await elevatedQueryCategories(options); } ``` ### queryCategories (self-hosted) Self-hosted 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 { services } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { services }, // Include the auth strategy and host as relevant }); async function queryCategories(options) { const response = await myWixClient.services.queryCategories(options); }; ``` ---