Issue importing OFX file

I am having problems importing statements from one of my banking institutions. I’ve noticed that their format is a bit different (newer version of OFX?).

The file that fails to open (error "unable to import file … using OFX importer plugin. This file is not the correct format’), is an XML file that starts with

“<?xml version="1.0" encoding="UTF-8" standalone="yes"?><?OFX OFXHEADER=“200” VERSION=“220” …”

while the formats that work start with:

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

..."

Is there a newer version of the OFX importer that can handle this format?

KMyMoney makes use of libofx to parse the OFX data. From what I can see, that last released version was created 2.5 years ago.

It seems that the XML format you receive is valid according to the OFX 2.3 specs.

The libofx README implies that it should support OFX 2.0. libofx comes with a program ofxdump, which might provide more details about exactly why it can’t read that file. Also, if you run KMyMoney from command line, it might put out a more informative message than just “unable to import…”

I tried ofxdump as suggested. Strangely, it parsed the file showing all the transactions without a problem. I thought maybe ofx plugin was using a different libofx library but both are using the same one. I don’t have any other version of libofx installed on my machine.

ldd /usr/lib64/qt5/plugins/kmymoney/ofximporter.so | grep ofx
libofx.so.7 => /lib64/libofx.so.7 (0x00007f0ad438e000)
ldd $( which ofxdump ) | grep ofx
libofx.so.7 => /lib64/libofx.so.7 (0x00007fac09568000)

I saw that libofx README also mentions ofx2qif. I tried it and it ran fine converting the file to qif format.

I tried using different parameters to ofx import dialog in kmymoney but I kept getting the same error.

Any other suggestions?
I can try downloading a single transaction from my bank tomorrow, scrubbing the private info, and uploading it here.

Yes, providing us with a sample file would be very helpful. Also, please tell us which version of KMM you are using (from the Help/About screen. or run “kmymoney -v”) and which distribution.

kmymoney version that I am using is 5.1.3
My bank offers a few different formats to download. The QBO format is parsed cleanly by ofxdumb but it fails to load into kmymoney. I missed it yesterday but OFX format produces some messages (including one error) but then it parses everything correctly. Kmymoney cannot load it either.

Here are the ofxdump messages:
LibOFX INFO: libofx_proc_file(): File format not specified, autodetecting…
LibOFX INFO: libofx_proc_file(): Detected file format: OFX (Open Financial eXchange (OFX or QFX))
LibOFX STATUS: find_dtd():DTD found: /usr/share/libofx/dtd//opensp.dcl
LibOFX STATUS: find_dtd():DTD found: /usr/share/libofx/dtd//ofx160.dtd
LibOFX INFO: Created OfxDummyContainer to hold unsupported aggregate SIGNONMSGSRSV1
(Above message occurred on Line 1, Column 151)
LibOFX INFO: Created OfxDummyContainer to hold unsupported aggregate SONRS
(Above message occurred on Line 1, Column 167)
LibOFX INFO: Created OfxDummyContainer to hold unsupported aggregate FI
(Above message occurred on Line 1, Column 293)
LibOFX ERROR: OpenSP parser: otherError (misc parse error):
/tmp/libofxtmpyxT0T5:1:340:E: element “INTU.BID” undefined

(Above message occurred on Line 1, Column 341)
LibOFX INFO: Created OfxDummyContainer to hold unsupported aggregate BANKMSGSRSV1
(Above message occurred on Line 1, Column 383)
LibOFX INFO: Created OfxDummyContainer to hold unsupported aggregate STMTTRNRS
(Above message occurred on Line 1, Column 397)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><?OFX OFXHEADER="200" VERSION="220" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?><OFX ><SIGNONMSGSRSV1><SONRS><STATUS><CODE>0</CODE><SEVERITY>INFO</SEVERITY></STATUS><DTSERVER>20250305044819.109</DTSERVER><LANGUAGE>ENG</LANGUAGE><FI><ORG>ABCD</ORG><FID>1001</FID></FI><INTU.BID>12345</INTU.BID></SONRS></SIGNONMSGSRSV1><BANKMSGSRSV1><STMTTRNRS><TRNUID>0</TRNUID><STATUS><CODE>0</CODE><SEVERITY>INFO</SEVERITY></STATUS><STMTRS><CURDEF>USD</CURDEF><BANKACCTFROM><BANKID>555555555</BANKID><ACCTID>6666666666</ACCTID><ACCTTYPE>CHECKING</ACCTTYPE></BANKACCTFROM><BANKTRANLIST><DTSTART>20250212120000.000</DTSTART><DTEND>20250212120000.000</DTEND><STMTTRN><TRNTYPE>DEBIT</TRNTYPE><DTPOSTED>20250212120000.000</DTPOSTED><TRNAMT>-100.00</TRNAMT><FITID>8a349e819506be810195596aa7454272</FITID><NAME>Payment to Such and Such</NAME><MEMO>ACH Debit - Some text 9100001</MEMO></STMTTRN></BANKTRANLIST><LEDGERBAL><BALAMT>123.45</BALAMT><DTASOF>20250305044819.109</DTASOF></LEDGERBAL><AVAILBAL><BALAMT>80345.19</BALAMT><DTASOF>20250305044819.109</DTASOF></AVAILBAL></STMTRS></STMTTRNRS></BANKMSGSRSV1></OFX>

See that blank after OFX? That is what is causing the trouble because KMyMoney searches for <OFX> (without the blank) and does not find it.

I’ve browsed through a copy of the OFX 2.1.1 specs, and can’t find exactly where that entity is defined. However, their doc with examples always uses without the space, so I suppose the legality of the space (especially at the end of a line) might depend on the XML standard. However, even if the bank is wrong, I think we all know how likely any of us to get them to change.
Would it make sense for KMM to allow any whitespace (or none) between “<OFX” and “>” ?

Already changed.