Skip to main content
GET
Get User Spending Analysis V2 Endpoint

Authorizations

Authorization
string
header
required

Bearer authentication with a personal access token (prefix pat_). Generate tokens in the Truv web app under Settings → API keys.

Query Parameters

group_by
enum<string>
required
Available options:
category,
merchant,
time_period
time_period
enum<string>
required
Available options:
day,
week,
month,
quarter,
year
link_id
string | null
start_date
string<date> | null
end_date
string<date> | null
account_ids
string | null
categories
string | null
min_total_amount
default:50.00
include_income
boolean | null
default:false
secondary_group_by
enum<string> | null
Available options:
category,
merchant

Response

Spending analysis with optional double aggregation (v2).

Spending analysis response with optional double aggregation.

Wraps the Truv API response and adds by_time_period with breakdown when secondary_group_by is specified.

spending
SpendingData · object
required

Spending data from Truv API.

summary
SpendingSummary · object
required

Summary statistics from Truv API.

request_id
string
required

Unique request identifier.

created_at
string
required

Analysis creation timestamp.

by_time_period
TimePeriodSpendingEnriched · object[] | null

Time periods with category/merchant breakdown. Only present when group_by=time_period and secondary_group_by is set.

total_income
string | null

Whole-window CREDIT total on the same hide-aware basis as the spending side (same hide, internal-transfer, and investment exclusions; scoped by link_id and account_ids). It is a whole-window figure and is NOT narrowed by the categories breakdown filter or the include_income flag. Null on the legacy v1 endpoint, which does not compute cash flow.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Example:

"4345.00"

total_expenses
string | null

Whole-window DEBIT total on the same basis as total_income. Pairs with total_income to derive the savings rate. Unlike summary.total_spending it is never signed against income and is not narrowed by the categories filter, so use this (not summary.total_spending) when displaying the savings rate. Null on the legacy v1 endpoint.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Example:

"10550.00"

savings_rate
string | null

(total_income minus total_expenses) as a percentage of total_income, one decimal place. Can be negative when expenses exceed income. Null when total_income is zero or negative (undefined) or on the legacy v1 endpoint.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Example:

"-142.8"