queryServices( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

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.
PROPERTYSUPPORTED FILTERS & SORTING
typeeq(),ne(),exists(),in(),hasSome()
nameeq(),ne(),exists(),in(),hasSome(),startsWith()
descriptioneq(),ne(),exists(),in(),hasSome(),startsWith()
tagLineeq(),ne(),exists(),in(),hasSome(),startsWith()
hiddeneq(),ne(),exists(),in(),hasSome()
category.ideq(),ne(),exists(),in(),hasSome(),startsWith()
category.nameeq(),ne(),exists(),in(),hasSome(),startsWith()
form.ideq(),ne(),exists(),in(),hasSome(),startsWith()
payment.options.onlineeq(),ne(),exists(),in(),hasSome()
payment.options.inPersoneq(),ne(),exists(),in(),hasSome()
payment.options.pricingPlaneq(),ne(),exists(),in(),hasSome()
onlineBooking.enabledeq(),ne(),exists(),in(),hasSome()
locations.business.ideq(),ne(),exists(),in(),hasSome(),startsWith()
staffMemberIdseq(),ne(),exists(),in(),hasSome(),hasAll()
supportedSlugs.nameeq(),ne(),exists(),in(),hasSome(),startsWith()
mainSlug.nameeq(),ne(),exists(),in(),hasSome(),startsWith()
Permissions
Read Bookings - Public Data
Manage Bookings Services and Settings
Manage Bookings
Read Bookings - Including Participants
Read Bookings - all read permissions
Manage Bookings - all permissions
Learn more about app permissions.
Method Declaration
Copy
function queryServices(options: QueryServicesOptions): ServicesQueryBuilder;
Method Parameters
optionsQueryServicesOptions
Returns

Query services without any filters. The defaults are a limit of 100, and an offset of 0.

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)" } ] */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?