# Accounts and periods

> How multi-account and multi-month statements come back, and how to match an account to your own records.

Section: Guides
Source: https://statementbear.com/docs/accounts-and-periods
Product: StatementBear statement parsing API, $0.49 per document, 25 free.

---

One PDF can hold several accounts and several months. Iterate `accounts` rather than reading `accounts[0]`.

## Accounts

`accounts` holds one entry per account printed on the document, each with its own rows, totals and identity. Usually there is one. Capital One prints a checking account and three savings accounts.

A multi-account statement, abridged:

```json
"accounts": [
  { "type": "bank", "last4": "8821", "name": null, "primary": true,
    "openingBalance": 1204.11, "closingBalance": 1602.56,
    "totals": { "credits": 3240.00, "debits": 2841.55 }, "transactions": [ ... ] },
  { "type": "bank", "last4": "4410", "name": "360 Performance Savings",
    "primary": false, "openingBalance": null, "closingBalance": null,
    "totals": { "credits": 500.00, "debits": 0 }, "transactions": [ ... ] }
]
```

> **Do not merge accounts**
>
> A transfer between two accounts on the same statement is printed twice: a debit on one and a credit on the other. Flatten them into one list and every internal movement counts as both spending and income.

## The primary account

Exactly one entry has `primary: true`: the account the issuer printed first. It is the only account carrying `openingBalance` and `closingBalance`, which the statement prints once for the document rather than per account.

## Periods

The document has a `period`, and so does each account. They match except on a combined PDF that repeats one account across several months, where each entry carries the month it covers. `month` is 1-12.

A statement straddling a month boundary, as most card statements do, is reported under the month the issuer bills it as. That is the month printed on the document.

## Matching an account to your records

| Field | Use it for | Null when |
| --- | --- | --- |
| `last4` | Matching a document to an application or an account on file. | The issuer printed no account or card number. |
| `name` | Telling savings sub-accounts apart on a multi-account statement. | The issuer printed the product name at the top of the page rather than against the account. |
| `type` | Deciding whether credits can be income. See [Amounts and directions](https://statementbear.com/docs/amounts-and-directions). | Never. It is always `bank` or `credit_card`. |

`bank` covers every deposit account: current, checking and savings.

---

All documentation: https://statementbear.com/docs/llms.txt
Questions: api@statementbear.com
