blog

BeanHub Connect - one giant leap with fully automatic bank transactions import from 12,000+ financial institutions in 17 countries for all Beancount users!

June 24, 2024
beancount
import
bank
new-feature

Importing data into your Beancount books is always hard. It is the biggest challenge all plain-text accounting book users face today, and that’s why we built BeanHub Import, open-sourced it, and made it part of the core features of BeanHub. Great news for all Beancount users today: we are glad to announce our new game-changing feature - BeanHub Connect. With BeanHub Connect, you can connect 12,000+ financial institutions in 17 countries and automatically import transactions into your Beancount books!

Connect with banks

You can now find the new connect feature, Connect Banks, under the Import menu.

List page of BeanHub Connect connected banks

Choose the country and click the Connect Bank button to connect to a bank. You should be able to see a pop-up like this:

List page of BeanHub Connect connected banks with Plaid pop-up

Here you go. We just connected with Wells Fargo.

List page of BeanHub Connect with Wells Fargo bank connected

The transactions will be automatically pulled from your bank account and written into the designed import data file paths at the schedule you set. After writing the transactions as CSV files into the import data paths, BeanHub will run beanhub-import automatically for you and will thus convert the new transactions in the CSV file into Beancount transactions if there’s a rule match.

Git diff view show newly added transactions for a commit generated by BeanHub Connect

You can change the schedule or output import file path at any time by clicking the Edit button for the particular bank connection.

Edit page of connected Wells Fargo bank

Real-life example

Most of your life’s transactions are recurring ones. You can quickly write BeanHub Import rules to match those regular transactions and generate corresponding Beancount transactions into your book. We built this product, and we surely use it ourselves every day. Here’s a real-life example with slight modifications to show how we define our import rules to automate most transactions.

inputs:
  - match: "import-data/connect/Wells Fargo/EVERYDAY CHECKING ...1234/*.csv"
    config:
      default_file: "books/{{ date.year }}.bean"
      prepend_postings:
        - account: Assets:Bank:US:WellsFargo:Checking
          amount:
            number: "{{ -amount }}"
            currency: "{{ currency | default('USD', true) }}"
  - match: "import-data/connect/Wells Fargo/WAY2SAVE® SAVINGS ...5678/*.csv"
    config:
      default_file: "books/{{ date.year }}.bean"
      prepend_postings:
        - account: Assets:Bank:US:WellsFargo:Saving
          amount:
            number: "{{ -amount }}"
            currency: "{{ currency | default('USD', true) }}"
  - match: "import-data/connect/Venmo - Personal/Personal Profile/*.csv"
    config:
      default_file: "books/{{ date.year }}.bean"
      prepend_postings:
        - account: Assets:Bank:US:Venmo
          amount:
            number: "{{ -amount }}"
            currency: "{{ currency | default('USD', true) }}"

imports:
  - name: Routines
    common_cond:
      extractor:
        equals: "plaid"
    match:
      - cond:
          desc:
            prefix: ZELLE TO JANE DOE ON
        vars:
          narration: Rent
          account: Expenses:Housing:Rent
          payee: Jane Doe
      - cond:
          desc:
            prefix: PGANDE WEB ONLINE
        vars:
          narration: PG&E Gas Service
          account: Expenses:Housing:Util:Gas:PGE
      - cond:
          desc:
            equals: Comcast
        vars:
          narration: Comcast Internet Service
          account: Expenses:Housing:Util:Internet:Comcast
      - cond:
          payee:
            one_of:
              - Safeway
              - Trader Joe's
              - Whole Foods
        vars:
          narration: Grocery shopping
          account: Expenses:Grocery
      - cond:
          desc:
            prefix: RECURRING TRANSFER TO WAY2SAVE SAVINGS REF
        vars:
          narration: Transfer money to saving
          account: Assets:Bank:US:WellsFargo:Saving
      - cond:
          desc:
            prefix: AMERICAN EXPRESS ACH PMT
        vars:
          narration: Paid American Express Blue Cash Everyday
          account: Liabilities:CreditCard:US:AMEXBlueCashEveryday
      - cond:
          desc: INTEREST PAYMENT|Interest Payment
        vars:
          narration: Interest payment
          account: Income:US:BankInterest
      - cond:
          desc:
            equals: FEDERAL TAX WITHHELD
        vars:
          narration: Interest tax withheld
          account: Expenses:Tax:Fed
      - cond:
          desc:
            prefix: ATM WITHDRAWAL AUTHORIZED ON
        vars:
          narration: "Withdraw cash"
          account: Assets:Cash
    actions:
      - txn:
          flag: "{{ '!' if pending else '*' }}"
          payee: "{{ payee | default(omit, true) }}"
          narration: "{{ narration }}"
          postings:
            - account: "{{ account }}"
              amount:
                number: "{{ amount }}"
                currency: "{{ currency | default('USD', true) }}"

  - name: Ignore unused entries
    common_cond:
      extractor:
        equals: "plaid"
    match:
    - cond:
        desc:
          prefix: RECURRING TRANSFER FROM EVERYDAY CHECKING REF
      vars: {}
    - cond:
        desc: "Venmo"
      vars: {}
    actions:
      - type: ignore

With the predefined beanhub-import rules and BeanHub Connect, your book is now in auto-pilot mode!

How it works

We integrate with Plaid to be able to import transactions from as many banks as possible. Plaid is the leading fintech startup that provides API-based links to financial institutions. Thanks to Plaid, BeanHub users can access 12,000+ financial institutions in 17 countries with the same user interface. Transactions pulled from Plaid’s API will be written as CSV files in your BeanHub repository.

Git diff view show newly added CSV lines from BeanHub Connect linked banks

As you see in the previous introduction article for BeanHub Import, one can easily import using our open-source beanhub-extract as the CSV file extractor and the beanhub-import as the import rule processor for transactions based on predefined rules. We added a new extractor, plaid, for extracting transactions provided from Plaid. With that, the data new data flow diagram would look like this:

Flow diagram of BeanHub Connect

Security

We prioritize security when building BeanHub. In our previous blog post, we described how we spent years building solid container sandbox technology to ensure the safety of processing user-uploaded data. As the engineer who built most of the BeanHub, I work for fintech companies. I am the author of Elliptic Curve Cryptography Explained, one of the most popular articles on the internet explaining how Elliptic Curve Cryptography works. I am also the finder of the 9.8 critical CVE-2019-13132 security vulnerability of the ZeroMQ library. With decades of experience in security, we built BeanHub Connect just like we would do if it were a payment processor.

For the BeanHub Connect feature, the access token and the bank transaction data are encrypted with hardware-protected keys generated specifically for your Plaid connection before being saved to the database. We adopt AWS Key Management Service as the HSM (Hardware Security Module) solution to protect the encryption keys. We set stringent rules on the AWS KMS key, allowing only specific worker nodes to decrypt them and process your financial data pulled from Plaid. These worker nodes are only for processing the BeanHub Connect data from Plaid and importing them into your books. They are very simple and robust and are made very hard to compromise. The Plaid transaction data and the access token will remain safe even if the database leaks.

Pricing changes

We always work hard to add value to our product and raise prices accordingly. For BeanHub Pro users, you can now connect up to 10 financial institutions per repository. To reflect the great value BeanHub Connect brings, we will increase the Pro price from $9 to $12 USD per month billed monthly and $11 to $15 USD per month billed annually.

We will roll out the new price on Aug 1st, 2024. Don’t miss the chance to subscribe now at the current price and enjoy the BeanHub Connect feature and other upcoming awesome features before the price goes up!

The future product roadmap

Please note that while BeanHub Connect can connect with most of the financial institutions Plaid supports, some banks, like Chase, are not yet supported. We are working hard to support them and should address the problem shortly.

In the meantime, we are already planning our next major feature. For example, we totally understand some users don’t feel comfortable with the account book hosted in the cloud. However, they may still want to enjoy a fully automatic accounting book. To address the needs, we plan to build BeanHub Connect Direct. We will add a new mode to BeanHub Connect to encrypt the data we pull from Plaid against the public key you provided. We will provide an open-sourced tool (most likely beanhub-cli) to pull the encrypted transaction data from BeanHub Connect, decrypt it with your local private key, generate the import data CSV file, and then run beanhub-import for you locally on your machine.

Another example is that while beanhub-import rules work great for recurring transactions, writing rules for one-time transactions doesn’t make sense. We are also building a user-friendly interface so our users can easily import unprocessed transactions.

Or, what about we check the current Beancount balance against the bank account balance number we pull from Plaid API and notify you if there’s a difference? As you can see, there are countless possibilities that we can build for BeanHub to make your dream feature our priority. As always, please get in touch with us at support@beanhub.io to let us know!