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:
With the Availability Exceptions API, you can create and manage availability exceptions.
It’s important to note the following points before starting to code:
operationID
of a restaurant's operation.The following table shows field support for filters and sorting for the availability exceptions object:
Field | Supported Filters | Sortable |
---|---|---|
id | $eq , $ne , $in , $nin , $startsWith | Sortable |
createdDate | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
updatedDate | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
startTime | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
endTime | $eq , $ne , $in , $nin , $startsWith , $lt , $lte , $gt , $gte | Sortable |
available | $eq , $ne , $in , $nin | |
name | $eq , $ne , $in , $nin , $startsWith | Sortable |
affectedFulfillmentMethods.affectedMethods | $eq , $ne , $in , min , $startsWith |
Related content: API Query Language, Query Availability Exceptions
Availability exception ID.
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.
Date and time the availability exception was created in ISO-8601 format.
Date and time the availability exception was last updated in ISO-8601 format.
The start time of the availability exception in ISO-8601 format.
The end time of the availability exception in ISO-8601 format.
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.
Exception name.
Fulfillment methods for which this exception applies.
ID of the restaurant operation this exception is associated with. (See the Restaurants Operations API for more information.)
Extended fields.
{
"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"
}
}
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.
You can only call this method when authenticated as a Wix app or Wix user identity.
Availability exception details.
The created availability exception.
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",
}'
{
"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"
}
}
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.
You can only call this method when authenticated as a Wix app or Wix user identity.
ID of the availability exception to retrieve.
The requested availability exception.
curl -X GET https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/48605ac5-53fc-49b4-96b2-87f7636f5ce0 \
-H 'Authorization: <AUTH>'
{
"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"
}
}
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.
You can only call this method when authenticated as a Wix app or Wix user identity.
ID of the availability exception to delete.
curl -X DELETE https://www.wixapis.com/restaurants-availability-exceptions/v1/availability-exceptions/43efeb0d-9484-498e-a37d-b9b38bbd65c5 \
-H 'Authorization: <AUTH>'
{}
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.
You can only call this method when authenticated as a Wix app or Wix user identity.
Availability exception ID.
Availability exception to update.
Updated availability exception.
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",
}
}'
"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",
}
}
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.
You can only call this method when authenticated as a Wix app or Wix user identity.
WQL expression.
List of availability exceptions.
Paging metadata
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"
}
}
}
}'
{
"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"
}
]
}
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.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.v1.availability_exception
.
Event name. Expected created
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"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
}
}
}
{
"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"
}
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.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.v1.availability_exception
.
Event name. Expected deleted
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"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
}
}
}
{
"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"
}
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.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.v1.availability_exception
.
Event name. Expected updated
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"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
}
}
}
{
"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"
}