Review-rating distribution across the caller's trucks.
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
Response Body
application/json
application/json
curl -X GET "https://example.com/api/v1/owner/analytics/reviews"{ "data": { "total": 218, "averageRating": 4.7, "stars": [ { "stars": 5, "count": 168 }, { "stars": 4, "count": 32 }, { "stars": 3, "count": 12 }, { "stars": 2, "count": 4 }, { "stars": 1, "count": 2 } ] }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}{ "error": { "code": "AUTH_REQUIRED", "message": "Authentication is required to access this resource." }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}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.
Owner settlement view — one row per (truck, ISO week). GET
Payouts are computed views over `payment_orders` (no payouts table). Each item shows the bucket gross, the platform fee (computed from `config/payments.ts::platformFeeBps`) and the net amount owed to the truck. Cached for 60s per owner; cache invalidates on the next paid webhook.