Saltar al contenido

Analytics

Analytics

Pre-aggregated metrics: dashboards, revenue, orders, top menu items, peak hours, ABC menu classification, sales forecasts and period comparisons. All read-only.

Today's dashboard

GET /v1/analytics/dashboard Scope: analytics:read

Today's top-line numbers: orders, revenue, active reservations, new customers.

Request

curl https://api.tablezio.com/v1/analytics/dashboard -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.dashboard", "total_orders": 42, "total_revenue": 132400, "active_reservations": 7, "new_customers": 3 }

Revenue over time

GET /v1/analytics/revenue Scope: analytics:read

Revenue grouped by day, week or month for the given range.

Query parameters

start_datestring (YYYY-MM-DD)Optional

Inclusive lower bound.

end_datestring (YYYY-MM-DD)Optional

Inclusive upper bound.

group_bystringOptional

Default day.

dayweekmonth

Request

curl 'https://api.tablezio.com/v1/analytics/revenue?start_date=2026-05-01&end_date=2026-05-31&group_by=day' -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.revenue", "group_by": "day", "data": [ { "period": "2026-05-01", "revenue": 145200, "order_count": 47, "avg_order_value": 3089 } ] }

Order counts over time

GET /v1/analytics/orders Scope: analytics:read

Order counts grouped by period, broken down by type.

Query parameters

start_datestring (YYYY-MM-DD)Optional

Inclusive lower bound.

end_datestring (YYYY-MM-DD)Optional

Inclusive upper bound.

group_bystringOptional

Default day.

dayweekmonth

Request

curl 'https://api.tablezio.com/v1/analytics/orders?start_date=2026-05-01&end_date=2026-05-31' -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.orders", "group_by": "day", "data": [ { "period": "2026-05-01", "count": 47, "by_type": { "dine_in": 30, "takeout": 12, "delivery": 5 } } ] }

Top menu items

GET /v1/analytics/menu_items Scope: analytics:read

Top 50 items by quantity sold for the period.

Query parameters

start_datestring (YYYY-MM-DD)Optional

Inclusive lower bound.

end_datestring (YYYY-MM-DD)Optional

Inclusive upper bound.

Request

curl 'https://api.tablezio.com/v1/analytics/menu_items?start_date=2026-05-01&end_date=2026-05-31' -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.menu_items", "data": [ { "name": "Classic burger", "total_quantity": 412, "total_revenue": 494400, "order_count": 312 } ] }

Customers report

GET /v1/analytics/customers Scope: analytics:read

New customers in the period plus the top 10 lifetime spenders.

Query parameters

start_datestring (YYYY-MM-DD)Optional

Inclusive lower bound.

end_datestring (YYYY-MM-DD)Optional

Inclusive upper bound.

Request

curl https://api.tablezio.com/v1/analytics/customers -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.customers", "new_customers": 12, "top_customers": [ { "id": "cus_…", "name": "Lucia Martín", "total_visits": 14, "total_spent": 124000, "loyalty_points": 320 } ] }

Reservations by status

GET /v1/analytics/reservations Scope: analytics:read

Counts and average party size grouped by status.

Query parameters

start_datestring (YYYY-MM-DD)Optional

Inclusive lower bound.

end_datestring (YYYY-MM-DD)Optional

Inclusive upper bound.

Request

curl https://api.tablezio.com/v1/analytics/reservations -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.reservations", "by_status": [ { "status": "completed", "count": 80, "avg_party_size": 3.4 } ] }

Inventory report

GET /v1/analytics/inventory Scope: analytics:read

Low-stock items plus the total inventory value.

Request

curl https://api.tablezio.com/v1/analytics/inventory -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.inventory", "low_stock_items": [], "total_value": 245000, "item_count": 42 }

Labor report

GET /v1/analytics/labor Scope: analytics:read

Total hours and shifts per staff member.

Query parameters

start_datestring (YYYY-MM-DD)Optional

Inclusive lower bound.

end_datestring (YYYY-MM-DD)Optional

Inclusive upper bound.

Request

curl https://api.tablezio.com/v1/analytics/labor -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.labor", "data": [ { "user": "usr_…", "user_name": "Marc Solé", "total_hours": 38.5, "shifts": 5 } ] }

Peak hours heatmap

GET /v1/analytics/peak_hours Scope: analytics:read

Order count + revenue across a 7×24 day-of-week × hour matrix for the period.

Query parameters

start_datestring (YYYY-MM-DD)Optional

Inclusive lower bound.

end_datestring (YYYY-MM-DD)Optional

Inclusive upper bound.

Request

curl 'https://api.tablezio.com/v1/analytics/peak_hours?start_date=2026-05-01&end_date=2026-05-31' -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.peak_hours", "days": ["Sunday", … ], "hours": ["00:00", …, "23:00"], "data": [ [ { "orders": 0, "revenue": 0 }, … ], … ] }

ABC menu analysis

GET /v1/analytics/menu_abc Scope: analytics:read

Classifies every menu item into A/B/C buckets based on contribution to revenue (Pareto-style).

Query parameters

start_datestring (YYYY-MM-DD)Optional

Inclusive lower bound.

end_datestring (YYYY-MM-DD)Optional

Inclusive upper bound.

Request

curl 'https://api.tablezio.com/v1/analytics/menu_abc?start_date=2026-05-01&end_date=2026-05-31' -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.menu_abc", "items": [ { "menu_item": "mi_…", "name": "Classic burger", "quantity_sold": 412, "total_revenue": 494400, "revenue_percent": "12.3", "order_count": 312, "classification": "A" } ], "summary": { "totalItems": 50, "classA": 8, "classB": 17, "classC": 25, "totalRevenue": 4023000 } }

Sales forecast

GET /v1/analytics/sales_forecast Scope: analytics:read

Linear-regression forecast of the next N days based on the trailing 30 days.

Query parameters

daysintegerOptional

1..30, default 7.

Request

curl 'https://api.tablezio.com/v1/analytics/sales_forecast?days=14' -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.sales_forecast", "historical": [ … ], "forecast": [ { "date": "2026-05-27", "predictedRevenue": 145000, "confidence": 95 } ], "trend": "increasing", "avgDailyRevenue": 138000 }

Period comparison

GET /v1/analytics/period_comparison Scope: analytics:read

Compares the requested period to the immediately preceding period of the same length. Returns percent changes.

Query parameters

start_datestring (YYYY-MM-DD)Optional

Inclusive lower bound.

end_datestring (YYYY-MM-DD)Optional

Inclusive upper bound.

Request

curl 'https://api.tablezio.com/v1/analytics/period_comparison?start_date=2026-05-01&end_date=2026-05-31' -H 'X-API-Key: tbz_…'

Response

application/json
{ "object": "analytics.period_comparison", "current": { "revenue": 4023000, "orders": 1320, "avgOrderValue": 3048, "customers": 124, "reservations": 220 }, "previous": { "revenue": 3812000, "orders": 1240, "avgOrderValue": 3074, "customers": 110, "reservations": 198 }, "changes": { "revenue": "5.5", "orders": "6.5", "avgOrderValue": "-0.8", "customers": "12.7", "reservations": "11.1" } }