Setup
To use the Services API, install the @wix/bookings
package using npm or Yarn:
1npm install @wix/bookings
or
1yarn add @wix/bookings
Then import { services }
from @wix/bookings
:
1import { services } from '@wix/bookings'
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Counts services according to given criteria. Use WQL filter to define the criteria.
Permission Scopes
For app development, you must have one of the following permission scopes:function countServices(options: CountServicesOptions): Promise<CountServicesResponse>
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a new service.
Permission Scopes
For app development, you must have one of the following permission scopes:function createService(service: Service): Promise<Service>
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Deletes a service.
Permission Scopes
For app development, you must have one of the following permission scopes:function deleteService(serviceId: string, options: DeleteServiceOptions): Promise<void>
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a service.
Permission Scopes
For app development, you must have one of the following permission scopes:function getService(serviceId: string): Promise<Service>
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
is100
.paging.offset
is0
.
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 |
---|---|
type | eq() ,ne() ,exists() ,in() ,hasSome() |
name | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
description | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
tagLine | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
hidden | eq() ,ne() ,exists() ,in() ,hasSome() |
category.id | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
category.name | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
form.id | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
payment.options.online | eq() ,ne() ,exists() ,in() ,hasSome() |
payment.options.inPerson | eq() ,ne() ,exists() ,in() ,hasSome() |
payment.options.pricingPlan | eq() ,ne() ,exists() ,in() ,hasSome() |
onlineBooking.enabled | eq() ,ne() ,exists() ,in() ,hasSome() |
locations.business.id | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
staffMemberIds | eq() ,ne() ,exists() ,in() ,hasSome() ,hasAll() |
supportedSlugs.name | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
mainSlug.name | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
Permission Scopes
For app development, you must have one of the following permission scopes:function queryServices(options: QueryServicesOptions): ServicesQueryBuilder
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Updates a service.
Partial updates are supported.
Each time the service is updated, revision
increments by 1. You must include the
number of the existing revision when
updating the service. This ensures you're working with the
latest service information and prevents unintended overwrites.
Permission Scopes
For app development, you must have one of the following permission scopes:function updateService(_id: string, service: UpdateService): Promise<Service>