Setup
To use the FulfillmentMethods API, install the @wix/restaurants
package using npm or Yarn:
1npm install @wix/restaurants
or
1yarn add @wix/restaurants
Then import { fulfillmentMethods }
from @wix/restaurants
:
1import { fulfillmentMethods } 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 fulfillment method.
Note: fulfillment_method.availability.time_zone
uses the time zone specified in the language and regions
settings in the dashboard, regardless of the value provided.
function createFulfillmentMethod(fulfillmentMethod: FulfillmentMethod): Promise<FulfillmentMethod>
Fulfillment method 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 a fulfillment method.
function deleteFulfillmentMethod(fulfillmentMethodId: string): Promise<void>
The ID of the fulfillment method 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 a fulfillment method.
function getFulfillmentMethod(fulfillmentMethodId: string): Promise<FulfillmentMethod>
The ID of the fulfillment method 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 up to 100 fulfillment methods available for a given address.
The response will only include:
- Non-delivery fulfillment methods.
- Delivery fulfillment methods that are available to the given address according to their delivery areas.
function listAvailableFulfillmentMethodsForAddress(options: ListAvailableFulfillmentMethodsForAddressOptions): Promise<ListAvailableFulfillmentMethodsForAddressResponse>
Options for listing the available fulfillment methods.
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 up to 100 fulfillment methods.
function listFulfillmentMethods(options: ListFulfillmentMethodsOptions): Promise<ListFulfillmentMethodsResponse>
Options for listing the fulfillment methods.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a query to retrieve a list of fulfillment methods.
The queryFulfillmentMethods()
function builds a query to retrieve a list of reservations and returns a FulfillmentMethodsQueryBuilder
object.
The returned object contains the query definition, which is used to run the query using the find()
function.
You can refine the query by chaining FulfillmentMethodsQueryBuilder
functions onto the query. FulfillmentMethodsQueryBuilder
functions enable you to filter, sort, and control the results that queryFulfillmentMethods()
returns.
The following FulfillmentMethodsQueryBuilder
functions are supported for queryFulfillmentMethods()
. For a full description of the reservation object, see the object returned for the items
property in FulfillmentMethodsQueryResult
.
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() |
type | eq() ,ne() ,exists() ,in() ,hasSome() ,ascending() ,descending() |
name | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
enabled | eq() ,ne() ,exists() ,in() ,hasSome() ,ascending() ,descending() |
fee | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
minOrderPrice | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
function queryFulfillmentMethods(options: QueryFulfillmentMethodsOptions): FulfillmentMethodsQueryBuilder
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Updates a fulfillment method.
Each time the fulfillment method is updated, revision increments by 1. The existing revision must be included when updating the fulfillment method. This ensures you're working with the latest fulfillment method information, and it prevents unintended overwrites.
function updateFulfillmentMethod(_id: string, fulfillmentMethod: UpdateFulfillmentMethod): Promise<FulfillmentMethod>
Fulfillment method ID.
Fulfillment method information to update.