# Profit & Loss By Period

> 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

Profit & loss with one column per month or quarter. Accounts are grouped into Revenue, Cost of Goods Sold, Operating Expenses and Other Expenses; each line carries its amount per period, its total, and its share of its section. Amounts are natural-signed (revenue and expenses both positive) in the organization's functional currency. A single-period result always equals the Income Statement.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationId` | `UUID!` | Yes | Organization ID |
| `startDate` | `Date!` | Yes | Start of range (YYYY-MM-DD); the first period is clipped to it |
| `endDate` | `Date!` | Yes | End of range (YYYY-MM-DD); the last period is clipped to it |
| `granularity` | `String` | No | "month" (default) or "quarter" |

### Request

```graphql
query {
  profitAndLoss(
    organizationId: "a1b2c3d4-..."
    startDate: "2026-01-01"
    endDate: "2026-03-31"
    granularity: "month"
  ) {
    currency
    periods { key label startDate endDate }
    sections {
      key
      title
      lines { accountId accountName taxCode amounts total percent }
      totals
      total
    }
    grossProfit { amounts total }
    netIncome { amounts total }
  }
}
```

### Response

```json
{
  "data": {
    "profitAndLoss": {
      "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" },
        { "key": "2026-03", "label": "Mar 2026", "startDate": "2026-03-01", "endDate": "2026-03-31" }
      ],
      "sections": [
        {
          "key": "revenue",
          "title": "Revenue",
          "lines": [
            { "accountId": "...", "accountName": "Sales", "taxCode": "8000", "amounts": ["26500.00", "27100.00", "30900.00"], "total": "84500.00", "percent": "100.0" }
          ],
          "totals": ["26500.00", "27100.00", "30900.00"],
          "total": "84500.00"
        },
        {
          "key": "operating_expenses",
          "title": "Operating Expenses",
          "lines": [
            { "accountId": "...", "accountName": "Rent", "taxCode": "8910", "amounts": ["6000.00", "6000.00", "6000.00"], "total": "18000.00", "percent": "34.4" },
            { "accountId": "...", "accountName": "Wages", "taxCode": "9060", "amounts": ["9300.00", "9300.00", "9400.00"], "total": "28000.00", "percent": "53.5" }
          ],
          "totals": ["15300.00", "15300.00", "15400.00"],
          "total": "46000.00"
        }
      ],
      "grossProfit": { "amounts": ["26500.00", "27100.00", "30900.00"], "total": "84500.00" },
      "netIncome": { "amounts": ["11200.00", "11800.00", "15500.00"], "total": "38500.00" }
    }
  }
}
```
