The following table shows field support for filters and sorting for the operations object:
Field | Supported Filters | Sortable |
---|---|---|
id | $eq , $ne , $in , $nin , $startsWith | Sortable |
createdDate | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
updatedDate | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
name | $eq , $ne , $in , $nin , $startsWith | Sortable |
enabled | $eq , $ne , $in , $nin | |
fulfillmentIds | $isEmpty , $hasAll , $hasSome | |
serviceFeeRuleIds | $isEmpty , $hasAll , $hasSome | |
defaultFulfillmentType | $eq , $ne , $in , $nin , $startsWith | |
onlineOrderingStatus | $eq , $ne , $in , $nin , $startsWith |
Related content: API Query Language, Query Rules
The Operations API allows you to create and manage operations at restaurants. An operation refers to different services a restaurant may offer. For example, a restaurant may offer a takeaway operation and a catering operation, where each one would work with different time frames, availabilities, and fees.
With the Operations API, you can:
This article shares an example flow that could support a use case for the Operations API.
You are building an app that manages a restaurant's online orders for their catering service.
You can create a new operation to define fulfillment and scheduling rules.
Use Create Operation to establish your operation.
Here you can define scheduling rules for the operation. For example:
The JSON for the body of your Create Operation request will look like this:
{
"name": "Online Ordering",
"enabled": true,
"profile_id": "825065c1-7512-4735-b5df-62bba3070a2e",
"default": false,
"onlineOrderingStatus": "ENABLED",
"orderScheduling": {
"type": "PREORDER",
"preorderOptions": {
"method": {
"type": "TIME_BOUNDED",
"timeBoundedOptions": {
"minTimeInAdvance": {
"timeUnit": "DAYS",
"duration": 3
},
"maxTimeInAdvance": {
"timeUnit": "DAYS",
"duration": 14
}
}
},
"fulfillmentTimesDisplay": {
"type": "TIME_WINDOWS",
"timeWindowsOptions": {
"timeUnit": "HOURS",
"duration": 2
}
}
}
}
}
Use the Fulfillment Methods API to define the restaurant's fulfillment methods.
Use Update Operation to add the fulfillment methods' IDs to your operation. You will need your operation's ID, retrieve it using List Operations.
Before the restaurant starts selling, ensure your operation is enabled and that online ordering status is set to ENABLED
.
Your operation is ready, and the restaurant can start taking online catering orders.
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.
Operation ID.
Revision number. Increments by 1 each time the operation is updated.
To prevent conflicting changes,
the existing revision
must be passed when updating an operation.
Date and time the operation was created.
Date and time the operation was updated.
Operation name.
Whether the operation is the default operation.
Default: false
.
IDs of the fulfillment methods associated with the operation.
Online ordering status of the operation.
IDs of the service fee rules associated with the operation.
Default fulfillment type of the operation.
Information about when an order can be placed for.
Options for online ordering status. Required when onlineOrderingStatus
is PAUSED_UNTIL
.
{
"operation": {
"id": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"revision": "5",
"createdDate": "2023-11-27T06:51:54.146Z",
"updatedDate": "2023-12-09T18:43:38.818Z",
"name": "Preorder operation",
"enabled": true,
"orderScheduling": {
"type": "PREORDER",
"preorderOptions": {
"method": {
"type": "TIME_BOUNDED",
"timeBoundedOptions": {
"minTimeInAdvance": {
"timeUnit": "DAYS",
"duration": 3
},
"maxTimeInAdvance": {
"timeUnit": "DAYS",
"duration": 7
}
}
},
"fulfillmentTimesDisplay": {
"type": "TIME_WINDOWS",
"timeWindowsOptions": {
"timeUnit": "HOURS",
"duration": 2
}
}
}
},
"profileId": "ad6994d5-a1c5-476d-b39f-c78d3a5444cb",
"default": true,
"fulfillmentIds": [
"12590791-d0d9-418f-a226-a7dcfd37b507",
"71831b22-a043-4998-a10d-01bf9f2472f2",
"642dd960-ab45-4eac-ab64-de0ad2215fe0",
"32e82c15-f518-44e3-800f-406f13f9bb2e"
],
"serviceFeeRuleIds": [],
"onlineOrderingStatus": "ENABLED"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of operations. The result will be sorted by created date in ascending order.
Retrieved operations.
curl -X GET https://www.wixapis.com/restaurants-operations/v1/operations \
-H 'Authorization: <AUTH>'
{
"operations": [
{
"id": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"revision": "4",
"createdDate": "2023-11-27T06:51:54.146Z",
"updatedDate": "2023-12-03T13:18:04.382Z",
"name": "Asap operation",
"enabled": true,
"orderScheduling": {
"type": "ASAP",
"asapOptions": {
"preparationTime": {
"type": "MAX_TIME",
"maxTimeOptions": {
"timeUnit": "MINUTES",
"duration": 30
}
},
"asapFutureHandlingType": "BUSINESS_DAYS_AHEAD_HANDLING",
"businessDaysAheadHandlingOptions": {
"daysCount": 0
}
}
},
"profileId": "ad6994d5-a1c5-476d-b39f-c78d3a5444cb",
"default": true,
"fulfillmentIds": [
"12590791-d0d9-418f-a226-a7dcfd37b507",
"71831b22-a043-4998-a10d-01bf9f2472f2",
"642dd960-ab45-4eac-ab64-de0ad2215fe0",
"32e82c15-f518-44e3-800f-406f13f9bb2e"
],
"serviceFeeRuleIds": [],
"onlineOrderingStatus": "ENABLED"
}
]
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a new operation.
You can only call this method when authenticated as a Wix app or Wix user identity.
Operation to create.
Created operation.
curl -X POST https://www.wixapis.com/restaurants-operations/v1/operations \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
--data-raw '{
"operation": {
"serviceFeeRuleIds": [],
"fulfillmentIds": [
"19c8f17a-b9fc-4df0-a0a9-03d44f059496"
],
"name": "Some operation name",
"enabled": true,
"orderScheduling": {
"type": "ASAP",
"asapOptions": {
"preparationTime": {
"type": "MAX_TIME",
"maxTimeOptions": {
"timeUnit": "MINUTES",
"duration": 30
}
},
"asapFutureHandlingType": "BUSINESS_DAYS_AHEAD_HANDLING",
"businessDaysAheadHandlingOptions": {
"days_count": 0
}
}
},
"profileId": "811f9ce8-67c6-471b-8226-6d593e7ef79c",
"default": false,
"onlineOrderingStatus": "ENABLED"
}
}'
{
"operation": {
"id": "4aea505e-ac49-4f72-b4f1-b07c064a20cd",
"revision": "1",
"createdDate": "2023-12-10T07:06:39.306Z",
"updatedDate": "2023-12-10T07:06:39.306Z",
"name": "Some operation name",
"enabled": true,
"orderScheduling": {
"type": "ASAP",
"asapOptions": {
"preparationTime": {
"type": "MAX_TIME",
"maxTimeOptions": {
"timeUnit": "MINUTES",
"duration": 30
}
},
"asapFutureHandlingType": "BUSINESS_DAYS_AHEAD_HANDLING",
"businessDaysAheadHandlingOptions": {
"daysCount": 0
}
}
},
"profileId": "811f9ce8-67c6-471b-8226-6d593e7ef79c",
"default": false,
"fulfillmentIds": ["19c8f17a-b9fc-4df0-a0a9-03d44f059496"],
"serviceFeeRuleIds": [],
"onlineOrderingStatus": "ENABLED"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves an operation.
ID of the operation to retrieve.
Retrieved operation.
curl -X GET https://www.wixapis.com/restaurants-operations/v1/operations/48605ac5-53fc-49b4-96b2-87f7636f5ce0 \
-H 'Authorization: <AUTH>'
{
"operation": {
"id": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"revision": "4",
"createdDate": "2023-11-27T06:51:54.146Z",
"updatedDate": "2023-12-03T13:18:04.382Z",
"name": "Asap operation",
"enabled": true,
"orderScheduling": {
"type": "ASAP",
"asapOptions": {
"preparationTime": {
"type": "MAX_TIME",
"maxTimeOptions": {
"timeUnit": "MINUTES",
"duration": 30
}
},
"asapFutureHandlingType": "BUSINESS_DAYS_AHEAD_HANDLING",
"businessDaysAheadHandlingOptions": {
"daysCount": 0
}
}
},
"profileId": "ad6994d5-a1c5-476d-b39f-c78d3a5444cb",
"default": true,
"fulfillmentIds": [
"12590791-d0d9-418f-a226-a7dcfd37b507",
"71831b22-a043-4998-a10d-01bf9f2472f2",
"642dd960-ab45-4eac-ab64-de0ad2215fe0",
"32e82c15-f518-44e3-800f-406f13f9bb2e"
],
"serviceFeeRuleIds": [],
"onlineOrderingStatus": "ENABLED"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Deletes an operation.
You can only call this method when authenticated as a Wix app or Wix user identity.
ID of the operation to delete.
curl -X DELETE https://www.wixapis.com/restaurants-operations/v1/operations/43efeb0d-9484-498e-a37d-b9b38bbd65c5 \
-H 'Authorization: <AUTH>'
{}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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.
You can only call this method when authenticated as a Wix app or Wix user identity.
Operation ID.
Operation to update.
Updated operation.
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: <AUTH>' \
--data-raw '{
"operation": {
"serviceFeeRuleIds": [],
"fulfillmentIds": [],
"id": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"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
}
}
}
}
}'
{
"operation": {
"id": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"revision": "6",
"createdDate": "2023-11-27T06:51:54.146Z",
"updatedDate": "2023-12-10T08:32:03.316Z",
"name": "Asap operation",
"enabled": true,
"orderScheduling": {
"type": "ASAP",
"asapOptions": {
"preparationTime": {
"type": "TIME_RANGE",
"timeRangeOptions": {
"timeUnit": "MINUTES",
"minDuration": 20,
"maxDuration": 40
}
},
"asapFutureHandlingType": "BUSINESS_DAYS_AHEAD_HANDLING",
"businessDaysAheadHandlingOptions": {
"daysCount": 0
}
}
},
"profileId": "ad6994d5-a1c5-476d-b39f-c78d3a5444cb",
"default": true,
"fulfillmentIds": [
"12590791-d0d9-418f-a226-a7dcfd37b507",
"71831b22-a043-4998-a10d-01bf9f2472f2",
"642dd960-ab45-4eac-ab64-de0ad2215fe0",
"32e82c15-f518-44e3-800f-406f13f9bb2e"
],
"serviceFeeRuleIds": [],
"onlineOrderingStatus": "ENABLED"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of operations, given the provided paging, filtering, and sorting.
Query Operation runs with these defaults, which you can override:
paging.limit
is 50
sort.order
is ASC
For field support for filters and sorting, see Operations: Supported Filters and Sorting.
To learn about working with Query endpoints, see API Query Language, Sorting and Paging, and Field Projection.
Query options.
Retrieved operations.
Metadata of the paginated results.
curl -X POST https://www.wixapis.com/restaurants-operations/v1/operations/query \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
--data-raw '{
"query": {
"sort": [],
"filter": {
"name": {
"$startsWith": "ASAP"
}
}
}
}'
{
"operations": [
{
"id": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"revision": "4",
"createdDate": "2023-11-27T06:51:54.146Z",
"updatedDate": "2023-12-03T13:18:04.382Z",
"name": "Asap operation",
"enabled": true,
"orderScheduling": {
"type": "ASAP",
"asapOptions": {
"preparationTime": {
"type": "MAX_TIME",
"maxTimeOptions": {
"timeUnit": "MINUTES",
"duration": 30
}
},
"asapFutureHandlingType": "BUSINESS_DAYS_AHEAD_HANDLING",
"businessDaysAheadHandlingOptions": {
"daysCount": 0
}
}
},
"profileId": "ad6994d5-a1c5-476d-b39f-c78d3a5444cb",
"default": true,
"fulfillmentIds": [
"12590791-d0d9-418f-a226-a7dcfd37b507",
"71831b22-a043-4998-a10d-01bf9f2472f2",
"642dd960-ab45-4eac-ab64-de0ad2215fe0",
"32e82c15-f518-44e3-800f-406f13f9bb2e"
],
"serviceFeeRuleIds": [],
"onlineOrderingStatus": "ENABLED"
}
]
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
For each menus, retrieves the first available time slots for each fulfillment type.
Operation ID. Returned timeslots that are belong to this operation.
Country code.
Subdivision. Usually a state, region, prefecture, or province code, according to ISO 3166-2.
City name.
Zip/postal code.
Free text providing more detailed address info. Usually contains Apt, Suite, and Floor.
Maximum number of items to return in the results.
Pointer to the next or previous page in the list of results.
Pass the relevant cursor token from the pagingMetadata
object in the previous call's response.
Not relevant for the first request.
List of available time slots for each menu. For each menu will be returned the first available time slot for each fulfillment type.
Cursor to next request.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when an operation is created.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.operations.v1.operation
.
Event name. Expected created
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.restaurants.operations.v1.operation_created",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "a902c990-8379-45e2-8613-d149d3176c37",
"entityFqdn": "wix.restaurants.operations.v1.operation",
"slug": "created",
"entityId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"createdEvent": {
"entity": {
"id": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"revision": "1",
"createdDate": "2024-03-17T13:05:46.313Z",
"updatedDate": "2024-03-17T13:05:46.313Z",
"name": "Asap operation",
"enabled": true,
"scheduling": {
"type": "ASAP",
"asapOptions": {
"type": "MAX",
"maxOptions": { "timeUnit": "MINUTES", "duration": 30 },
"allowSameDayPreorder": true,
"asapPreorderType": "BUSINESS_DAYS_PREORDER",
"businessDaysPreorderOptions": { "businessDays": 0 }
}
},
"default": true,
"fulfillmentIds": [
"12590791-d0d9-418f-a226-a7dcfd37b507",
"71831b22-a043-4998-a10d-01bf9f2472f2"
],
"onlineOrderingStatus": "ENABLED",
"serviceFeeRuleIds": [],
"defaultFulfillmentType": "PICKUP",
"availabilityExceptions": [],
"orderScheduling": {
"type": "ASAP",
"asapOptions": {
"preparationTime": {
"type": "MAX_TIME",
"maxTimeOptions": { "timeUnit": "MINUTES", "duration": 30 }
},
"asapFutureHandlingType": "BUSINESS_DAYS_AHEAD_HANDLING",
"businessDaysAheadHandlingOptions": { "daysCount": 0 }
}
}
}
},
"eventTime": "2024-03-17T13:05:46.342903320Z",
"triggeredByAnonymizeRequest": false,
"originatedFrom": "clone",
"entityEventSequence": "1"
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when an operation is deleted.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.operations.v1.operation
.
Event name. Expected deleted
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.restaurants.operations.v1.operation_deleted",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"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"
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when an operation is updated.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.operations.v1.operation
.
Event name. Expected updated
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.restaurants.operations.v1.operation_updated",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "bd299c88-f4a7-4930-beec-8cc168e374dc",
"entityFqdn": "wix.restaurants.operations.v1.operation",
"slug": "updated",
"entityId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"updatedEvent": {
"currentEntity": {
"id": "48605ac5-53fc-49b4-96b2-87f7636f5ce0",
"revision": "2",
"createdDate": "2024-03-17T13:05:46.313Z",
"updatedDate": "2024-03-17T13:05:51.613Z",
"name": "Asap operation",
"enabled": true,
"scheduling": {
"type": "ASAP",
"asapOptions": {
"type": "MAX",
"maxOptions": { "timeUnit": "MINUTES", "duration": 30 },
"allowSameDayPreorder": true,
"asapPreorderType": "BUSINESS_DAYS_PREORDER",
"businessDaysPreorderOptions": { "businessDays": 0 }
}
},
"profileId": "0cc7260b-9373-4a5c-85c2-d64f1b380da7",
"default": true,
"fulfillmentIds": [
"12590791-d0d9-418f-a226-a7dcfd37b507",
"71831b22-a043-4998-a10d-01bf9f2472f2"
],
"onlineOrderingStatus": "ENABLED",
"serviceFeeRuleIds": [],
"defaultFulfillmentType": "PICKUP",
"availabilityExceptions": [],
"orderScheduling": {
"type": "ASAP",
"asapOptions": {
"preparationTime": {
"type": "MAX_TIME",
"maxTimeOptions": { "timeUnit": "MINUTES", "duration": 30 }
},
"asapFutureHandlingType": "BUSINESS_DAYS_AHEAD_HANDLING",
"businessDaysAheadHandlingOptions": { "daysCount": 0 }
}
}
}
},
"eventTime": "2024-03-17T13:05:51.620048116Z",
"triggeredByAnonymizeRequest": false,
"entityEventSequence": "2"
}