Expenses

How many expenses match, and their total amount

Takes exactly the expense list's filters — its filter[<field>_<predicate>] fields and filter[tab], filter[tag_id], filter[has_work_order], filter[archived] — so a total always describes the records the list returns (e.g. filter[tab]=submitted). Scoped like the list. A filter key it doesn't apply (a field without a predicate, or one that isn't filterable) is a 400, never silently ignored.

get/v1/expenses/totals

Request

  • Base URL: https://api.topkey.io
  • URL: https://api.topkey.io/v1/expenses/totals
  • Auth: HTTP bearer

Query parameters

tabstring

draft / submitted / approved / rejected / ready_to_pay: the app's expense tabs, or approved with no payment yet.

tag_idstring

Comma-separated tag ids: expenses carrying any of them.

has_work_orderstring

true / false: whether the expense is attached to a work order.

archivedstring

false (default) hides archived expenses, true returns only archived ones, all returns both.

filter[field_predicate]=value (Ransack, per-resource allowlist), and the plain-value filters listed. Unknown filters return 400.

Response

The totals.

Changes

No recorded changes to this operation across all 1 revision of this API.