Banks
appreise connects banks through Plaid. Your bank password goes directly to Plaid in your browser, never to appreise or your AI app. Appreise (ledgerd), not the AI app, exchanges the one-time token with Plaid and stores the resulting access token encrypted with AES-256-GCM (bound to your user ID and bank item ID) in your per-user banks.json. The AI app never sees your bank password or Plaid access token.
- Connect:
connect_bankgives a link that works once, for 15 minutes. Open it in a browser, pick your bank, and sign in to it. - How far back: a new connection asks Plaid for up to 730 days (about two years) of transactions; some banks give less. Plaid fixes this when a bank is first connected. A bank connected before ledgerd 0.1.23 keeps its shorter history (about 90 days) until you disconnect it (
disconnect_bank) and connect it again. For anything older, upload the bank's statement files (upload_link). - The history arrives in two parts: right after connecting, Plaid sends about the last 30 days, and the older history over the next few hours. Until it is complete,
sync_bankssays "Plaid is still sending this bank's older history", and appreise fetches that bank every hour instead of once a day. - See what is connected:
list_bank_accountslists each account with its source name, such asplaid-chase-4821, and whether its bank needs you. - Reconnect: when a bank's login expires,
list_bank_accountsandsync_banksshow it as needing the user. Runconnect_bankwith that bank'sitem_id. This keeps its history. Reconnecting also lets you tick more accounts of the same login. - Two logins at one bank: a second login (a company's business login, say) may show an account the first one has already, such as a card both logins see. appreise keeps the second login with its other accounts and leaves the shared one with the first, so no history arrives twice. The page after the sign-in lists what was added and what was left out. A login that shows only accounts that are connected already is refused; reconnect that one instead.
- Disconnect:
disconnect_bankwith theitem_id. - A connection that fails inside Plaid: the Link page shows Plaid's error code next to its text, and what to do next. appreise keeps the last ten such failures, and
list_bank_accountslists them: when, which bank, the error code, whether the sign-in had been sent to the bank, and the advice. After a refused sign-in, do not try again in Plaid: banks lock a login after a few failed attempts. Check the password on the bank's own website first. - Chase cards: Chase reports all the cards of one credit card account as one account, so each card does not appear on its own.
Investment accounts (IRA, 401k, brokerage) are fetched through Plaid's investments product when the bank offers it, writing buys, sells, dividends, reinvestments, fees, contributions, and holding prices in the investment statement layout.
Some institutions send today's price on every investment transaction, old ones too. So a trade with cash books at its cash divided by its shares (less the fee on a buy, plus it on a sale) when the bank's price misses that by more than half a cent a share; the description notes the bank's price. A line with no cash (a vest, a transfer in) at today's price on an older date is held, and asks for its lot cost. A transfer out reduces the holding even when the bank sends a positive quantity. Cash coming into a brokerage is a transfer to Assets:Clearing, which pairs with the bank's debit; into a retirement account (a 401k or IRA, by the bank's account type) it is a contribution. To leave out lines before a date, give the source a start date: assign_bank_account (or claim_source) with start_date, also on a source assigned already.
Prices and lot costs keep up to six decimal places, as banks send them (a fund's 244.72272, a stock plan's 250.0004). Cash amounts are in cents: a cost or proceeds figure is rounded to the cent once, in the total. When a buy with no fee and no lot cost of its own has cash short of shares times price by no more than half a cent a share, the cash is what was paid, and the lot's unit cost follows from it.
Some banks send cash rows with no security on an investment account: a transfer out of a stock plan, or a buy with no ticker. book books them as cash moves, flagged ! for review. A transfer goes between the account's cash and Assets:Clearing, so match_entries can pair it with the other account. A buy or sale goes between the account's cash and its :Unidentified sub-account, until you book the position by hand. A line that book holds holds back only the later lines of the same security on that account; lines of other securities and cash lines still book.
Balances. Each fetch also reads each account's balance. list_bank_accounts proposes it as a balance check, in proposed_balance, dated the day after the fetch, because a balance assertion holds at the start of its day. A credit card or loan shows as a negative amount, because it is money you owe. There is no proposal while the account has pending transactions, because the bank's balance includes them, and the statements do not. There is none either while some of its transactions are held, waiting for a repository.
The AI app shows you each proposal and asks before it writes one. When you approve it, assert_balance writes it to invariants.beancount. From then on, check fails if a transaction before that day goes missing or is typed wrong. If the ledger does not reach the bank's balance yet, nothing changes, and the error says what may be missing.