Skip to content

Reporting — Sales

EndpointMethod
/api/admin/reporting/salesGET
/api/admin/reporting/sales/viewGET
/api/admin/reporting/sales/exportGET

Query Parameters

ParamTypeNotes
typeenumtotal-sales (default), average-sales, total-orders, purchase-funnel, abandoned-carts, refunds, tax-collected, shipping-collected, top-payment-methods.
startdateStart date.
enddateEnd date.
channelstringChannel code.

Helper-method output

statistics payload is the raw helper aggregate keyed to the chosen type.

View Details

GET /api/admin/reporting/sales/view returns the same statistics as the summary stats endpoint, but in a detailed table form — the full list that sits behind a panel's View Details link. The statistics object carries:

  • columns — an ordered list of { key, label } describing each table column.
  • records — the row data, each keyed by the column key values.

This is the expanded, row-by-row view; the summary stats endpoint returns the rolled-up headline figures instead.

Export (CSV)

GET /api/admin/reporting/sales/export streams the same detailed table as a text/csv attachment (the Export button). The header row is built from the column labels, followed by one line per record. Send Accept: text/csv and save the response to a file.

Only ?format=csv is accepted — any other format value returns HTTP 422.

Both View Details and Export require only authentication; reporting has no permission gate.

Released under the MIT License.