Importing South African bank statements into ERPNext

Cylon Consulting

ERPNext can't read the OFX files South African banks export, and every bank's file is a little different. Here is what we found when we built an import for five of them.

Bank reconciliation is where an accounting system earns its keep, and it starts with getting the bank’s transactions into the system. ERPNext has a good reconciliation tool, but it has no way to read OFX, the statement format offered for download by Nedbank, FNB, Standard Bank, Investec and ABSA. Without it, finance teams download a CSV, rework the columns until ERPNext will accept them, and do the same again next month.

We built an OFX import for ERPNext and tested it against real statement exports from five South African banks. This is what we learned along the way.

Five banks, two formats

OFX comes in two generations: the older 1.x format, which looks like loosely structured markup, and the newer 2.0 format, which is strict XML. You might expect the big banks to have moved to the newer one. Most haven’t.

Bank Format of the export
Nedbank OFX 2.0 (XML)
FNB OFX 1.0.2
Standard Bank OFX 1.0.2
Investec OFX 1.0.2
ABSA OFX 1.x

Three of the four largest banks export the older format, so an import that only understood the newer one would have failed for all but one of the five banks we tested.

The same information, in different places

Even within one format, each bank fills in the file its own way:

None of this is visible to the person doing the import. They upload the file and get the right transactions in the right account.

What the import does

  1. Upload and preview. Choose the company and bank account, attach the bank’s OFX file, and the import fills in the account, bank and statement period from the file so you can check you have the right one.
  2. Create the transactions. Each statement line becomes a standard Bank Transaction in ERPNext. Lines with no amount, such as “brought forward” and “carried forward” rows, are skipped.
  3. Skip what’s already there. Every bank gives each transaction its own ID. If a line has already been imported, it is skipped, so uploading the same statement twice, or an overlapping one, never creates duplicates.
  4. Reconcile as usual. Matching against payments, journal entries and invoices happens in ERPNext’s own Bank Reconciliation Tool. Nothing about the normal reconciliation process changes.

Banks without OFX

Capitec, TymeBank, Discovery, Bidvest and African Bank don’t offer an OFX export. For those, ERPNext’s standard bank statement import with a CSV file is still the way in.

In use, and open source

The import runs for a South African franchise retailer, and it is now open source and free for any ERPNext user. The code is on GitHub (opens in a new tab).

Have a system that doesn't quite fit?

Tell us what you need it to do. We'll scope it with you.

Start a project