Introduction

The Availability Exceptions API allows you to create and manage availability exceptions for restaurant operations. Availability exceptions are time periods during which the restaurant's Wix site can’t fulfill orders for the operation. An availability exception can block all fulfillment methods during the time period, or only specific fulfillment methods.

For example, you could use availability exceptions to:

  • Offer pickup only on Valentine's Day, by closing all delivery fulfillment methods on that day.
  • Close early on Wednesday, by closing all fulfillment methods after midday that day.
  • Close a restaurant over the summer by blocking all fulfillment methods for that date range.

With the Availability Exceptions API, you can create and manage availability exceptions.

Before you begin

It’s important to note the following points before starting to code:

  • In order to use this API, the Wix user must install the Wix Restaurants Orders (New) app.
  • Each availability exception object requires the operationID of a restaurant's operation.

Terminology

  • Operation: A distinct service that a restaurant offers. 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.
  • Fulfillment method: A method by which a restaurant can serve its customers their orders.
Did this help?

Availability Exceptions: Supported Filters and Sorting

The following table shows field support for filters and sorting for the availability exceptions object:

FieldSupported FiltersSortable
id$eq, $ne, $in, $nin, $startsWithSortable
createdDate$eq, $ne, $in, $nin, $startsWith, $lt, $lte, $gt, $gteSortable
updatedDate$eq, $ne, $in, $nin, $startsWith, $lt, $lte, $gt, $gteSortable
startTime$eq, $ne, $in, $nin, $startsWith, $lt, $lte, $gt, $gteSortable
endTime$eq, $ne, $in, $nin, $startsWith, $lt, $lte, $gt, $gteSortable
available$eq, $ne, $in, $nin
name$eq, $ne, $in, $nin, $startsWithSortable
affectedFulfillmentMethods.affectedMethods$eq, $ne, $in, min, $startsWith

Related content: API Query Language, Query Availability Exceptions

Did this help?

Availability Exception Object


Properties
idstringRead-onlyformat GUID

Availability exception ID.


revisionintegerRead-onlyformat int64

Revision number, which increments by 1 each time the availability exception is updated. To prevent conflicting changes, the current revision must be specified when updating the availability exception.


createdDatestringRead-onlyformat date-time

Date and time the availability exception was created in ISO-8601 format.


updatedDatestringRead-onlyformat date-time

Date and time the availability exception was last updated in ISO-8601 format.


startTimestringformat date-time

The start time of the availability exception in ISO-8601 format.


endTimestringformat date-time

The end time of the availability exception in ISO-8601 format.


availablebooleanRead-only

Whether the exception makes the [start_time, end_time] range available. If true, the exception makes the restaurant available for online ordering during the time range. If false, the exception makes the restaurant unavailable for ordering during the time range. Currently, only false is supported.


namestringmaxLength 500

Exception name.


affectedFulfillmentMethodsAffectedFulfillmentMethods

Fulfillment methods for which this exception applies.


operationIdstringformat GUID

ID of the restaurant operation this exception is associated with. (See the Restaurants Operations API for more information.)


extendedFieldsExtendedFields

Extended fields.

AvailabilityException
JSON
{ "availabilityException": { "id": "63eb0bf7-96ea-4034-822b-7dd9a24197e9", "revision": "1", "createdDate": "2024-07-09T10:17:08.865Z", "updatedDate": "2024-07-09T10:17:08.865Z", "startTime": "2024-07-08T21:00:00.587Z", "endTime": "2024-07-09T20:59:59.587Z", "available": false, "name": "Passover", "affectedFulfillmentMethods": { "affectedMethods": "ALL_FULFILLMENT_METHODS" }, "operationId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0" } }
Did this help?

POST

Create Availability Exception


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 availability exception.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions

Body Params
availabilityExceptionAvailabilityExceptionRequired

Availability exception details.

Response Object
availabilityExceptionAvailabilityException

The created availability exception.

Create an availability exception
Request
cURL
curl -X POST \ 'https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \ --data-binary '{ "availabilityException": { "available": false, "name": "Passover", "affectedFulfillmentMethods": { "affectedMethods": "ALL_FULFILLMENT_METHODS" }, "operationId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0", }'
Response
JSON
{ "availabilityException": { "id": "63eb0bf7-96ea-4034-822b-7dd9a24197e9", "revision": "1", "createdDate": "2024-07-09T10:17:08.865Z", "updatedDate": "2024-07-09T10:17:08.865Z", "startTime": "2024-07-08T21:00:00.587Z", "endTime": "2024-07-09T20:59:59.587Z", "available": false, "name": "Passover", "affectedFulfillmentMethods": { "affectedMethods": "ALL_FULFILLMENT_METHODS" }, "operationId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0" } }
Event TriggersThis method triggers the following events:
Did this help?

GET

Get Availability Exception


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 availability exception.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/{availabilityExceptionId}

Path Params
availabilityExceptionIdstringRequired

ID of the availability exception to retrieve.

Response Object
availabilityExceptionAvailabilityException

The requested availability exception.

Retrieve an availability exception
Request
cURL
curl -X GET https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/48605ac5-53fc-49b4-96b2-87f7636f5ce0 \ -H 'Authorization: <AUTH>'
Response
JSON
{ "availabilityException": { "id": "63eb0bf7-96ea-4034-822b-7dd9a24197e9", "revision": "1", "createdDate": "2024-07-09T10:17:08.865Z", "updatedDate": "2024-07-09T10:17:08.865Z", "startTime": "2024-07-08T21:00:00.587Z", "endTime": "2024-07-09T20:59:59.587Z", "available": false, "name": "Passover", "affectedFulfillmentMethods": { "affectedMethods": "ALL_FULFILLMENT_METHODS" }, "operationId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0" } }
Did this help?

DELETE

Delete Availability Exception


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 availability exception.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
DELETE
https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/{availabilityExceptionId}

Path Params
availabilityExceptionIdstringRequired

ID of the availability exception to delete.

Response Object
Returns an empty object.
Delete an availability exception
Request
cURL
curl -X DELETE https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/43efeb0d-9484-498e-a37d-b9b38bbd65c5 \ -H 'Authorization: <AUTH>'
Response
JSON
{}
Event TriggersThis method triggers the following events:
Did this help?

PATCH

Update Availability Exception


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 availability exception.

Each time the availability exception is updated, revision increments by 1. The current revision must be passed when updating the availability exception. This ensures you're working with the latest availability exception and prevents unintended overwrites.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/{availabilityException.id}

Path Params
availabilityException.idstringRequired

Availability exception ID.

Body Params
availabilityExceptionAvailabilityExceptionRequired

Availability exception to update.

Response Object
availabilityExceptionAvailabilityException

Updated availability exception.

Update an availability exception
Request
cURL
curl -X PATCH https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/48605ac5-53fc-49b4-96b2-87f7636f5ce0 \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "availabilityException": { "id": "63eb0bf7-96ea-4034-822b-7dd9a24197e9", "revision": "1", "startTime": "2024-07-08T21:00:00.587Z", "endTime": "2024-07-09T20:59:59.587Z", "available": false, "name": "Passover", "affectedFulfillmentMethods": { "affectedMethods": "ALL_FULFILLMENT_METHODS" }, "operationId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0", } }'
Response
JSON
"availabilityException": { "id": "63eb0bf7-96ea-4034-822b-7dd9a24197e9", "revision": "2", "createdDate": "2024-07-09T10:17:08.865Z", "updatedDate": "2024-07-09T10:17:08.865Z", "startTime": "2024-07-08T21:00:00.587Z", "endTime": "2024-07-09T20:59:59.587Z", "available": false, "name": "Passover", "affectedFulfillmentMethods": { "affectedMethods": "ALL_FULFILLMENT_METHODS" }, "operationId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0", } }
Event TriggersThis method triggers the following events:
Did this help?

POST

Query Availability Exceptions


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 availability exceptions given the specified paging, filtering, and sorting. Up to 100 availability exceptions can be returned per request.

For a detailed list of supported operations, see the Supported Filters and Sorting article. To learn how to query availability exceptions, see API Query Language.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/query

Body Params
queryQuery

WQL expression.

Response Object
availabilityExceptionsArray <AvailabilityException>

List of availability exceptions.


pagingMetadataPagingMetadata

Paging metadata

Query availability exceptions
Request
cURL
curl -X POST https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/query \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-raw '{ "query": { "sort": [], "filter": { "name": { "$startsWith": "ASAP" } } } }'
Response
JSON
{ "operations": [ { "id": "63eb0bf7-96ea-4034-822b-7dd9a24197e9", "revision": "1", "createdDate": "2024-07-09T10:17:08.865Z", "updatedDate": "2024-07-09T10:17:08.865Z", "startTime": "2024-07-08T21:00:00.587Z", "endTime": "2024-07-09T20:59:59.587Z", "available": false, "name": "Passover", "affectedFulfillmentMethods": { "affectedMethods": "ALL_FULFILLMENT_METHODS" }, "operationId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0" } ] }
Did this help?

Availability Exception Created


Developer Preview

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 availability exception is created.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.v1.availability_exception.


slugstring

Event name. Expected created.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


createdEventCreatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.restaurants.v1.availability_exception_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 } } }

AvailabilityExceptionCreated
JSON
{ "id": "a902c990-8379-45e2-8613-d149d3176c37", "entityFqdn": "wix.restaurants.v1.availability_exception", "slug": "created", "entityId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0", "createdEvent": { "entity": { "id": "63eb0bf7-96ea-4034-822b-7dd9a24197e9", "revision": "1", "createdDate": "2024-07-09T10:17:08.865Z", "updatedDate": "2024-07-09T10:17:08.865Z", "startTime": "2024-07-08T21:00:00.587Z", "endTime": "2024-07-09T20:59:59.587Z", "available": false, "name": "Passover", "affectedFulfillmentMethods": { "affectedMethods": "ALL_FULFILLMENT_METHODS" }, "operationId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0" } }, "eventTime": "2024-03-17T13:05:46.342903320Z", "triggeredByAnonymizeRequest": false, "originatedFrom": "clone", "entityEventSequence": "1" }
Did this help?

Availability Exception Deleted


Developer Preview

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 availability exception is deleted.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.v1.availability_exception.


slugstring

Event name. Expected deleted.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


deletedEventstruct

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.restaurants.v1.availability_exception_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 } } }

AvailabilityExceptionDeleted
JSON
{ "id": "5b159c6f-2bab-473b-b4cd-f41e48cf14c2", "entityFqdn": "wix.restaurants.v1.availability_exception", "slug": "deleted", "entityId": "76b19c05-58a6-45f2-ad8c-b464858e3911", "deletedEvent": { "movedToTrash": true }, "eventTime": "2024-01-28T13:34:01.436918456Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "3" }
Did this help?

Availability Exception Updated


Developer Preview

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 availability exception is updated.

Permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.v1.availability_exception.


slugstring

Event name. Expected updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


updatedEventUpdatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.restaurants.v1.availability_exception_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 } } }

AvailabilityExceptionUpdated
JSON
{ "id": "bd299c88-f4a7-4930-beec-8cc168e374dc", "entityFqdn": "wix.restaurants.v1.availability_exception", "slug": "updated", "entityId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0", "updatedEvent": { "currentEntity": { "id": "63eb0bf7-96ea-4034-822b-7dd9a24197e9", "revision": "1", "createdDate": "2024-07-09T10:17:08.865Z", "updatedDate": "2024-07-09T10:17:08.865Z", "startTime": "2024-07-08T21:00:00.587Z", "endTime": "2024-07-09T20:59:59.587Z", "available": false, "name": "Passover", "affectedFulfillmentMethods": { "affectedMethods": "ALL_FULFILLMENT_METHODS" }, "operationId": "48605ac5-53fc-49b4-96b2-87f7636f5ce0" } }, "eventTime": "2024-03-17T13:05:51.620048116Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "2" }
Did this help?