Setup

To use the Operations API, install the @wix/restaurants package using npm or Yarn:

Copy
1
npm install @wix/restaurants

or

Copy
1
yarn add @wix/restaurants

Then import { operations } from @wix/restaurants:

Copy
1
import { operations } from '@wix/restaurants'
Was this helpful?
Yes
No

createOperation( )

Developer Preview

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.

Copy
function createOperation(operation: Operation): Promise<Operation>
Method Parameters
operationOperationRequired

Operation to create.

Returns
Return Type:Promise<Operation>
Was this helpful?
Yes
No

deleteOperation( )

Developer Preview

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.

Copy
function deleteOperation(operationId: string): Promise<void>
Method Parameters
operationIdstringRequired

ID of the operation to delete.

Was this helpful?
Yes
No

getOperation( )

Developer Preview

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.

Copy
function getOperation(operationId: string): Promise<Operation>
Method Parameters
operationIdstringRequired

ID of the operation to retrieve.

Returns
Return Type:Promise<Operation>
Was this helpful?
Yes
No

listOperations( )

Developer Preview

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.

Copy
function listOperations(): Promise<ListOperationsResponse>
Request
This method does not take any parameters
Returns
Return Type:Promise<ListOperationsResponse>
Was this helpful?
Yes
No

queryOperation( )

Developer Preview

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.

PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),exists(),in(),hasSome(),startsWith(),ascending(),descending()
_createdDateeq(),ne(),exists(),in(),hasSome(),lt(),le(),gt(),ge(),ascending(),descending()
_updatedDateeq(),ne(),exists(),in(),hasSome(),lt(),le(),gt(),ge(),ascending(),descending()
nameeq(),ne(),exists(),in(),hasSome(),startsWith(),ascending(),descending()
defaulteq(),ne(),exists(),in(),hasSome(),ascending(),descending()
fulfillmentIdseq(),ne(),exists(),in(),hasSome(),hasAll(),ascending(),descending()
onlineOrderingStatuseq(),ne(),exists(),in(),hasSome(),ascending(),descending()
serviceFeeRuleIdseq(),ne(),exists(),in(),hasSome(),hasAll(),ascending(),descending()
defaultFulfillmentTypeeq(),ne(),exists(),in(),hasSome(),ascending(),descending()
Copy
function queryOperation(): OperationsQueryBuilder
Request
This method does not take any parameters
Returns
Was this helpful?
Yes
No

updateOperation( )

Developer Preview

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.

Copy
function updateOperation(_id: string, operation: UpdateOperation): Promise<Operation>
Method Parameters
_idstringRequired

Operation ID.


operationUpdateOperationRequired
Returns
Return Type:Promise<Operation>
Was this helpful?
Yes
No