import { RequestOptionsFactory } from '@wix/sdk-types'; /** * Creates a `serviceOptionsAndVariants` object and for a service. * * * ## Calculate variants * * Before creating a `serviceOptionsAndVariants` object, you need to * anticipate and manually define all its variants, since Wix Bookings doesn't * automatically calculate them. For the actual * Create Service Options And Variants* call, specify both the `options` and * `variants` arrays. * * ## Limitations * * Wix Bookings allows you to connect only a single `serviceOptionsAndVariants` * object to a service. *Create Service Options And Variants* fails, if the * service already has a connected `serviceOptionsAndVariants` object. * * Currently, you can include only a single option per * `serviceOptionsAndVariants` object. Taken together, this means that services * are limited to a single option. * * ## Option ID * * When creating a`serviceOptionsAndVariants` object, you must specify an ID in * [UUID format](https://en.wikipedia.org/wiki/Universally_unique_identifier) * for its only option. You must reference this option ID for each variant as * `variants.values.choices.optionId`. * * ## Staff member option * * To creating an option based on the *staff member* * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/introduction)) * providing the service, you need to specify `STAFF_MEMBER` as `options.values.type`. * Also, specify all staff member IDs as `variants.values.choices.staffMemberId`. * You could follow this *sample flow* * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/sample-flows#create-staff-member-based-service-variants) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/sample-flows#create-staff-member-based-service-variants)). * * ## Custom option * * To create an option based on a custom parameter, specify `CUSTOM` as * `options.values.type`. Provide descriptive names for all custom choices as * `variants.values.choices.custom`. These names are displayed to customers * during the book flow. You could follow this *sample flow* * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/sample-flows#create-service-variants-based-on-the-booked-equipment) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/sample-flows#create-service-variants-based-on-the-booked-equipment)). * * ## Duration option * * To create an option based on appointment duration, specify `DURATION` as * `options.values.type` and set a descriptive name in `options.values.durationData.name`. * Also, indicate the appointment length in `minutes` and provide a descriptive * `name` for each duration choice in `variants.values.choices.duration`. */ export declare function createServiceOptionsAndVariants(payload: object): RequestOptionsFactory; /** * Clones a `serviceOptionsAndVariants` object and connects it to a *service* * ([SDK](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction) | [REST](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction)). * * * The call fails if the service already has a connected * `serviceOptionsAndVariants` object. * * The cloned `serviceOptionsAndVariants` object gets a new, unique option ID. * The option ID of the existing `serviceOptionsAndVariants` object isn't reused. * * For example, you may call this method after *cloning a service* * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/clone-service) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/clone-service)). */ export declare function cloneServiceOptionsAndVariants(payload: object): RequestOptionsFactory; /** Retrieves a `serviceOptionsAndVariants` object by its ID. */ export declare function getServiceOptionsAndVariants(payload: object): RequestOptionsFactory; /** * Retrieves a `serviceOptionsAndVariants` object by *service ID* * ([SDK](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction) | [REST](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction)). */ export declare function getServiceOptionsAndVariantsByServiceId(payload: object): RequestOptionsFactory; /** * Updates a `serviceOptionsAndVariants` object. * * * Currently, only a single option is supported per `serviceOptionsAndVariants` object. * * If you want to update `variants`, you must pass the entire list of supported * variants, not only newly added variants. * * If you want to update `options`, you must pass the entire list of supported * options, not only newly added options. */ export declare function updateServiceOptionsAndVariants(payload: object): RequestOptionsFactory; /** * Deletes a `serviceOptionsAndVariants` object. * * * Because each service can be connected to only a single `serviceOptionsAndVariants` * object, the service doesn't support *varied pricing* * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/about-service-payments) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/about-service-payments#service-rates)) * after deleting a `serviceOptionsAndVariants` object. Instead, Wix Bookings * uses its standard price calculation. */ export declare function deleteServiceOptionsAndVariants(payload: object): RequestOptionsFactory; /** Creates a query to retrieve a list of `serviceOptionsAndVariants` objects.\n\nThe `queryServiceOptionsAndVariants()` function builds a query to retrieve a list of `serviceOptionsAndVariants` objects and returns a `ServiceOptionsAndVariantsQueryBuilder` object.\n\nThe returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/service-options-and-variants-list-query-builder/find) function.\n\nYou can refine the query by chaining `ServiceOptionsAndVariantsQueryBuilder` functions onto the query. `ServiceOptionsAndVariantsQueryBuilder` functions enable you to sort, filter, and control the results that `queryServiceOptionsAndVariants()` returns.\n\n`queryServiceOptionsAndVariants()` runs with the following `ServiceOptionsAndVariantsQueryBuilder` default that you can override:\n\n+ `limit` is `50`.\n+ Sorted by `id` in ascending order.\n\nThe functions that are chained to `queryServiceOptionsAndVariants()` are applied in the order they are called. For example, if you apply `ascending("options.values.type")` and then `ascending("variants.values.price")`, the results are sorted first by the `"type"`, and then, if there are multiple results with the same `"type"`, the items are sorted by `"price"`.\n\nThe following `ServiceOptionsAndVariantsQueryBuilder` functions are supported for the `queryServiceOptionsAndVariants()` function. For a full description of the `serviceOptionsAndVariants` object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/service-options-and-variants-list-query-result/items) property in `ServiceOptionsAndVariantsQueryResult`. */ export declare function queryServiceOptionsAndVariants(payload: object): RequestOptionsFactory;