> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: createServiceOptionsAndVariants(serviceOptionsAndVariants: ServiceOptionsAndVariants) # Method package: wixBookingsV2 # Method menu location: wixBookingsV2 --> serviceOptionsAndVariants --> createServiceOptionsAndVariants # Method Link: https://dev.wix.com/docs/velo/apis/wix-bookings-v2/service-options-and-variants/create-service-options-and-variants.md # Method Description: 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, `variants`provides 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](https://dev.wix.com/api/rest/wix-bookings/service-options-and-variants/error-messages#service-options-and-variants_error-messages_create-service-options-and-variants-errors). # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## createServiceOptionsAndVariants example for dashboard page code ```javascript import { serviceOptionsAndVariants } from 'wix-bookings.v2'; async function createServiceOptionsAndVariants(serviceOptionsAndVariants) { try { const result = await serviceOptionsAndVariants.createServiceOptionsAndVariants(serviceOptionsAndVariants); return result; } catch (error) { console.error(error); // Handle the error } } ``` ## createServiceOptionsAndVariants example for exporting from backend code ```javascript import { serviceOptionsAndVariants } from 'wix-bookings.v2'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; const elevatedCreateServiceOptionsAndVariants = elevate(serviceOptionsAndVariants.createServiceOptionsAndVariants); export const createServiceOptionsAndVariants = webMethod( Permissions.Anyone, async (serviceOptionsAndVariants) => { try { const result = await elevatedCreateServiceOptionsAndVariants(serviceOptionsAndVariants); return result; } catch (error) { console.error(error); // Handle the error } } ); ``` ---