Dashboard Statistics
Returns the aggregate statistics that power the Bagisto admin Dashboard screen — sales, orders, customers, visitors, stock alerts, top products and top customers.
| Endpoint | GET /api/admin/dashboard/stats |
| Returns | A JSON array with a single element: [ { type, dateRange, statistics } ] |
All admin endpoints require an admin Bearer token — see Authentication.
Understanding type — the dashboard is seven separate calls
This is the most important thing to understand about this API.
The Bagisto admin Dashboard you see in the panel is not one response. The page is assembled from seven independent requests, one per section, and each is selected with the ?type= query parameter. These seven groups are exactly the sections of the admin Dashboard screen — no more, no less.
So a single call returns one section of the dashboard. To render the full screen, call the endpoint once per type (or only for the sections you need). The statistics payload changes shape per type — sometimes an object, sometimes a flat array — so always branch on type when consuming it.
Which type maps to which part of the dashboard
| Dashboard section (admin panel) | type | statistics is |
|---|---|---|
| Overall Details cards (Total Sales / Orders / Customers / Average Order Sale / Total Unpaid Invoices) | over-all | object |
| Today's Details + today's order list | today | object |
| Stock Threshold product list | stock-threshold-products | array |
| Store Stats sales chart | total-sales | object (with over_time series) |
| Visitors chart | total-visitors | object (with over_time series) |
| Top Selling Products list | top-selling-products | array |
| Customer With Most Sales list | top-customers | array |
over-all is the default — if you omit ?type=, you get the "Overall Details" cards.
Query parameters
| Param | Type | Required | Description |
|---|---|---|---|
type | enum | No | One of the seven values above. Defaults to over-all. An unknown value returns 400 (invalid-type). |
start | date (YYYY-MM-DD) | No | Lower bound of the reporting window. Defaults to 30 days ago. |
end | date (YYYY-MM-DD) | No | Upper bound. Defaults to today. |
channel | string | No | Channel code to scope the figures to a single channel. Defaults to all channels. |
start / end drive both the figures and the previous baseline used for each progress percentage — the previous period is the same-length window immediately before start.
Response envelope
The endpoint always returns a single-element array: [ { type, dateRange, statistics } ].
type— echoes back the requested group.dateRange— a human-readable label for the window (e.g."03 May - 02 Jun"). (This is fully populated over REST; it isnullover the GraphQL transport.)statistics— an object or array whose shape depends ontype(documented below).
Response shapes by type
Figures with a previous / current / progress shape are period comparisons: current is the chosen window, previous is the preceding window of equal length, and progress is the percentage change (can be negative).
over-all
| Key | Shape | Meaning |
|---|---|---|
total_customers | { previous, current, progress } | New customers registered. |
total_orders | { previous, current, progress } | Orders placed. |
total_sales | { previous, current, formatted_total, progress } | Gross sales; formatted_total is the current value in base currency. |
avg_sales | { previous, current, formatted_total, progress } | Average order value. |
total_unpaid_invoices | { total, formatted_total } | Outstanding invoice amount (no period comparison). |
today
| Key | Shape | Meaning |
|---|---|---|
total_sales | { previous, current, formatted_total, progress } | Today's sales vs. yesterday. |
total_orders | { previous, current, progress } | Today's orders. |
total_customers | { previous, current, progress } | Today's new customers. |
orders | array | Orders placed today. Each row: id, increment_id, status, status_label, payment_method, base_grand_total, formatted_base_grand_total, channel_name, customer_email, customer_name, items, billing_address, created_at. |
orders[].items is admin HTML
The items field is a pre-rendered admin-panel Blade snippet (an HTML string of product thumbnails), carried over verbatim from core. It is not structured data — a headless client should ignore it and fetch line items from the Orders API (/api/admin/orders/{id}) when product detail is needed.
stock-threshold-products
statistics is an array (up to 5 rows). Each row: id, sku, name, price, formatted_price, total_qty, image (base-image URL or null).
total-sales
| Key | Shape | Meaning |
|---|---|---|
total_orders | { previous, current, progress } | Orders in the window. |
total_sales | { previous, current, formatted_total, progress } | Sales in the window. |
over_time | array of { label, total, count } | One bucket per day across start→end for the chart line. total is sales, count is order count. |
total-visitors
| Key | Shape | Meaning |
|---|---|---|
total | { previous, current, progress } | All visits. |
unique | { previous, current, progress } | Unique visitors. |
over_time | array of { label, total } | One bucket per day for the chart. |
Visitor figures depend on the Bagisto visitor/analytics tables being populated; on a fresh store they are 0.
top-selling-products
statistics is an array (up to 5 rows). Each row: id, name, price, formatted_price, revenue, formatted_revenue, and images (array of { id, type, path, product_id, position, url }).
top-customers
statistics is an array (up to 5 rows). Each row: id (may be null for guest checkouts), email, full_name (may be null), total, orders, formatted_total, datetime.
Errors
| Condition | HTTP | Body |
|---|---|---|
| Missing / invalid Bearer token | 401 | { "message": "Unauthenticated.", "error": "unauthenticated" } |
Unknown type value | 400 | { ... "Invalid dashboard stat type." } |
See also
- Dashboard Statistics (GraphQL) — same data over the
statsAdminDashboardquery. - Reporting — deeper, dedicated sales / customer / product report endpoints.

