> 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 # Package: services # Namespace: serviceOptionsAndVariants # Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/service-options-and-variants/service-options-and-variants-deleted.md ## Introduction # Webhook Permissions Scopes IDs: Wix Multilingual - Nile Wrapper Domain Events Read: SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ --- ## REST API ### Schema ``` Webhook: Service Options And Variants Deleted Description: Event body: - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events. - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event. - name: slug | type: string | description: Event name. - name: entityId | type: string | description: ID of the entity associated with the event. - name: eventTime | type: string (date-time) | description: Event timestamp. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR. - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. ``` ### Examples ```curl { "id": "32c7dc9e-6866-4ffd-91bc-51ca50c0c91b", "entityFqdn": "wix.bookings.catalog.v1.service_options_and_variants", "slug": "deleted", "entityId": "1597eb06-dc2e-4f69-a73c-df0bcbbf04bd", "deletedEvent": { "movedToTrash": true }, "eventTime": "2022-09-08T10:49:47.623822Z", "triggeredByAnonymizeRequest": false } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onServiceOptionsAndVariantsDeleted Description: Payload: ServiceOptionsAndVariantsDeletedEnvelope - name: entity | type: ServiceOptionsAndVariants | description: none - name: _id | type: string | description: GUID of the `serviceOptionsAndVariants` object. - name: serviceId | type: string | description: GUID of the service related to these options and variants. - name: options | type: ServiceOptions | description: Service options. Note that currently only a single option is supported per service. - name: values | type: array | description: Values of the service options. Max: 1 service option - ONE-OF: - name: customData | type: CustomServiceOption | description: Details about the custom option. Available only for `CUSTOM` options. - name: name | type: string | description: Name of the service option. For example, `Age group`, `Location`, `Equipment`, or `Time`. - name: choices | type: array | description: Available choices for the service option. For example, `child`, `student`, `adult`, and `senior` for a service option named `Age group`. Each value must be unique. The value's case is ignored, meaning `Child` and `child` are considered to be identical. Currently, only a single choice is supported because a service can have only a single option. Max: 1 choice - name: durationData | type: DurationServiceOption | description: - name: name | type: string | description: Optional name of the duration option. For example, `Short Class`, or `Extended Class`. - name: _id | type: string | description: GUID of the service option. - name: type | type: ServiceOptionType | description: Type of the service option. - enum: - UNKNOWN: There is no information about the option type. - CUSTOM: The service option is based on a custom parameter. For example, age group, booked equipment, or appointment timing. - STAFF_MEMBER: It's a [staff member](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/introduction.md) based option. - DURATION: It's a duration-based option. - name: variants | type: ServiceVariants | description: Information about the service's variants. - name: values | type: array | description: Values of the service variants. - name: choices | type: array | description: Choices for the service option. Currently, only a single choice is supported because a service can have only a single option. Max: 1 choice - ONE-OF: - name: custom | type: string | description: Name of the custom choice. - name: staffMemberId | type: string | description: GUID of the [resource](https://dev.wix.com/docs/api-reference/business-solutions/bookings/resources/resources-v2/introduction.md) associated with the [staff member](https://dev.wix.com/docs/api-reference/business-solutions/bookings/staff-members/introduction.md) providing the service. - name: duration | type: Duration | description: Information about the option's duration. - name: minutes | type: integer | description: Duration of the service in minutes. Min: `1` minute Max: `44639` minutes (30 days, 23 hours, and 59 minutes) - name: name | type: string | description: Name of the duration option. Default: Human-readable text of `minutes`. For example, `1 hr 30 min`. - name: optionId | type: string | description: GUID of the service option. - name: price | type: Money | description: Information about the service variant's price. - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative. - name: currency | type: string | description: Currency code. Must be valid ISO 4217 currency code (e.g., USD). - name: formattedValue | type: string | description: Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. - name: minPrice | type: Money | description: Price of the cheapest service variant. - name: maxPrice | type: Money | description: Price of the most expensive service variant. - name: revision | type: string | description: 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. - name: extendedFields | type: ExtendedFields | description: Extensions enabling users to save custom data related to service options and variants. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: metadata | type: EventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them. - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. - name: entityId | type: string | description: GUID of the entity associated with the event. - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR). - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. ``` ### Examples ```javascript import { serviceOptionsAndVariants } from '@wix/bookings'; serviceOptionsAndVariants.onServiceOptionsAndVariantsDeleted((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { serviceOptionsAndVariants } from '@wix/bookings'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { serviceOptionsAndVariants, }, }); wixClient.serviceOptionsAndVariants.onServiceOptionsAndVariantsDeleted((event) => { // handle your event here }); ``` ---