Introduction
The Fulfillment Methods API allows you to create, retrieve, and manage fulfillment methods for restaurants.
With the Fulfillment Methods API, you can:
- Create and manage fulfillment methods.
- Get information about existing fulfillment methods.
- Retrieve fulfillment methods that are available for a given address.
Before you begin
It’s important to note the following points before starting to code:
- The site owner must install the Wix Restaurants Orders (New) app.
Use Cases
Allow a restaurant owner to manage their site's fulfillment methods through an external app.
Terminology
- Fulfillment method: A method by which a restaurant can serve its customers their orders.
- Pickup fulfillment method: A type of fulfillment method in which the customer picks up the order from the restaurant.
- Delivery fulfillment method: A type of fulfillment method in which the restaurant, or someone on behalf of the restaurant, delivers the order to the customer.
Sample Flows
This article shares a possible use case your app could support, along with sample flows that could support that use case. This can be a helpful jumping-off point as you plan your app's implementation.
Allow a restaurant owner to manage their site's fulfillment methods through an external app
A restaurant owner wants to manage its fulfillment method availability through an external app. Any changes made on the app must be synced to their Wix site and vice versa.
Prerequisites
The site owner must do the following:
- Install the Wix Restaurants Orders (New) app.
- Configure the fulfillment methods for the 3rd-party delivery providers.
Flows
The following flows require a mapping from the fulfillment methods on Wix to the fulfillment methods in the external app. Create this mapping and store it on your app's server. According to this mapping, you can sync the data between the app and the site using webhooks and API calls.
>Note: Make sure to ignore webhooks resulting from calls you have triggered so that you don't create an endless loop of updates.
After creating the mapping, you can follow these two flows to create the two-way sync:
Flow 1: Synchronizing to the external system
- Sign up to the following fulfillment method webhooks to receive notifications about any changes to fulfillment methods on the Wix site. The webhooks are:
- When one of the webhooks is triggered, update the corresponding fulfillment method in the external app according to the mapping.
- Update the mapping to reflect any new or deleted fulfillment methods.
Flow 2: Synchronizing to Wix
- When a change is made to any of the fulfillment methods in the external app, find the
id
of the corresponding fulfillment method in Wix according to the mapping. - If the change is an update, use the
id
from step 1 to get the current revision of the corresponding fulfillment method object using Get Fulfillment Method. This is required when calling the Update fulfillment method endpoint on Wix. - Using the
id
from step 1, call the appropriate endpoint in the Fulfillment Methods API to update the information in Wix. The endpoints are: - Update the mapping to reflect any new or deleted fulfillment methods.
Fulfillment Methods: Supported Filters and Sorting
The following table shows field support for filters and sorting for the Fulfillment Methods object:
Field | Supported Filters | Sortable |
---|---|---|
id | $eq , $ne , $in , $nin , $startsWith | Sortable |
created_date | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
updated_date | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
type | $eq , $ne , $in , min , $startsWith | |
minOrderPrice | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
name | $eq , $ne , $in , min , $startsWith | Sortable |
enabled | $eq , $ne , $in , $nin | |
fee | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
Related content: API Query Language, Query Fulfillment Methods
A Fulfillment Method represents a way in which a restaurant can provide orders to its customers.
ONE OF:
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.
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.
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.
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.
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.
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 fulfillment methods given the provided paging, filtering, and sorting. Up to 100 fulfillment methods can be returned per request.
For a detailed list of supported operations, see the Supported Filters and Sorting article. To learn how to query reservations, see API Query Language.
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.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when a fulfillment method is created.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when a fulfillment method is updated.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when a fulfillment method is deleted.