> 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 # Method name: queryServices(options: QueryServicesOptions) # Method package: wixBookingsV2 # Method menu location: wixBookingsV2 --> services --> queryServices # Method Link: https://dev.wix.com/docs/velo/apis/wix-bookings-v2/services/query-services.md # Method Description: Retrieves a list of up to 100 services, given the provided paging, filtering, and sorting. `queryServices()` runs with these defaults, which you can override: + `paging.limit` is `100`. + `paging.offset` is `0`. >**Notes:** > + Use UTC format when filtering with dates. > + Only 1 use of each filter in the same query is supported. If a filter is defined more than once in a query, only the first occurrence is processed. |PROPERTY |SUPPORTED FILTERS & SORTING |:---:|:---:| |`_id`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| |`type`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some)| |`name`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| |`description`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| |`tagLine`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| |`hidden`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some)| |`category.id`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| |`category.name`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| |`form.id`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| |`payment.options.online`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some)| |`payment.options.inPerson`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some)| |`payment.options.pricingPlan`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some)| |`onlineBooking.enabled`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some)| |`locations.business.id`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| |`schedule.firstSessionStart`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some)| |`schedule.lastSessionEnd`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some)| |`staffMemberIds`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`hasAll()`](/services/services-query-builder/has-all)| |`supportedSlugs.name`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| |`mainSlug.name`|[`eq()`](/services/services-query-builder/eq),[`ne()`](/services/services-query-builder/ne),[`exists()`](/services/services-query-builder/exists),[`in()`](/services/services-query-builder/in),[`hasSome()`](/services/services-query-builder/has-some),[`startsWith()`](/services/services-query-builder/starts-with)| # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Query services with default settings ```javascript import {services} from 'wix-bookings.v2'; async function queryServices() { const result = await services.queryServices().find() return result.items; } /* Promise resolves to: [ { "type": "COURSE", "sortOrder": 5, "name": "Cat Hugging Training", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will train you to become the best cat hugger around.", "tagLine": "Get some purr therapy training with our cat hugging experts", "defaultCapacity": 30, "hidden": false, "category": { "name": "Our Services", "sortOrder": 0, "_id": "99b3c3af-3dd1-4fcd-8d97-2fcedcb2908c" }, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "150", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "326e4696-bef0-4e37-83ad-db33236f1106" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "cat-hugging-training", "custom": false, "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "cat-hugging-training", "custom": false, "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://nitayr7.editorx.io/services-v2-test/service-page/cat-hugging-training", "bookingPage": "https://nitayr7.editorx.io/services-v2-test/service-page/cat-hugging-training" }, "revision": "1", "_id": "2e226dda-ba40-4565-b984-d7425a603e4c", "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)", "_updatedDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" }, { "type": "CLASS", "sortOrder": 4, "name": "Group Cat Hugging", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", "tagLine": "Get some purr therapy with our cat hugging service!", "defaultCapacity": 30, "hidden": false, "category": { "name": "Our Services", "sortOrder": 0, "_id": "99b3c3af-3dd1-4fcd-8d97-2fcedcb2908c" }, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "25", "currency": "USD" }, "deposit": { "value": "5", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "81aa34a4-0cbc-4476-b8ec-62878024cd97" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "group-cat-hugging-1", "custom": false, "_createdDate": "Tue Jan 16 2024 17:20:11 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "group-cat-hugging-1", "custom": false, "_createdDate": "Tue Jan 16 2024 17:20:11 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://nitayr7.editorx.io/services-v2-test/service-page/group-cat-hugging-1", "bookingPage": "https://nitayr7.editorx.io/services-v2-test/booking-calendar/group-cat-hugging-1", "calendarPage": "https://nitayr7.editorx.io/services-v2-test/booking-calendar/group-cat-hugging-1" }, "revision": "1", "_id": "fad1a29c-d06b-4ce7-ab80-98c54c4e0772", "_createdDate": "Tue Jan 16 2024 17:20:12 GMT+0100 (Central European Standard Time)", "_updatedDate": "Tue Jan 16 2024 17:20:12 GMT+0100 (Central European Standard Time)" } ] */ ``` ## Filter services by category ID ```javascript import {services} from 'wix-bookings.v2'; /* * Sample categoryId value: '99b3c3af-3dd1-4fcd-8d97-2fcedcb2908c' */ async function filterServicesByCategoryId(categoryId) { const result = await services.queryServices() .eq("category.id", categoryId) .find() return result.items; } /* Promise resolves to: [ { "type": "COURSE", "sortOrder": 5, "name": "Cat Hugging Training", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will train you to become the best cat hugger around.", "tagLine": "Get some purr therapy training with our cat hugging experts", "defaultCapacity": 30, "hidden": false, "category": { "name": "Our Services", "sortOrder": 0, "_id": "99b3c3af-3dd1-4fcd-8d97-2fcedcb2908c" }, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "150", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "326e4696-bef0-4e37-83ad-db33236f1106" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "cat-hugging-training", "custom": false, "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "cat-hugging-training", "custom": false, "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://nitayr7.editorx.io/services-v2-test/service-page/cat-hugging-training", "bookingPage": "https://nitayr7.editorx.io/services-v2-test/service-page/cat-hugging-training" }, "revision": "1", "_id": "2e226dda-ba40-4565-b984-d7425a603e4c", "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)", "_updatedDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" }, { "type": "CLASS", "sortOrder": 4, "name": "Group Cat Hugging", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", "tagLine": "Get some purr therapy with our cat hugging service!", "defaultCapacity": 30, "hidden": false, "category": { "name": "Our Services", "sortOrder": 0, "_id": "99b3c3af-3dd1-4fcd-8d97-2fcedcb2908c" }, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "25", "currency": "USD" }, "deposit": { "value": "5", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "81aa34a4-0cbc-4476-b8ec-62878024cd97" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "group-cat-hugging-1", "custom": false, "_createdDate": "Tue Jan 16 2024 17:20:11 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "group-cat-hugging-1", "custom": false, "_createdDate": "Tue Jan 16 2024 17:20:11 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://nitayr7.editorx.io/services-v2-test/service-page/group-cat-hugging-1", "bookingPage": "https://nitayr7.editorx.io/services-v2-test/booking-calendar/group-cat-hugging-1", "calendarPage": "https://nitayr7.editorx.io/services-v2-test/booking-calendar/group-cat-hugging-1" }, "revision": "1", "_id": "fad1a29c-d06b-4ce7-ab80-98c54c4e0772", "_createdDate": "Tue Jan 16 2024 17:20:12 GMT+0100 (Central European Standard Time)", "_updatedDate": "Tue Jan 16 2024 17:20:12 GMT+0100 (Central European Standard Time)" } ] */ ``` ## Sort services alphabetically by name ```javascript import {services} from 'wix-bookings.v2'; async function getServicesSorted() { const result = await services.queryServices() .ascending("name") .find() return result.items; } /* Promise resolves to: [ { "type": "COURSE", "sortOrder": 5, "name": "Cat Hugging Training", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will train you to become the best cat hugger around.", "tagLine": "Get some purr therapy training with our cat hugging experts", "defaultCapacity": 30, "hidden": false, "category": { "name": "Our Services", "sortOrder": 0, "_id": "99b3c3af-3dd1-4fcd-8d97-2fcedcb2908c" }, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "150", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "326e4696-bef0-4e37-83ad-db33236f1106" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "cat-hugging-training", "custom": false, "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "cat-hugging-training", "custom": false, "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://nitayr7.editorx.io/services-v2-test/service-page/cat-hugging-training", "bookingPage": "https://nitayr7.editorx.io/services-v2-test/service-page/cat-hugging-training" }, "revision": "1", "_id": "2e226dda-ba40-4565-b984-d7425a603e4c", "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)", "_updatedDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" }, { "type": "CLASS", "sortOrder": 4, "name": "Group Cat Hugging", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", "tagLine": "Get some purr therapy with our cat hugging service!", "defaultCapacity": 30, "hidden": false, "category": { "name": "Our Services", "sortOrder": 0, "_id": "99b3c3af-3dd1-4fcd-8d97-2fcedcb2908c" }, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "25", "currency": "USD" }, "deposit": { "value": "5", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "81aa34a4-0cbc-4476-b8ec-62878024cd97" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "group-cat-hugging-1", "custom": false, "_createdDate": "Tue Jan 16 2024 17:20:11 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "group-cat-hugging-1", "custom": false, "_createdDate": "Tue Jan 16 2024 17:20:11 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://nitayr7.editorx.io/services-v2-test/service-page/group-cat-hugging-1", "bookingPage": "https://nitayr7.editorx.io/services-v2-test/booking-calendar/group-cat-hugging-1", "calendarPage": "https://nitayr7.editorx.io/services-v2-test/booking-calendar/group-cat-hugging-1" }, "revision": "1", "_id": "fad1a29c-d06b-4ce7-ab80-98c54c4e0772", "_createdDate": "Tue Jan 16 2024 17:20:12 GMT+0100 (Central European Standard Time)", "_updatedDate": "Tue Jan 16 2024 17:20:12 GMT+0100 (Central European Standard Time)" } ] */ ``` ## Filter services by `mainSlug.name` ```javascript import {path} from 'wix-location'; import {services} from 'wix-bookings.v2'; export async function getServiceFromPath() { const [serviceNameInUrl] = path; const result = await services.queryServices() .eq("mainSlug.name", serviceNameInUrl) .limit(1) .find(); return result.items[0]; } /* Promise resolves to: [ { "type": "COURSE", "sortOrder": 5, "name": "Cat Hugging Training", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will train you to become the best cat hugger around.", "tagLine": "Get some purr therapy training with our cat hugging experts", "defaultCapacity": 30, "hidden": false, "category": { "name": "Our Services", "sortOrder": 0, "_id": "99b3c3af-3dd1-4fcd-8d97-2fcedcb2908c" }, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "150", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "326e4696-bef0-4e37-83ad-db33236f1106" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "cat-hugging-training", "custom": false, "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "cat-hugging-training", "custom": false, "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://nitayr7.editorx.io/services-v2-test/service-page/cat-hugging-training", "bookingPage": "https://nitayr7.editorx.io/services-v2-test/service-page/cat-hugging-training" }, "revision": "1", "_id": "2e226dda-ba40-4565-b984-d7425a603e4c", "_createdDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)", "_updatedDate": "Tue Jan 16 2024 17:29:55 GMT+0100 (Central European Standard Time)" }, { "type": "CLASS", "sortOrder": 4, "name": "Group Cat Hugging", "description": "Introducing the Purrfect Hug - the ultimate cat cuddling experience! Our team of expert cuddlers will come to your home and provide your furry feline with the warmest and snuggliest hugs around.", "tagLine": "Get some purr therapy with our cat hugging service!", "defaultCapacity": 30, "hidden": false, "category": { "name": "Our Services", "sortOrder": 0, "_id": "99b3c3af-3dd1-4fcd-8d97-2fcedcb2908c" }, "payment": { "rateType": "FIXED", "fixed": { "price": { "value": "25", "currency": "USD" }, "deposit": { "value": "5", "currency": "USD" } }, "options": { "online": true, "inPerson": false, "deposit": false, "pricingPlan": false }, "pricingPlanIds": [] }, "onlineBooking": { "enabled": true }, "locations": [ { "type": "BUSINESS" } ], "bookingPolicy": { "revision": "1", "name": "Default policy", "customPolicyDescription": { "enabled": true, "description": "" }, "default": true, "limitEarlyBookingPolicy": { "enabled": false, "earliestBookingInMinutes": 10080 }, "limitLateBookingPolicy": { "enabled": false, "latestBookingInMinutes": 1440 }, "bookAfterStartPolicy": { "enabled": false }, "cancellationPolicy": { "enabled": true, "limitLatestCancellation": false, "latestCancellationInMinutes": 1440 }, "reschedulePolicy": { "enabled": true, "limitLatestReschedule": false, "latestRescheduleInMinutes": 1440 }, "waitlistPolicy": { "enabled": false, "capacity": 10, "reservationTimeInMinutes": 10 }, "participantsPolicy": { "enabled": true, "maxParticipantsPerBooking": 1 }, "resourcesPolicy": { "enabled": false, "autoAssignAllowed": false }, "_id": "ede8ad9e-44e1-480e-833f-542aea019bd0", "_createdDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)", "_updatedDate": "Thu Dec 14 2023 16:14:33 GMT+0100 (Central European Standard Time)" }, "schedule": { "_id": "81aa34a4-0cbc-4476-b8ec-62878024cd97" }, "staffMemberIds": [], "staffMembers": [], "resourceGroups": [], "serviceResources": [], "supportedSlugs": [ { "name": "group-cat-hugging-1", "custom": false, "_createdDate": "Tue Jan 16 2024 17:20:11 GMT+0100 (Central European Standard Time)" } ], "mainSlug": { "name": "group-cat-hugging-1", "custom": false, "_createdDate": "Tue Jan 16 2024 17:20:11 GMT+0100 (Central European Standard Time)" }, "urls": { "servicePage": "https://nitayr7.editorx.io/services-v2-test/service-page/group-cat-hugging-1", "bookingPage": "https://nitayr7.editorx.io/services-v2-test/booking-calendar/group-cat-hugging-1", "calendarPage": "https://nitayr7.editorx.io/services-v2-test/booking-calendar/group-cat-hugging-1" }, "revision": "1", "_id": "fad1a29c-d06b-4ce7-ab80-98c54c4e0772", "_createdDate": "Tue Jan 16 2024 17:20:12 GMT+0100 (Central European Standard Time)", "_updatedDate": "Tue Jan 16 2024 17:20:12 GMT+0100 (Central European Standard Time)" } ] */ ``` ---