Linkit

Reports

Tenant report envelope — sales, channels, SKUs, branch performance, app logs

Reports

Eleven GET /api/v1/reports/* routes are mounted, including skus, branch-performance, and app-logs. Live merchant JWT on 2026-09-10: all four probed paths answered 200. Comments that still say those three are 501 are stale.

Every report body is wrapped in:

{
  "organization_id": "0rmzqwt5hhaf07r",
  "fetched_at": "2026-09-10T14:24:59Z",
  "data": {}
}

GET /api/v1/analytics/dashboard is not this envelope (range_days / errors sit beside data). Windows are ?days= or ?hours= — integers, clamped, never ISO from/to. ?days=%207 falls back to the default (trim happens, parse does not).

Several sections fail soft to [] with HTTP 200 when a table is missing. Empty can mean "no rows" or "the query failed". Offline-sales columns on SKU / branch-performance are always 0: the auxiliary _logs table the figure came from has no equivalent here; the statement raises 42P01 and degrades.


Mounted

EndpointWindowLive notes
GET /api/v1/reports/salesdays default 30, max 365data.appSales / branchSales / dailySales / productSales. Inner keys mix camelCase (appSales) and snake_case
GET /api/v1/reports/channelslocale onlydata.appSales, data.organizations
GET /api/v1/reports/ordersdays default 365, max 730Widest sales-like window
GET /api/v1/reports/inventory
GET /api/v1/reports/customers
GET /api/v1/reports/stagingsoptional hours; omit = no lower boundMax 24×365
GET /api/v1/reports/products
GET /api/v1/reports/offersdays default 90, max 3650
GET /api/v1/reports/skusdays default 30, max 365Live: data.summary.total_offline_sales_qty is 0
GET /api/v1/reports/branch-performancesameLive: summary.branch_count / window_days
GET /api/v1/reports/app-logspagerLive: data.pagination snake_case (per_page), data.organizationApps camelCase, source: "none" when empty

Requires read × report (app-logs: app_log). Tenant-scoped.


SKU summary (live empty tenant)

{
  "organization_id": "0rmzqwt5hhaf07r",
  "fetched_at": "2026-09-10T14:24:59Z",
  "data": {
    "by_branch": [],
    "ranked_skus": [],
    "summary": {
      "dedup_window_minutes": 15,
      "total_offline_sales_qty": 0,
      "total_order_qty": 0,
      "total_ranked_skus": 0,
      "window_days": 7
    }
  }
}