Daily order count for the trailing window.
One bucket per day. Pass `?days=7|30|90`; defaults to 7.
Authorization
bearerAuth AdonisJS access-token guard (middleware.auth({ guards: ["api"] })). Send Authorization: Bearer <oat_…> (issued by /auth/register, /auth/login, /auth/social/{google,apple}, or /auth/guest).
In: header
Query Parameters
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/owner/analytics/orders"{ "data": { "series": [ { "date": "2026-05-18", "value": 12 }, { "date": "2026-05-19", "value": 18 }, { "date": "2026-05-20", "value": 22 }, { "date": "2026-05-21", "value": 15 } ] }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}{ "error": { "code": "AUTH_REQUIRED", "message": "Authentication is required to access this resource." }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}{ "error": { "code": "VALIDATION_ERROR", "message": "One or more fields are invalid.", "fields": [ { "path": "email", "rule": "email", "message": "Must be a valid email address." } ] }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}KPI snapshot for the caller's trucks. GET
Trucks owned, trucks open right now, orders + revenue over the last 7 days, review count + average rating, and the top-selling menu item over the last 7 days. Cached for 60s per owner.
Daily completed-order revenue (minor units) for the trailing window. GET
Pass `?days=7|30|90` and optionally `?truckId=...`. Returns total revenue/orders, previous-period change percent, and a zero-filled daily series. Each day includes per-truck breakdown unless filtered by truckId.