# Amounts and directions

> How amounts are signed, how direction is decided, and which credits count as income.

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

---

`amount` is always positive. `direction` carries the sign. To get a signed figure, negate when `direction` is `debit`.

## How direction is decided

From the document, never from the payee name. Issuers encode it four ways:

1. **A sign on the amount.** A leading or trailing minus, or brackets.
2. **A section heading** that owns every row beneath it, such as `CHECKS AND OTHER DEBITS`. The rows themselves carry no marker.
3. **Paired columns**, `Débit | Crédit`, where the column decides the direction.
4. **A marker against a default.** On a card statement every row is a charge unless it carries `CR`.

> **A trailing minus means two different things**
>
> On a bank statement it is money leaving the account. On a card statement it is money coming back to the customer. The account type settles it.

## Income

Only count credits on `type: "bank"` accounts. A credit card's credits are the monthly repayment and merchant refunds. Summing credits across every account in a file inflates income by whatever the customer spent on the card.

Filter on account type:

```javascript
const income = doc.accounts
  .filter((a) => a.type === "bank")
  .reduce((sum, a) => sum + a.totals.credits, 0);
```

The same applies in reverse. A payment from a current account to a credit card is not spending if you also hold that card's statement for the month, because the purchases it settles are itemised there.

## Totals

|  | `totals` | `statedTotals` |
| --- | --- | --- |
| Where it comes from | Summed from the rows in this response. | Copied from the figure the issuer printed. |
| Use it to | Add up money. | Check our extraction against the document. |
| Watch out for | Nothing. It agrees with `transactions` by construction. | Convention. Amex's total new spend is net of refunds; most banks' is not. |

A gap between the two is usually a difference of convention. See [Verification](https://statementbear.com/docs/verification).

---

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