Skip to main content
The Spending Analysis response provides spending data grouped by category, merchant, or time period, along with summary statistics.

Summary attributes

AttributeTypeDescription
total_spendingstringTotal spending amount
average_daily_spendingstringAverage daily spending
average_monthly_spendingstringAverage monthly spending
total_transactionsintegerTotal number of transactions
unique_merchantsintegerNumber of unique merchants
top_categorystringHighest-spending category
top_merchantstringHighest-spending merchant

Spending data attributes

AttributeTypeDescription
by_categoryarray of objectsSpending grouped by category
by_merchantarray of objectsSpending grouped by merchant
by_time_periodarray of objectsSpending grouped by time period

Response attributes

AttributeTypeDescription
spendingobjectSpending data from MyTruv API
summaryobjectSummary statistics
request_idstringUnique request identifier
created_atstringAnalysis creation timestamp
by_time_periodarray of objectsTime periods with category/merchant breakdown (only when group_by=time_period and secondary_group_by is set)

Endpoints


Example response

{
  "spending": {
    "by_category": [
      {
        "category": "Food & Dining",
        "total": "1250.00",
        "count": 45
      }
    ],
    "by_merchant": [
      {
        "merchant": "Whole Foods",
        "total": "850.00",
        "count": 12
      }
    ]
  },
  "summary": {
    "total_spending": "5100.00",
    "average_daily_spending": "170.00",
    "average_monthly_spending": "5100.00",
    "total_transactions": 249,
    "unique_merchants": 3,
    "top_category": "Food & Dining",
    "top_merchant": "Whole Foods"
  },
  "request_id": "req_abc123",
  "created_at": "2025-03-15T10:00:00Z"
}