# Receivables & Payables (Aged)

> 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

Who owes what as of a date: customers who owe you (side "receivable", A/R accounts) or vendors you owe (side "payable", A/P accounts), grouped by the customer/vendor on each posted line. Aging is first-in, first-out: payments clear the oldest charges first and what remains is aged by its own date into 0–30, 31–60, 61–90 and over 90 days. A contact who has overpaid shows a negative balance in current. Lines with no contact are grouped under key "none". The grand total equals the accounts' balance-sheet balance. To list one row's entries, call accountLines with the returned accountIds, endDate = asOf and contact set to the row's key.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationId` | `UUID!` | Yes | Organization ID |
| `side` | `String!` | Yes | "receivable" or "payable" |
| `asOf` | `Date!` | Yes | Balances as of this date (YYYY-MM-DD) |

### Request

```graphql
query {
  openBalances(organizationId: "a1b2c3d4-...", side: "receivable", asOf: "2026-04-15") {
    currency
    rows { key name current days31To60 days61To90 over90 total oldest }
    totals { current days31To60 days61To90 over90 total }
    accountIds
  }
}
```

### Response

```json
{
  "data": {
    "openBalances": {
      "currency": "CAD",
      "rows": [
        { "key": "7f3e...", "name": "Buduchnist", "current": "0", "days31To60": "0", "days61To90": "0", "over90": "200.00", "total": "200.00", "oldest": "2026-01-10" },
        { "key": "91ab...", "name": "HMECU", "current": "0", "days31To60": "30.00", "days61To90": "0", "over90": "0", "total": "30.00", "oldest": "2026-03-01" }
      ],
      "totals": { "current": "0", "days31To60": "30.00", "days61To90": "0", "over90": "200.00", "total": "230.00" },
      "accountIds": ["..."]
    }
  }
}
```
