Search.../

getServiceOptionsAndVariants( )

Developer Preview

Retrieves a serviceOptionsAndVariants object by service_options_and_variants_id.

Syntax

function getServiceOptionsAndVariants(serviceOptionsAndVariantsId: string): Promise<ServiceOptionsAndVariants>

getServiceOptionsAndVariants Parameters

NAME
TYPE
DESCRIPTION
serviceOptionsAndVariantsId
string

ID of the serviceOptionsAndVariants object to retrieve.

Returns

Retrieved serviceOptionsAndVariants object.

Return Type:

Promise<
ServiceOptionsAndVariants
>
NAME
TYPE
DESCRIPTION
_id
string

ID of the serviceOptionsAndVariants object.

maxPrice
Money

Price of the most expensive service variant.

minPrice
Money

Price of the cheapest service variant.

options
ServiceOptions

Service options. Note that currently only a single option is supported per service.

revision
string

Revision number, which increments by 1 each time the serviceOptionsAndVariants object is updated. To prevent conflicting changes, the current revision must be passed when updating and deleting the serviceOptionsAndVariants object.

Ignored when creating a serviceOptionsAndVariants object.

serviceId
string

ID of the service related to these options and variants.

variants
ServiceVariants

Information about the service's variants.

Was this helpful?

getServiceOptionsAndVariants example

Copy Code
1import { serviceOptionsAndVariants } from 'wix-bookings.v2';
2
3 async function getServiceOptionsAndVariants(serviceOptionsAndVariantsId) {
4 try {
5 const result = await serviceOptionsAndVariants.getServiceOptionsAndVariants(serviceOptionsAndVariantsId);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13