Setup
To use the Operations API, install the @wix/restaurants
package using npm or Yarn:
1npm install @wix/restaurants
or
1yarn add @wix/restaurants
Then import { operations }
from @wix/restaurants
:
1import { operations } from '@wix/restaurants'
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.
function createOperation(operation: Operation): Promise<Operation>
Operation to create.
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.
function deleteOperation(operationId: string): Promise<void>
ID of the operation to delete.
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.
function getOperation(operationId: string): Promise<Operation>
ID of the operation to retrieve.
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.
function listOperations(): Promise<ListOperationsResponse>
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
is50
sort.order
isASC
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.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
_id | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
_createdDate | eq() ,ne() ,exists() ,in() ,hasSome() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
_updatedDate | eq() ,ne() ,exists() ,in() ,hasSome() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
name | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
default | eq() ,ne() ,exists() ,in() ,hasSome() ,ascending() ,descending() |
fulfillmentIds | eq() ,ne() ,exists() ,in() ,hasSome() ,hasAll() ,ascending() ,descending() |
onlineOrderingStatus | eq() ,ne() ,exists() ,in() ,hasSome() ,ascending() ,descending() |
serviceFeeRuleIds | eq() ,ne() ,exists() ,in() ,hasSome() ,hasAll() ,ascending() ,descending() |
defaultFulfillmentType | eq() ,ne() ,exists() ,in() ,hasSome() ,ascending() ,descending() |
function queryOperation(): OperationsQueryBuilder
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.
function updateOperation(_id: string, operation: UpdateOperation): Promise<Operation>
Operation ID.