> 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
# UpdateOperation
# Package: onlineOrders
# Namespace: OperationsService
# Method link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/update-operation.md
## Permission Scopes:
Manage Restaurants - all permissions: SCOPE.RESTAURANTS.MEGA-SCOPES
## Introduction
Updates an operation.
If you update part of the `orderScheduling` property, the whole object is overwritten,
so you must include the entire object unless you are not updating `orderScheduling` at all.
Each time the operation is updated,
`revision` increments by 1.
The current `revision` must be passed when updating the operation.
This ensures you're working with the latest operation
and prevents unintended overwrites.
---
## REST API
### Schema
```
Method: updateOperation
Description: Updates an operation. If you update part of the `orderScheduling` property, the whole object is overwritten, so you must include the entire object unless you are not updating `orderScheduling` at all.
Each time the operation is updated, `revision` increments by 1. The current `revision` must be passed when updating the operation. This ensures you're working with the latest operation and prevents unintended overwrites.
URL: https://www.wixapis.com/restaurants-operations/v1/operations/{operation.id}
Method: PATCH
# Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
Required parameters: operation, operation.id, operation.revision
Method parameters:
param name: operation | type: Operation | description: An operation is a service a restaurant offers that includes various aspects of its online ordering. You can define default fulfillments, service fees, and scheduling requirements for each operation. | required: true
- name: pausedUntilOptions | type: OnlineOrderingPausedUntilOptions | description: Options for online ordering status. Required when `onlineOrderingStatus` is `PAUSED_UNTIL`.
- name: time | type: string | 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. | required: true
- 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. | required: true
- 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.
- 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: 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.
Return type: UpdateOperationResponse
- name: operation | type: Operation | description: Updated operation.
- ONE-OF:
- name: pausedUntilOptions | type: OnlineOrderingPausedUntilOptions | description: Options for online ordering status. Required when `onlineOrderingStatus` is `PAUSED_UNTIL`.
- name: time | type: string | 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: string | description: Date and time the operation was created.
- name: updatedDate | type: string | 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.
- 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.
```
### Examples
### Update an operation
```curl
curl -X PATCH https://www.wixapis.com/restaurants-operations/v1/operations/48605ac5-53fc-49b4-96b2-87f7636f5ce0 \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: ' \
--data-raw '{
"operation": {
"fulfillmentIds": [],
"revision": "5",
"orderScheduling": {
"type": "ASAP",
"asapOptions": {
"preparationTime": {
"type": "TIME_RANGE",
"timeRangeOptions": {
"timeUnit": "MINUTES",
"minDuration": 20,
"maxDuration": 40
}
},
"asapFutureHandlingType": "BUSINESS_DAYS_AHEAD_HANDLING",
"businessDaysAheadHandlingOptions": {
"daysCount": 0
}
}
}
}
}'
```
---
## JavaScript SDK
### Schema
```
Method: wixClientAdmin.onlineOrders.OperationsService.updateOperation(_id, operation)
Description: Updates an operation. If you update part of the `orderScheduling` property, the whole object is overwritten, so you must include the entire object unless you are not updating `orderScheduling` at all.
Each time the operation is updated, `revision` increments by 1. The current `revision` must be passed when updating the operation. This ensures you're working with the latest operation and prevents unintended overwrites.
# Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
Required parameters: operation, _id, operation.revision
Method parameters:
param name: _id | type: string | description: Operation GUID. | required: true
param name: operation | type: UpdateOperation | description: An operation is a service a restaurant offers that includes various aspects of its online ordering. You can define default fulfillments, service fees, and scheduling requirements for each operation. | required: true
- 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: 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. | required: true
- 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.
- 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: 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.
Return type: PROMISE
- 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.
- 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.
```
### Examples
### updateOperation
```javascript
import { operations } from '@wix/restaurants';
async function updateOperation(_id,operation) {
const response = await operations.updateOperation(_id,operation);
};
```
### updateOperation (with elevated permissions)
```javascript
import { operations } from '@wix/restaurants';
import { auth } from '@wix/essentials';
async function myUpdateOperationMethod(_id,operation) {
const elevatedUpdateOperation = auth.elevate(operations.updateOperation);
const response = await elevatedUpdateOperation(_id,operation);
}
```
### updateOperation (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).
```javascript
import { createClient } from '@wix/sdk';
import { operations } from '@wix/restaurants';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed
const myWixClient = createClient ({
modules: { operations },
// Include the auth strategy and host as relevant
});
async function updateOperation(_id,operation) {
const response = await myWixClient.operations.updateOperation(_id,operation);
};
```
---