getServiceOptionsAndVariantsByServiceId( )


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 service's options and variants by service_id.

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 getServiceOptionsAndVariantsByServiceId(
  serviceId: string,
): Promise<GetServiceOptionsAndVariantsByServiceIdResponse>;
Method Parameters
serviceIdstringRequired

ID of the service to retrieve options and variants for.

Returns
Return Type:Promise<GetServiceOptionsAndVariantsByServiceIdResponse>
JavaScript
import { serviceOptionsAndVariants } from "wix-bookings.v2"; async function getServiceOptionsAndVariantsByServiceId(serviceId) { try { const result = await serviceOptionsAndVariants.getServiceOptionsAndVariantsByServiceId( serviceId, ); return result; } catch (error) { console.error(error); // Handle the error } }
Errors

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

Did this help?