[GNC] AqBanking help for Citi CC

Jim Maki jim.maki at bitbender.org
Wed Oct 24 00:10:30 EDT 2018


I just successfully set up GnuCash to download Citi credit card data 
using AqBanking - for now all you have to do is add a space to the end 
of your userid (assuming everything else is correct).The issue seems to 
be with Citi ...

When it consistently failed with code 403, I turned on OFX logging 
(export AQOFX_LOG_COMM=1), snagged the OFX request (from /tmp/ofx.log), 
formatted it to make it more readable, and created a bash script using 
curl to make the OFX request. Paradoxically it worked while the 
equivalent un-beautified GnuCash request failed.

After little debugging, the key lines in the GnuCash ofx.log were:

================== OFX ==================
...
... <USERID>myuserid
<USERPASS>mypassword
...
================== OFX ==================

The above will work if you add a space either at the end of the 
"...<USERID>myuserid" line, or before "<USERPASS>" in the next line. At 
the GnuCash user interface level that involves adding a trailing space 
to the AqBanking userid for Citi.

For reference, below is the OFX template file I use to feed my 
curl-based script. Eventually GnuCash makes an equivalent request. 
(Again, eliminate the leading spaces before "<USERPASS>" and it, too fails.)

================== OFX ==================
OFXHEADER:100
DATA:OFXSGML
VERSION:103
SECURITY:NONE
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:$OFX_DATETIME

<OFX>
<SIGNONMSGSRQV1>
<SONRQ>
<DTCLIENT>$OFX_DATETIME
<USERID>$OFX_USER
<USERPASS>$OFX_PW
<LANGUAGE>ENG
<FI>
<ORG>$OFX_ORG
<FID>$OFX_FID
</FI>
<APPID>QWIN
<APPVER>2400
</SONRQ>
</SIGNONMSGSRQV1>
<CREDITCARDMSGSRQV1>
<CCSTMTTRNRQ>
<TRNUID>$OFX_DATETIME
<CLTCOOKIE>1
<CCSTMTRQ>
<CCACCTFROM>
<ACCTID>$OFX_ACCOUNT
</CCACCTFROM>
<INCTRAN>
<DTSTART>$OFX_STARTDATE
<DTEND>$OFX_ENDDATE
<INCLUDE>Y
</INCTRAN>
</CCSTMTRQ>
</CCSTMTTRNRQ>
</CREDITCARDMSGSRQV1>
</OFX>
================== OFX ==================

If GnuCash did prettified SGML it would avoid this problem with Citi's 
parsing.

   Jim



More information about the gnucash-user mailing list