# Balances

Source: https://amanucci.com/docs/developers/api/ledger/readBalances

## GET /v1/entities/{entityId}/balances

Balances

Balances as of a period — a first-class operation, not a report you assemble. Balance-sheet accounts (asset/liability/equity) sum SINCE INCEPTION; income and expense accounts reset per fiscal year, summing only periods sharing the as-of period's own `fiscal_year` column, because there is no closing-entry mechanism pre-annual-accounts and the reset is therefore a read-path rule. The `source` field says whether snapshots, raw lines or both fed the answer: a reopened period has no snapshot rows and degrades to the same query over a different source, so the fallback is a plan change and never different semantics.

Operation ID: `readBalances`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "description": "The period to read as of. Required: 'the balances' with no date is not a question, and defaulting to the latest period would silently change a report's meaning whenever somebody cut a new quarter."
    },
    "required": true,
    "description": "The period to read as of. Required: 'the balances' with no date is not a question, and defaulting to the latest period would silently change a report's meaning whenever somebody cut a new quarter.",
    "name": "asOfPeriodId",
    "in": "query"
  }
]
```

### Responses

#### 200 The balances, and their source.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/Balances"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
