> 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: onlineOrders # Namespace: operations # Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/operation-deleted.md ## Introduction Triggered when an operation is deleted. --- ## REST API ### Schema ``` Webhook: Operation Deleted Description: Triggered when an operation is deleted. 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":"5b159c6f-2bab-473b-b4cd-f41e48cf14c2", "entityFqdn":"wix.restaurants.operations.v1.operation", "slug":"deleted", "entityId":"76b19c05-58a6-45f2-ad8c-b464858e3911", "deletedEvent":{ "movedToTrash":true }, "eventTime":"2024-01-28T13:34:01.436918456Z", "triggeredByAnonymizeRequest":false, "entityEventSequence":"3" } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onOperationDeleted Description: Triggered when an operation is deleted. Payload: OperationDeletedEnvelope - name: entity | type: Operation | description: none - ONE-OF: - name: pausedUntilOptions | type: OnlineOrderingPausedUntilOptions | description: Options for online ordering status. Required when `onlineOrderingStatus` is `PAUSED_UNTIL`. - name: time | type: Date | description: Date and time until which online ordering is paused.
Before the specified time, behavior is the same as when `onlineOrderingStatus` is `DISABLED`.
After the specified time, behavior is the same as when `onlineOrderingStatus` is `ENABLED`.
Passing the time does not trigger any changes to value of any properties. - name: _id | type: string | description: Operation GUID. - name: revision | type: string | description: Revision number. Increments by 1 each time the operation is updated. To prevent conflicting changes, the existing `revision` must be specified when updating an operation. - name: _createdDate | type: Date | description: Date and time the operation was created. - name: _updatedDate | type: Date | description: Date and time the operation was updated. - name: name | type: string | description: Operation name. - name: default | type: boolean | description: Whether the operation is the default operation.
Default: `false`. - name: fulfillmentIds | type: array | description: IDs of the fulfillment methods ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/fulfillment-methods/introduction.md) | [REST](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/fulfillment-methods/introduction.md)) associated with the operation. - name: onlineOrderingStatus | type: OnlineOrderingStatusType | description: Online ordering status of the operation.
- enum: - UNDEFINED_ONLINE_ORDERING_STATUS: Online ordering status is not defined. - ENABLED: Operation currently accepts online orders. - DISABLED: Operation currently does not accept online orders. - PAUSED_UNTIL: Operation currently does not accept online orders, but will accept online orders from a specified time and date. When applied, `pausedUntilOptions` is a required field. - name: defaultFulfillmentType | type: FulfillmentType | description: Default fulfillment type of the operation. - enum: - PICKUP: Pickup fulfillment. The customer picks up the order from the restaurant. - DELIVERY: Delivery fulfillment. The restaurant, or a representative, delivers the order to the customer. - name: orderScheduling | type: OrderScheduling | description: Information about when an order can be placed for. - ONE-OF: - name: asapOptions | type: AsapOrderScheduling | description: Options for scheduling. Required if `type` is `ASAP`. - ONE-OF: - name: businessDaysAheadHandlingOptions | type: BusinessDaysAheadHandling | description: Options for future handling. Required when `asapFutureHandlingType` is `BUSINESS_DAYS_AHEAD_HANDLING`. - name: daysCount | type: integer | description: Number of business days ahead for which orders can be scheduled.
Setting the `daysCount` to 0 means that orders can be scheduled until the end of the current business day. - name: preparationTime | type: PreparationTime | description: Amount of time needed to prepare the order.
- When `MAX_TIME`, `maxTimeOptions` is a required field. - When `MAX_RANGE`, `timeRangeOptions` is a required field. - ONE-OF: - name: maxTimeOptions | type: TimeDuration | description: Options for preparation time. Required when `type` is `MAX_TIME`. - name: timeUnit | type: TimeUnit | description: Unit of time for the duration. - enum: - MINUTES: Minutes time unit. - HOURS: Hours time unit. - DAYS: Days time unit. - name: duration | type: integer | description: Duration value. Unit of time specified in `timeUnit`. - name: timeRangeOptions | type: TimeDurationRange | description: Options for preparation time. Required when `type` is `TIME_RANGE`. - name: timeUnit | type: TimeUnit | description: Time unit for the time range. - enum: - MINUTES: Minutes time unit. - HOURS: Hours time unit. - DAYS: Days time unit. - name: minDuration | type: integer | description: Minimum duration value. Unit of time specified in `timeUnit`. - name: maxDuration | type: integer | description: Maximum duration value. Unit of time specified in `timeUnit`. - name: type | type: PreparationTimeType | description: Preparation time type. - enum: MAX_TIME, TIME_RANGE - name: asapFutureHandlingType | type: AsapFutureHandlingType | description: Defines if and how non-immediate orders should be handled.
When this value is `BUSINESS_DAYS_AHEAD_HANDLING`, `businessDaysAheadHandlingOptions` is a required field. - enum: - NO_FUTURE_HANDLING: No future handling. - BUSINESS_DAYS_AHEAD_HANDLING: Allows future orders for up to a specified number of business days ahead. - name: preorderOptions | type: PreorderScheduling | description: Options for scheduling. Required if `type` is `PREORDER`. - name: method | type: PreorderMethod | description: - ONE-OF: - name: timeBoundedOptions | type: TimeBounded | description: Options for the method. Required when `type` is `TIME_BOUNDED`. - name: minTimeInAdvance | type: TimeDuration | description: Minimum time required to schedule the order. - name: maxTimeInAdvance | type: TimeDuration | description: Maximum time allowed to schedule the order. - name: weeklyScheduleOptions | type: WeeklySchedule | description: Options for the method. Required when `type` is `WEEKLY_SCHEDULE`. - name: cutOffTime | type: DayAndTime | description: The weekly schedule cutoff time.
Orders placed before the cutoff time are scheduled for the current week.
Orders placed after the cutoff time are scheduled for the next week. - name: dayOfWeek | type: DayOfWeek | description: Day of the week. - enum: - MON: Monday. - TUE: Tuesday. - WED: Wednesday. - THU: Thursday. - FRI: Friday. - SAT: Saturday. - SUN: Sunday. - name: timeOfDay | type: TimeOfDay | description: Time of the day. - name: hours | type: integer | description: Hours.
Min: `0`.
Max: `23`. - name: minutes | type: integer | description: Minutes.
Min: `0`.
Max: `23`. - name: type | type: MethodType | description: Type of time frame for how long in advance preorders can be made.
- When `TIME_BOUNDED`, `timeBoundedOptions` is a required field. - When `WEEKLY_SCHEDULE`, `weeklyScheduleOptions` is a required field. - enum: - TIME_BOUNDED: Preorder time has a minimum and a maximum. - WEEKLY_SCHEDULE: Preorders have a weekly schedule with a weekly cutoff time. - name: fulfillmentTimesDisplay | type: FulfillmentTimesDisplayConfig | description: Configuration of the fulfillment times.
Currently, only `TIME_WINDOWS` is supported. - ONE-OF: - name: timeWindowsOptions | type: TimeDuration | description: Options for fulfillment time. Required when `fulfillmentTimesType` is `TIME_WINDOWS`. - name: type | type: FulfillmentTimesType | description: Type of the fulfillment times.
When `TIME_WINDOWS`, `timeWindowsOptions` is a required field. - enum: - TIME_WINDOWS: Display fulfillment times as time windows. - name: type | type: SchedulingType | description: Scheduling type.
- When `ASAP`, `asapOptions` is a required field. - When `PREORDER`, `preorderOptions` is a required field. - enum: - ASAP: Orders can be scheduled for the future and to be handled immediately. - PREORDER: Orders can be scheduled only for the future. - name: operationGroupId | type: string | description: GUID of the operation group this operation belongs to. - name: businessLocationId | type: string | description: GUID of the business location ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of this operation. - name: extendedFields | type: ExtendedFields | description: Extended fields. - 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: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of operations. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. - 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 { operations } from '@wix/restaurants'; operations.onOperationDeleted((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { operations } from '@wix/restaurants'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { operations, }, }); wixClient.operations.onOperationDeleted((event) => { // handle your event here }); ``` ---