API ReferenceOwner: Analytics
Daily completed-order revenue (minor units) for the trailing window.
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.
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
Query Parameters
days?number
truckId?string
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/owner/analytics/revenue"{ "data": { "days": 7, "totalRevenueMinor": 1435000, "totalOrders": 148, "changePercent": 12.5, "series": [ { "date": "2026-06-03", "revenueMinor": 320000, "orders": 35, "trucks": [ { "id": "trk_1", "name": "Shawarma Express", "revenueMinor": 185000, "orders": 20 }, { "id": "trk_2", "name": "Burger Delight", "revenueMinor": 135000, "orders": 15 } ] }, { "date": "2026-06-04", "revenueMinor": 450000, "orders": 43, "trucks": [ { "id": "trk_1", "name": "Shawarma Express", "revenueMinor": 245000, "orders": 28 }, { "id": "trk_2", "name": "Burger Delight", "revenueMinor": 205000, "orders": 15 } ] } ] }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}{ "error": { "code": "AUTH_REQUIRED", "message": "Authentication is required to access this resource." }, "meta": { "requestId": "req_01jq8z1mxc0e0v6r3xj0a8h9k7" }}{ "error": { "code": "FORBIDDEN", "message": "You are not allowed to perform this action." }, "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" }}