createServiceOptionsAndVariants( )


Developer Preview

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

Creates options and variants for a service.

Before creating the serviceOptionsAndVariants object you need to anticipate and manually define all variants based on the defined options and their choices. You then pass the options and variants arrays in the request. Variants aren't automatically calculated from the defined options and choices.

Current Limitations:

  • Only a single serviceOptionsAndVariants object is supported per service.

  • Only a single option is supported per serviceOptionsAndVariants object. This means that services are limited to a single option. Therefore, variantsprovides pricing details for either all choices of the single option (for CUSTOM options) or all staff members providing the service (for STAFF_MEMBER options).

For a list of error messages, see Create Service Options and Variants Errors.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Bookings Services and Settings
Manage Bookings
Manage Bookings - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
serviceOptionsAndVariantsServiceOptionsAndVariantsRequired

Service options and variants to create.

Returns
Return Type:Promise<ServiceOptionsAndVariants>
Was this helpful?
Yes
No