API ReferenceOwner: Analytics
KPI snapshot for the caller's trucks.
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.
Authorization
bearerAuth AuthorizationBearer <token>
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
Response Body
application/json
application/json
curl -X GET "https://example.com/api/v1/owner/analytics/overview"{ "data": { "trucksOwned": 2, "trucksOpenNow": 1, "ordersLast7Days": 142, "revenueLast7DaysMinor": 384200, "reviewsCount": 218, "complaintsCount": 3, "averageRating": 4.7, "topItem": { "menuItemId": "mit_01jq8z5e0f1g2h3j4k5l6m7n8p", "name": "Smash Double", "orders": 47 } }, "meta": { "requestId": "req_01jq8z9m1n2p3q4r5s6t7u8v9w" }}{ "error": { "code": "AUTH_REQUIRED", "message": "Authentication is required to access this resource." }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}Global activity log (admin audit trail). GET
Filter by `?action=` (e.g. `user.suspend`, `truck.feature`), `?actorId=` (admin operator id), and `?targetType=` (entity affected). `?limit=` defaults to 100 (range 1–500).
Daily order count for the trailing window. GET
One bucket per day. Pass `?days=7|30|90`; defaults to 7.