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:
- Who the money came from or went to sits in a “name” field in Nedbank and Investec files, and in a “memo” field in FNB and Standard Bank files. The import checks both.
- Account numbers are printed on statements with dashes and leading zeros, but some banks put only the bare digits in the file. The import compares the two ignoring formatting, so the file is matched to the right bank account in ERPNext.
- Dates come as a plain date from most banks, and as a date with a time from Investec. The import uses the date and ignores the time.
- Character set: Investec’s files declare a character set that the file reader we use rejected. The import corrects the declaration before reading the file.
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
- 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.
- 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.
- 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.
- 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).