# Spending By Vendor

> Solarium docs, Reports. All requests are `POST https://api.trysolarium.com/graphql/` with `Authorization: Bearer <api key>` and a JSON body `{"query": ..., "variables": ...}`. Every query and mutation takes an `organizationId` (find it with `myOrganizations`). Index of all pages: https://trysolarium.com/llms.txt

Expenses grouped by vendor, one column per month or quarter. Uses the same posted expense lines as the Profit & Loss (Cost of Goods Sold, Operating and Other Expenses, before tax), so the grand total always equals the P&L's total expenses. A line belongs to its transaction's vendor, else the line's own contact (QuickBooks history), else its known business, else its cleaned bank text; anything left is "No Vendor" (key "none"). Vendors are sorted biggest first. To list one vendor's entries, call accountLines with the returned accountIds and vendor set to the row's key.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationId` | `UUID!` | Yes | Organization ID |
| `startDate` | `Date!` | Yes | Start of range (YYYY-MM-DD) |
| `endDate` | `Date!` | Yes | End of range (YYYY-MM-DD) |
| `granularity` | `String` | No | "month" (default) or "quarter" |

### Request

```graphql
query {
  spendingByVendor(
    organizationId: "a1b2c3d4-..."
    startDate: "2026-01-01"
    endDate: "2026-02-28"
  ) {
    currency
    periods { key label startDate endDate }
    vendors { key name logoUrl amounts total percent count }
    totals
    total
    accountIds
  }
}
```

### Response

```json
{
  "data": {
    "spendingByVendor": {
      "currency": "CAD",
      "periods": [
        { "key": "2026-01", "label": "Jan 2026", "startDate": "2026-01-01", "endDate": "2026-01-31" },
        { "key": "2026-02", "label": "Feb 2026", "startDate": "2026-02-01", "endDate": "2026-02-28" }
      ],
      "vendors": [
        { "key": "c:7f3e...", "name": "Hall Properties", "logoUrl": null, "amounts": ["900.00", "900.00"], "total": "1800.00", "percent": "62.1", "count": 2 },
        { "key": "g:41aa...", "name": "Slack", "logoUrl": "https://...", "amounts": ["12.00", "12.00"], "total": "24.00", "percent": "0.8", "count": 2 },
        { "key": "none", "name": "No Vendor", "logoUrl": null, "amounts": ["0", "40.00"], "total": "40.00", "percent": "1.4", "count": 1 }
      ],
      "totals": ["1430.00", "1470.00"],
      "total": "2900.00",
      "accountIds": ["..."]
    }
  }
}
```
