Skip to main content

Export Daily Financials

GET 

/api/export/daily-financials

Returns ALL daily financial summary rows (no pagination) as JSON for CSV export. Applies the same filters and sorts as GET /api/v2/financials/daily-summary.

Authentication: Requires Bearer token.

Filters (Spatie QueryBuilder syntax, filter[name]=value):

  • filter[search], filter[date_from], filter[date_to], filter[id], filter[reportable_type]
  • filter[financial_line_type.{operator}] — financial line type NAME. Advanced text filter operators (append to the filter name): is, is_not, contains, does_not_contain, is_one_of (comma-separated), starts_with, does_not_start_with, ends_with, does_not_end_with, is_empty, is_not_empty. Bare filter[financial_line_type]=value acts as implicit 'is'. Positive operators return only financial-line-type rows that match; negative operators (is_not, does_not_*) exclude matching line-type rows while keeping all other rows (e.g. product-backed rows).
  • filter[classification.{operator}] — 'revenue' or 'cost', same operators
  • Numeric advanced filters on all quantity/money columns; date advanced filters on date, created_at, updated_at

Sorting: sort param, prefix with - for DESC. Allowed sorts: id, date, quantity, num_orders, total_revenue, total_cost, profit, profit_margin, created_at, updated_at. Default: -date.

Response: JSON { data: [...] } containing every matching row.

Grouped filters: this endpoint also accepts a filter_groups query param — a base64-encoded JSON tree with AND/OR conjunctions and nested groups (this is what the Vue 3 advanced filters modal sends). Example JSON before encoding: {"conjunction":"and","children":[{"type":"condition","condition":{"column":"financial_line_type","operator":"is","value":"Shipping Revenue"}}]}. Conditions reference the same filter columns/operators listed above. When filter_groups is present, tree conditions are applied with proper parenthesization; flat filter[...] params still work for non-tree filters (search, date_from, date_to).

Request

Responses

Successful response