# Get spend report

Returns paid, refunded and net amounts grouped by agent, team, merchant, rail, network, day, week or month, one row per key and asset. Requires ledger:read; merchants cannot group by agent or team.

`GET /v1/reports`

Returns paid, refunded and net amounts grouped by agent, team, merchant, rail, network, day, week or month, one row per key and asset. Requires ledger:read; merchants cannot group by agent or team.

Requires permission `ledger:read`.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `group_by` | query | no | Grouping: agent (default), team, merchant, rail, network, day, week or month. |
| `from` | query | no | Start of the period, ISO 8601 (inclusive). |
| `to` | query | no | End of the period, ISO 8601. |
| `rail` | query | no | Only payments on this rail: x402, wdk or card. |

## Responses

- **200**: Success.
- **400**: Invalid request: a field is missing or malformed (VALIDATION_ERROR).
- **401**: No valid session, API key or agent credential (UNAUTHENTICATED, AGENT_CREDENTIAL_INVALID).
- **403**: Authenticated but not allowed: missing permission, passkey step-up required, or denied by policy.

Example 200 response:

```json
{
  "group_by": "agent",
  "from": null,
  "to": null,
  "rows": [
    {
      "key": "agt_01m7dmxx6xa5jqkh3djxbg1va9",
      "label": "Procurement Agent",
      "payments_count": 4,
      "amount_base_units": "3250000",
      "amount_display": "3.25 USDC",
      "refunded_base_units": "2000000",
      "net_base_units": "1250000",
      "net_display": "1.25 USDC"
    },
    {
      "key": "agt_01m7dmxx5b0jc1gcgw6sgeaqf3",
      "label": "Research Agent",
      "payments_count": 7,
      "amount_base_units": "2100000",
      "amount_display": "2.10 USDC",
      "refunded_base_units": "500000",
      "net_base_units": "1600000",
      "net_display": "1.60 USDC"
    }
  ]
}
```
