Back to .md Directory

Analytics

Documents two REST endpoints for querying restaurant and chain order statistics with grouping, filtering, and authentication.

May 2, 2026
0 downloads
2 views
ai
View source

What this file does

Documents two REST endpoints for querying restaurant and chain order statistics with grouping, filtering, and authentication.

When to use it

  • You need to aggregate order totals by day, week, month, year, or hour of week
  • You are building analytics dashboards for Wix Restaurants online ordering
  • You want to filter order stats by source, platform, or status
  • You need to authenticate analytics requests with a Bearer token

Assumes this stack

RESTJSONcURL

Analytics

With the Wix Restaurants Analytics API you can query for stats about your online ordering activities.

Restaurant Orders Stats

Querying for online ordering stats of a specific restaurant can be done using the following endpoint:

GET https://analytics.wixrestaurants.com/v1/restaurants/{restaurant_id}/orders/stats

with the following query parameters:

nametyperequiredvalue
metricStringyesprice
group_byStringyesday, week, month, year, lifetime, hourOfWeek, monthOfYear
time_zoneStringyesa valid timezone id, e.g. America/New_York
sinceLongyestimestamp, inclusive (number of milliseconds since January 1, 1970, 00:00:00 UTC)
untilLongyestimestamp, exclusive (see since)
sourcesStringnocomma separated list of order sources
platformsStringno    comma separated list of order platforms
statusesStringnocomma separated list of order statuses

Successful responses are returned as a JSON object representing an array of aggregated groups including the group id and the count and total of order prices for that group:

{"stats": [{"id": "someGroupId", "count": someCount, "total": someTotal}]}

The group id is derived according to the group_by query parameter as described in the following table:

group_bygroup id
day, week, month, yearstart time in YYYY-MM-DD format
hourOfWeek0 (Sunday 00:00-01:00) to 167 (Saturday 23:00-24:00)
monthOfYear1 (January) to 12 (December)
lifetimeN/A

Unsuccessful responses are returned as a JSON object describing the relevant problem details according to RFC 7807.

Chain Orders Stats

Querying for online ordering stats of a specific chain can be done using the following endpoint:

GET https://analytics.wixrestaurants.com/v1/chains/{chain_id}/orders/stats

with the same query parametres as in Restaurant Orders Stats above.

Successful and unsuccessful responses are also the same.

Permissions

All of the endpoints must receieve a valid access token with manager permissions for chain/restaurant. The access token must be provided inside an 'Authorization' header according to the Bearer standard (see RFC 6750).

A valid Authorization header value example: Bearer <access token with manager permissions for restaurant/chain>

Example

The following cURL command:

curl -X "GET" -H "Authorization: Bearer someAccessToken" "https://analytics.wixrestaurants.com/v1/restaurants/someRestaurantId/orders/stats?metric=price&group_by=day&time_zone=Asia%2FJerusalem&since=1485043200000&until=1485129600000&statuses=accepted,new"

issues a request to retrieve the count of orders with accepted or new status that were made between 22/01/2017 (including) and 23/01/2017 (excluding) from a restaurant with id someRestaurantId and the total sum of their prices grouped by day.

What's inside

2 endpoint descriptions, 2 query parameter tables, 1 response format, 1 group id table, 1 permissions section, 1 cURL example

Change this for your project

  • Replace someRestaurantId with your actual restaurant ID
  • Replace someAccessToken with a valid manager-level access token
  • Replace America/New_York with your timezone ID

Where it goes

Keep it in your repository where the agent or team that needs it will read it.

Worth borrowing

  • Grouping results by time windows (day, week, month, year, hourOfWeek, monthOfYear) is a clean pattern for analytics APIs
  • Using RFC 7807 problem details for error responses provides consistent error handling

Related Documents