Skip to main content

Daily Financial Summary

GET 

/api/v2/financials/daily-summary

Returns paginated daily financial summary rows. Each row is backed by a polymorphic reportable: a Product or a Financial Line Type.

Authentication: Requires Bearer token.

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

  • filter[search] — searches product SKU/name and financial line type name/classification; numeric values also match row ID
  • filter[date_from] / filter[date_to] — date range on the summary date (YYYY-MM-DD)
  • filter[id] / filter[reportable_type] — exact match
  • filter[financial_line_type.{operator}] — financial line type NAME on FinancialLineType-backed rows. 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}] — financial line type classification ('revenue' or 'cost'), same operators as above
  • Numeric advanced filters on: id, quantity, quantity_returned, num_orders, revenue, revenue_allocated, revenue_credits, total_revenue, cost, cost_allocated, cost_invoices, cost_returned, total_cost, profit, profit_margin (operators: equals, not_equals, greater_than, greater_than_or_equal, less_than, less_than_or_equal, between, is_empty, is_not_empty)
  • 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.

Pagination: page, per_page (default 15).

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