Analytics
Documents two REST endpoints for querying restaurant and chain order statistics with grouping, filtering, and authentication.
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
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:
| name | type | required | value |
|---|---|---|---|
metric | String | yes | price |
group_by | String | yes | day, week, month, year, lifetime, hourOfWeek, monthOfYear |
time_zone | String | yes | a valid timezone id, e.g. America/New_York |
since | Long | yes | timestamp, inclusive (number of milliseconds since January 1, 1970, 00:00:00 UTC) |
until | Long | yes | timestamp, exclusive (see since) |
sources | String | no | comma separated list of order sources |
platforms | String | no | comma separated list of order platforms |
statuses | String | no | comma 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_by | group id |
|---|---|
| day, week, month, year | start time in YYYY-MM-DD format |
| hourOfWeek | 0 (Sunday 00:00-01:00) to 167 (Saturday 23:00-24:00) |
| monthOfYear | 1 (January) to 12 (December) |
| lifetime | N/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
someRestaurantIdwith your actual restaurant ID - Replace
someAccessTokenwith a valid manager-level access token - Replace
America/New_Yorkwith 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
ArbitragePro Configuration Guide: Complete Setup and Deployment
Guides you through installing, configuring, and deploying a multi-chain Rust arbitrage trading bot across EVM and Solana networks.
Mkan MVP Production Checklist
Lists over 200 tasks for launching a property rental MVP, organized by priority and timeline.
Analytics Pipeline
Documents an analytics pipeline using OpenSearch, OpenSearch Dashboards, and Nginx routing for a multi-tenant security platform.
VeeFore - Complete Project Documentation
Documents the full architecture, API, deployment, and configuration for a multi-platform social media management app with AI tools.