OFX file format

My bank has changed their OFX file format and now the import into kmymoney V5.2.0-8 doesn’t work anymore.

New format

<?xml version="1.0" encoding="UTF-8" standalone="no"?><?OFX OFXHEADER="200" VERSION="220" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?><OFX><SIGNONMSGSRSV1><SONRS><STATUS><CODE>0</CODE><SEVERITY>INFO</SEVERITY></STATUS></SONRS></SIGNONMSGSRSV1><BANKMSGSRSV1><STMTTRNRS><STMTRS><CURDEF>NZD</CURDEF><BANKTRANLIST><STMTTRN><FITID>2340</FITID><TRNTYPE>DEBIT</TRNTYPE><MEMO>POS W/D Salta Espress-07:50</MEMO><REFNUM></REFNUM><DTPOSTED>20251102</DTPOSTED><DTUSER>20251102</DT

Old format

OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE

<OFX>
<SIGNONMSGSRSV1>
<SONRS>
<STATUS>
<CODE>0
<SEVERITY>INFO
</STATUS>
<DTSERVER>20251102
<LANGUAGE>ENG
<DTPROFUP>20251102
<DTACCTUP>20251102
</SONRS>
</SIGNONMSGSRSV1>
<BANKMSGSRSV1>
<STMTTRNRS>
<TRNUID>1
<STATUS>
<CODE>0
<SEVERITY>INFO
</STATUS>
<STMTRS>
<CURDEF>NZD
<BANKACCTFROM>
<BANKID>Download
<ACCTID>xx-xxxx-xxxxxx-xx
<ACCTTYPE>SAVINGS
</BANKACCTFROM>
<BANKTRANLIST>
<DTSTART>20251002
<DTEND>20251102
<STMTTRN>
<TRNTYPE>CREDIT

Is there a way to get the new format to work?

The fault I get is

The plugin returned the following error:
No accounts found.

Is this a manual import from the file menu or auto import from a plug-in?

As a temporary workaround, (not sure if it will work in you case), delete the tag with the question mark from the ofx file with a text editor and do a file import from the File→Import→OFX menu options.

Assuming the data received is stored in my-ofx-file.ofx, does the following comand produce an output without errors?

ofxdump my-ofx-file.ofx

yes.

andreas@Desktop4:~/Downloads$ ofxdump bad.OFX 
LibOFX INFO: libofx_proc_file(): File format not specified, autodetecting...
LibOFX ERROR: libofx_detect_file_type():Unable to open the input file bad.OFX
LibOFX INFO: libofx_proc_file(): Detected file format: UNKNOWN (File format couldn't be successfully identified)
LibOFX ERROR: libofx_proc_file(): Could not detect file format, or unsupported file format; aborting.

The ‘good’ files gets dumped without errors, just warning about invalid date format.

It’s a manual import File → import → ofx.

I’m not aware of an auto import.

I removed the first 2 tags with question mark.

It didn’t make any difference.

That confirms my fears: it’s a problem of the underlying OFX library (which is a different open source project) that does not understand that format. There’s not much KMyMoney can do about it.

Seems our friends over at GnuCash face the same problem as posted on Reddit since they also use libOFX under the hood AFAIK.

I found another comment on a website which states:

The only problem I had with it was the version of file it created, 200. The product I was importing into was expecting 100, but it was simple enough to go in and edit the file in Notepad.

Did you try to use File/Import/AqBanking importer? It does not use libofx and may be able to deal with the new format (no guarantees though).

Thanks for that idea with the AqBanking importer.

I tried it and it does the same. It can read the old file format but not the new.

I messaged my bank and they say all should be fine. They done extensive testing and all the customers (except me) are happy and it’s working.

I suppose the alternative is to use QIF or CSV format instead.

I remember using that in the past but somehow it was always lacking some details or something. It wasn’t as good as OFX format. Well, give these other formats another go then.

QIF would probably be better than CSV, which can only be used to import to one account per csv file.

Regarding the issue with OFX version (or ofxheader) of 100 or 200, the libofx readme does say OFX 2.0 is supported, but I don’t know how this is related to the ofxheader value.

@ahagele What happens if you change the ofxheader value from 200 to 100? I have no real idea whether this even SHOULD work, but it’s easy enough to try.

One other option would be to run kmymoney (or maybe just ofxdump) under a debugger, to determine exactly what triggers the errors.

Can we somehow get a sample file (e.g. with a single possibly anonymized transaction but structure unchanged) in the header version 200? You may send that as attachment to kmymoney-develop@kde.org.

I’ve emailed a short file.

Using the QIF format is not great because the parser does not detect any categories so I have to fill in categories even for repeated payees.

The OFX parser (when it used to work) did match categories. That made the processing much quicker.

I hate auto-correction. Sorry, the mailing list address I mentioned in my previous post is wrong. It’s kmymoney-devel@kde.org (no op at the end). @ahagele Would you mind sending again? TIA.