Spend breakdown
breakdownSpend split by one or two dimensions: top categories, spend by state, income mix, top merchants, a category by month. "Q3 vs Q2 by category" is two calls, one per window. The window is at most 366 days. Each group key comes back in its own named field.
Covers ALL transaction types (purchases, refunds, transfers, income), unlike query_spend, category_trends and compare_brands, which are purchase-only. Pass transaction_type=purchase to compare with them.
Filter a merchant by name with merchant (no search first), or by merchant_id; grouping by merchant_id rolls sub-brands up to the brand, and each row names its merchant in merchant_name (null when the directory has no name for it). A store ZIP split is group_by=merchant_postal_code with merchant_id on the same call. State is spender_state (cardholder) or merchant_state (store); there is no location dimension, and location is a metro name such as Pittsburgh. spender_cbsa / merchant_cbsa are metro codes. area_income_tier Q1 (lowest) to Q5 describes the cardholder's neighbourhood; income_bracket covers about 6% of volume, so prefer area_income_tier. payment_method is debit, credit and named rails such as PayPal; Apple Pay and buy-now-pay-later are not here.
In raw mode, compare shares within a dimension, not dollar totals across places, or pass weighting=population. Rows are by total spend, largest first, 25 by default; truncated: true means page with next_offset. Not foot traffic, rent or SKU sales. At most two dimensions.
Talk to the user in plain words: no tool, parameter or field names. Say "the American Spend model", never "panel" or a data source.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"group_by": "<group_by>",
"start_date": "<start_date>",
"end_date": "<end_date>"
},
"name": "breakdown"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group | No | Restrict to a merchant group by slug or UUID (`find_groups` lists them), such as a basket like `big-grocery` or a collection like `ai-providers`. Resolved server-side to the group's flat membership (with each member's sub-brands) and echoed under `merchant_group`; an unknown group is a 400 `merchant-group-unknown`. ANDs with `merchant_id`. | |
| limit | No | Groups per response. | |
| offset | No | Groups to skip, for paging. | |
| deflate | No | Adds real (inflation-adjusted) spend in base-month dollars, from CPI-U — the US city average (`cpi_u`) or the row's most specific published area (`cpi_regional`). The CPI item is the one the row's category maps to, all items otherwise. | none |
| age_band | No | Restrict to these cardholder age bands: `18-24`, `25-34`, `35-44`, `45-54`, `55-64`, `65+`. `unknown` selects rows with no age upstream. | |
| category | No | Restrict to these categories. Comma-separated or repeated, max 50. Category keys are lower-case and exact: `automotive`, `delivery`, `education`, `entertainment`, `financial_services`, `gifts_donations`, `government`, `grocery`, `healthcare`, `home_services`, `personal_care`, `pets`, `professional_services`, `restaurants`, `retail`, `subscriptions`, `tax_services`, `technology`, `travel`, `utilities`, `uncategorized`, plus older keys the data still carries (list every key with the breakdown, `group_by=category`). Any other name is a 400 `…/problems/category-unknown` whose `candidates` are the closest keys (`Groceries` → `grocery`). | |
| end_date | Yes | Inclusive ISO-8601 date. At most 366 days after `start_date`. | |
| group_by | Yes | One or two dimensions, comma-separated or repeated. State is spender_state (cardholder) or merchant_state (store); there is no location. payment_method is the card (debit, credit, prepaid, health_benefit). PayPal is facilitator. Apple Pay and buy-now-pay-later are not values. facilitator is who billed the purchase, read from the descriptor's prefix (`PayPal`, `Venmo`, `SQUARE`, `Klarna`, a payment app or a measured processor, and `direct` for none); it needs `merchant`, `merchant_id` or `group`, counts purchases only (the response says `transaction_type: purchase`), and pairs with day, week, month, category, subcategory, income_bracket, merchant_metro, spender_metro, merchant_cbsa or merchant_id. Its rows sum to the merchant's purchase total. Two is the maximum: a three-way split multiplies group cardinality past what a single response should carry. | |
| location | No | Coded metro. Matches merchant geography OR spender (cardholder) geography by default — narrow with `match_merchant` / `match_spender`. Spender scoping is what lets app-billed merchants (rideshare, whose merchant address is the processor HQ) be analysed by city. | |
| merchant | No | A brand by name — "top categories at Starbucks" with no search first. Resolved to the directory merchant like the merchant query's `merchant` (exact canonical/alias/DBA, then whole-word) and echoed under `merchant` with `merchant_ids` and `matched_names`. A name the directory does not hold is 400 `…/problems/merchant-not-found`; one naming several merchants is 400 `…/problems/merchant-ambiguous` with `candidates`. `merchant_id` wins when both are given. | |
| order_by | No | Sort key, descending for the measures. `group_key` sorts by the dimensions ascending instead — the stable order for paging through a full enumeration. | total_cents |
| normalize | No | Adds a normalized figure beside the raw ones: `share_of_spend` is the row's share of all spend under the same filters, `per_account` spend per active card. `per_household` and `share_of_income` need `weighting=population` (400 `normalize-requires-population`). `per_account` with `growth=true` is the figure for a brand's growth: every card counts, so it is not moved by which cards the population weights can place. | none |
| weighting | No | `raw` (the default): model volume, `weighted_cents` equals `total_cents`. `population`: the weighted fields reweight the model to the mix of US adults (for shares, comparisons and growth, not market size), with `effective_n`, `low_precision`, `suppressed` and a `weighting` object. A month has weights once it has been raked, from 2025-09 on. `same_account`: growth compares one set of accounts, those with spend in the model in both of two months, chained month by month, so accounts arriving or leaving can't move it. It is turnover-adjusted: each month also carries the merchant's or category's own balance of accounts arriving and leaving (the median over 12 months), which shared accounts alone miss. Levels and shares stay raw. A growth block gains `same_account_change_pct` and `same_account_yoy_pct`, or `same_account_unavailable` saying why not, and a monthly series carries chained dollars in `weighted_cents`. It needs whole, settled calendar months, the newest month waits for the month after it on the default `stable` accounts, and it is in validation (403 `same-account-weighting-forbidden` until open to the key). Omit it to get the response shape callers had before it existed. | raw |
| start_date | Yes | Inclusive ISO-8601 date. | |
| merchant_id | No | Restrict to these canonical merchant UUIDs (comma-separated or repeated, max 50) — "top categories at Walmart". A parent id also matches its children. | |
| subcategory | No | Restrict to these subcategories. Comma-separated or repeated, max 50. Subcategory keys are lower-case and exact (`supermarket`, `fast_food`; list them with the breakdown, `group_by=subcategory`). Any other name is a 400 `…/problems/subcategory-unknown` whose `candidates` are the closest keys. Three `retail` keys: `wholesale_clubs` is warehouse clubs & supercenters (Costco, Sam's Club, BJ's, Walmart); `department_stores` is Macy's, Kohl's, Nordstrom and Target; `marketplaces` is eBay, Temu and TikTok Shop. | |
| spender_cbsa | No | Restrict to cardholders living in these metropolitan areas. Each value is a 5-digit CBSA code (`19100`), a non-metro bucket (`NM-TX`), or a name — the full OMB title or a principal city, optionally with its state (`Dallas`, `Portland, OR`). Names are resolved server-side and echoed under `resolved_filters`; a name that fits several metros is a 400 listing them as `candidates`, an unknown one is a 400 `cbsa-unknown`. Comma-separated or repeated, max 50; a single value that is itself a name with a comma (`Portland, OR`, a full OMB title) is matched whole first. | |
| match_spender | No | Include spender geography when filtering by `location`. Defaults true. | |
| merchant_cbsa | No | Restrict to stores in these metropolitan areas (from the merchant ZIP). Same values and resolution as `spender_cbsa`. | |
| spender_metro | No | Restrict to these coded spender (cardholder) metros. | |
| spender_state | No | Restrict to cardholders in these 2-letter states. | |
| income_bracket | No | Restrict to these cardholder income bands. Comma-separated or repeated — unlike the single-value `income_bracket` on the merchant query. `unknown` selects rows with no income upstream. | |
| match_merchant | No | Include merchant geography when filtering by `location`. Defaults true. | |
| merchant_metro | No | Restrict to these coded merchant metros. ANDs with `spender_metro` — for a single metro matched on either side, use `location`. | |
| merchant_state | No | Restrict to these 2-letter merchant states. | |
| payment_method | No | Restrict to these card types, the same values breakdown returns for group_by=payment_method: debit, credit, prepaid, health_benefit. PayPal is facilitator. Not Apple Pay, not buy-now-pay-later, and not which account funded the card. | |
| area_income_tier | No | Restrict to these area income tiers, `Q1` (lowest) to `Q5` — national quintiles of the median household income of the cardholder's ZIP area. `unknown` selects rows with no tier. | |
| transaction_type | No | Restrict to these transaction types. `purchase` is what makes totals here reconcile with `query_spend` and `category_trends`. | |
| merchant_group_id | No | The older name of `group`. `group` wins when both are given. | |
| merchant_postal_code | No | Restrict to these merchant ZIPs. | |
| exclude_subscriptions | No | Exclude membership/subscription fee rows (DashPass, Uber One, Instacart+, …). Defaults false. |