read.internal.sales_metrics
The admin dashboard’s sales aggregate for a period (7d/30d/90d, optionally one store): revenue, orders, average ticket and new customers for the window AND for the previous one, the daily series behind them, the per-store breakdown with its own series, the order count by status, and the two live actionables (unpaid for over 48h; ready for pickup and not collected). Days are cut in the instance timezone; money is cents. Computed in SQL — never a scan in the consumer.
- Surface:
GET /v1/read/internal/sales_metrics· MCP toolread.internal.sales_metrics - Auth: ★ Internal read (operator) — a tenant credential is REQUIRED; requires ANY ONE of
order.read,order.write. The tenant is resolved from the CALLER’s identity, never fromstore. Personal fields come back MASKED for an actor withoutpii.read(the shape is unchanged).
Params (JSON Schema)
Section titled “Params (JSON Schema)”{ "properties": { "period": { "enum": [ "7d", "30d", "90d" ], "type": "string" }, "store_id": { "minLength": 1, "type": "string" } }, "required": [ "period" ], "type": "object"}Result (200)
Section titled “Result (200)”Open (unknown) — this capability does not declare an output schema.
Errors
Section titled “Errors”validation_failed (400) · not_found (404) · unauthorized (401) · forbidden (403)