> 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 # CountBookingPolicies # Package: policies # Namespace: BookingPoliciesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/count-booking-policies.md ## Permission Scopes: Read Bookings - Public Data: SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC ## Introduction Counts booking policies, given the provided filtering. See [Query Booking Policies](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/query-booking-policies.md) for a list of supported filters. --- ## REST API ### Schema ``` Method: countBookingPolicies Description: Counts booking policies, given the provided filtering. See [Query Booking Policies](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/query-booking-policies.md) for a list of supported filters. URL: https://www.wixapis.com/bookings/v1/booking-policies/count Method: POST Method parameters: param name: filter | type: filter | description: Filter to base the count on. See [Query Booking Policies](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/query-booking-policies.md) for a list of supported filters. Return type: CountBookingPoliciesResponse - name: count | type: integer | description: Number of booking policies matching the provided filter. ``` ### Examples ### Count booking policies filtered by `name` that starts with "my custom policy" (case insensitive) ```curl curl -X POST \ 'https://wixapis.com/bookings/v1/booking-policies/count' \ -H 'Authorization: ' \ -d '{ "filter": { "name": { "$startsWith": "my custom policy" } } }' ``` ### Count booking policies without filters ```curl curl -X POST \ 'https://wixapis.com/bookings/v1/booking-policies/count' \ -H 'Authorization: ' \ -d '{}' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.policies.BookingPoliciesService.countBookingPolicies(options) Description: Counts booking policies, given the provided filtering. See [Query Booking Policies](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/query-booking-policies.md) for a list of supported filters. Method parameters: param name: options | type: CountBookingPoliciesOptions none - name: filter | type: object | description: Filter to base the count on. See [Query Booking Policies](https://dev.wix.com/docs/api-reference/business-solutions/bookings/policies/booking-policies/query-booking-policies.md) for a list of supported filters. Return type: PROMISE - name: count | type: integer | description: Number of booking policies matching the provided filter. ``` ### Examples ### countBookingPolicies ```javascript import { bookingPolicies } from '@wix/bookings'; async function countBookingPolicies(options) { const response = await bookingPolicies.countBookingPolicies(options); }; ``` ### countBookingPolicies (with elevated permissions) ```javascript import { bookingPolicies } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myCountBookingPoliciesMethod(options) { const elevatedCountBookingPolicies = auth.elevate(bookingPolicies.countBookingPolicies); const response = await elevatedCountBookingPolicies(options); } ``` ### countBookingPolicies (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 { bookingPolicies } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { bookingPolicies }, // Include the auth strategy and host as relevant }); async function countBookingPolicies(options) { const response = await myWixClient.bookingPolicies.countBookingPolicies(options); }; ``` ---