Topic: How to get Wellsfargo bank transcations

Greetings,

I want to download the transactions from wellsfargo bank account where i will supply all the credentials. can any one help me to connect the Wellsfargo Bank and download the transactions using OFX server. here is my code that i am trying to connect and get the response. Please do the needful.


        public void OFXDownload(RequestType ofx_RequestType, string userName, string password, string AccountID, string BankID, string org, string FID)
        {
            _UserName = userName;
            _Password = password;
            CurrGuid = Guid.NewGuid().ToString();
            string clientDate = null;
            clientDate = DateTime.Now.ToString("yyyyMMddhhmmss");

            DataBuffer.AppendLine("OFXHEADER:100");
            DataBuffer.AppendLine("DATA:OFXSGML");
            DataBuffer.AppendLine("VERSION:102");
            DataBuffer.AppendLine("SECURITY:NONE");
            DataBuffer.AppendLine("ENCODING:USASCII");
            DataBuffer.AppendLine("CHARSET:1252");
            DataBuffer.AppendLine("COMPRESSION:NONE");
            DataBuffer.AppendLine("OLDFILEUID:NONE");
            DataBuffer.AppendLine("NEWFILEUID:NONE");
            DataBuffer.AppendLine();
            DataBuffer.AppendLine("<OFX>");
            DataBuffer.AppendLine("<SIGNONMSGSRQV1>");
            DataBuffer.AppendLine("<SONRQ>");
            DataBuffer.AppendLine("<DTCLIENT>" + clientDate);
            DataBuffer.AppendLine("<USERID>" + userName);
            DataBuffer.AppendLine("<USERPASS>" + password);
            DataBuffer.AppendLine("<LANGUAGE>ENG");
            DataBuffer.AppendLine("<FI>");
            DataBuffer.AppendLine("<ORG>" + org);
            DataBuffer.AppendLine("<FID>" + FID);
            DataBuffer.AppendLine("</FI>");
            DataBuffer.AppendLine("<APPID>QWIN");
            DataBuffer.AppendLine("<APPVER>0900");
            DataBuffer.AppendLine("</SONRQ>");
            DataBuffer.AppendLine("</SIGNONMSGSRQV1>");
            _RequestType = ofx_RequestType;
            switch (ofx_RequestType)
            {
                case RequestType.AccountList:
                    DataBuffer.AppendLine("<SIGNUPMSGSRQV1>");
                    DataBuffer.AppendLine("<ACCTINFOTRNRQ>");
                    DataBuffer.AppendLine("<TRNUID>" + CurrGuid);
                    DataBuffer.AppendLine("<CLTCOOKIE>4");
                    DataBuffer.AppendLine("<ACCTINFORQ>");
                    DataBuffer.AppendLine("<DTACCTUP>19700101000000");
                    DataBuffer.AppendLine("</ACCTINFORQ>");
                    DataBuffer.AppendLine("</ACCTINFOTRNRQ>");
                    DataBuffer.AppendLine("</SIGNUPMSGSRQV1>");
                    DataBuffer.AppendLine("</OFX>");
                    break;
                case RequestType.AccountActivity:
                    DataBuffer.Append("<BANKMSGSRQV1>");
                    DataBuffer.Append("<STMTTRNRQ>");
                    DataBuffer.Append("<TRNUID>" + CurrGuid);
                    DataBuffer.Append("<STMTRQ>");
                    DataBuffer.Append("<BANKACCTFROM>");
                    DataBuffer.Append("<BANKID>" + BankID);
                    DataBuffer.Append("<ACCTID>" + AccountID);
                    DataBuffer.Append("<ACCTTYPE>CHECKING");
                    DataBuffer.Append("</BANKACCTFROM>");
                    DataBuffer.Append("<INCTRAN>");
                    DataBuffer.Append("<INCLUDE>Y");
                    DataBuffer.Append("</INCTRAN>");
                    DataBuffer.Append("</STMTRQ>");
                    DataBuffer.Append("</STMTTRNRQ>");
                    DataBuffer.Append("</BANKMSGSRQV1>");
                    DataBuffer.Append("</OFX>");

                    break;
                //later
            }
        }

        public string Download(RequestType ofx_RequestType, string userName, string password, string AccountID, string BankID, string org, string FID)
        {
            OFXDownload(ofx_RequestType, userName, password, AccountID, BankID, org, FID);
            byte[] byteBuffer = Encoding.ASCII.GetBytes(DataBuffer.ToString());
            StreamReader responseReader = default(StreamReader);
         
            //objReq = HttpWebRequest.Create(new Uri("https://ofx.chase.com")) as HttpWebRequest;
            objReq = HttpWebRequest.Create(new Uri("https://ofx.wellsfargo.com")) as HttpWebRequest;         
            objReq.Method = "POST";
            objReq.ContentType = "application/x-ofx";
            objReq.Accept = "*/*, application/x-ofx";
            objReq.ContentLength = byteBuffer.Length;
            System.Net.ServicePointManager.Expect100Continue = false;
            ReqStream = objReq.GetRequestStream();
            ReqStream.Write(byteBuffer, 0, byteBuffer.Length);
            ReqStream.Close();
            //objResponse = objReq.GetResponse();
            objResponse = (HttpWebResponse)objReq.GetResponse();

            ResponseStream = objResponse.GetResponseStream();
            responseReader = new StreamReader(ResponseStream);
            _ResponseString = responseReader.ReadToEnd();
            switch (_RequestType)
            {
                case RequestType.AccountActivity:
                    ParseBankItems();
                    break;
                case RequestType.AccountList:
                    ParseAccountList();
                    break;
            }

            return _ResponseString;
        }

Re: How to get Wellsfargo bank transcations

What happens when you issue this request?

Your OFX request looks basically correct.  You probably want an APPVER of 1900 instead of 0900.  You may also try dropping the CLTCOOKIE and TRNUID tags and see how that goes.

Jesse

Re: How to get Wellsfargo bank transcations

Hello Jesse,

Thanks for the Response. I had modified the code as you suggested and changed the HtppWebRequest to "https://ofxdc.wellsfargo.com/ofx/process.ofx". But the Code is returning this Error "The remote server returned an error: (400) Bad Request." Can you please suggest the HttpWebRequest URL for Wellsfargo bank.

Thanks in Advance
Girish.G

Re: How to get Wellsfargo bank transcations

I've worked my way through your code today, and I've gotten as far as getting a valid response from Wells.  Unfortunately the response is "your account isn't valid".  Actual message is:
  <CODE>2000
  <SEVERITY>ERROR
  <MESSAGE>We are unable to process your request at this time. Please try again later or contact us at 1-800-956-4442.

My boss is working through getting a login that is tied to a "signer" on the account.  Here is the relevant data I needed modifying only slightly from your original.  I don't know if the differences in the <ORG> and <FID> are due to where my account is within the Wells system, but I'll be interested to hear if this request data works for you:

            sb.AppendLine("OFXHEADER:100");
            sb.AppendLine("DATA:OFXSGML");
            sb.AppendLine("VERSION:102");
            sb.AppendLine("SECURITY:NONE");
            sb.AppendLine("ENCODING:USASCII");
            sb.AppendLine("CHARSET:1252");
            sb.AppendLine("COMPRESSION:NONE");
            sb.AppendLine("OLDFILEUID:NONE");
            sb.AppendLine("NEWFILEUID:NONE");
            sb.AppendLine();
            sb.AppendLine("<OFX>");
            sb.AppendLine("<SIGNONMSGSRQV1>");
            sb.AppendLine("<SONRQ>");
            sb.AppendLine("<DTCLIENT>" + clientDate);
            sb.AppendLine("<USERID>" + userName);
            sb.AppendLine("<USERPASS>" + password);
            sb.AppendLine("<GENUSERKEY>N");
            sb.AppendLine("<LANGUAGE>ENG");
            sb.AppendLine("<FI>");
            sb.AppendLine("<ORG>WF"); //" + org);
            sb.AppendLine("<FID>12721"); // + FID);
            sb.AppendLine("</FI>");
            sb.AppendLine("<APPID>QBW");
            sb.AppendLine("<APPVER>2100");
            sb.AppendLine("</SONRQ>");
            sb.AppendLine("</SIGNONMSGSRQV1>");
...
            case RequestType.AccountList:
            sb.AppendLine("<SIGNUPMSGSRQV1>");
            sb.AppendLine("<ACCTINFOTRNRQ>");
            sb.AppendLine("<TRNUID>" + CurrGuid);
            sb.AppendLine("<ACCTINFORQ>");
            sb.AppendLine("<DTACCTUP>19900101");
            sb.AppendLine("</ACCTINFORQ>");
            sb.AppendLine("</ACCTINFOTRNRQ>");
            sb.AppendLine("</SIGNUPMSGSRQV1>");
            sb.AppendLine("</OFX>");
...

            case RequestType.AccountActivity:
            sb.AppendLine("<BANKMSGSRQV1>");
            sb.AppendLine("<STMTTRNRQ>");
            sb.AppendLine("<TRNUID>" + CurrGuid);
            sb.AppendLine("<STMTRQ>");
            sb.AppendLine("<BANKACCTFROM>");
            sb.AppendLine("<BANKID>" + BankID);
            sb.AppendLine("<ACCTID>" + AccountID);
            sb.AppendLine("<ACCTTYPE>CHECKING");
            sb.AppendLine("</BANKACCTFROM>");
            sb.AppendLine("<INCTRAN>");
            sb.AppendLine("<INCLUDE>Y");
            sb.AppendLine("</INCTRAN>");
            sb.AppendLine("</STMTRQ>");
            sb.AppendLine("</STMTTRNRQ>");
            sb.AppendLine("</BANKMSGSRQV1>");
            sb.AppendLine("</OFX>");
...

Re: How to get Wellsfargo bank transcations

Hello gStorm,

Thanks alot, it had worked for me and i am able to download the transactions successfully from Wells Fargo Account.

I still had to check this code with JP Morgan Chase Bank account. does it work directly or do we need to change any tags. Please suggest. your help is appreciable. Thanks in advance.

Re: How to get Wellsfargo bank transcations

I've gotten a valid response from Chase using:
                    URL = "https://www.oasis.cfree.com/1601.ofxgp "
                    FID = "1601"
                    BankId = <my routing #>
                    Org = "Chase Bank"

I'm going to have to yank my boss' chain, because I get basically the same response from Chase as from Wells -- "your login isn't allowed to do this!"  Chase, or Fiserv (aka CheckFree), seems to follow the spec more closely than Wells.  Wells gave me Code=2000, where Chase gives me Code=15500.

I'm going to assume the code is good-to-go that we've discussed here, and I'll post again if I am having other issues than setting up the login accounts at each bank.

Please let me know how your testing goes with Chase.

Re: How to get Wellsfargo bank transcations

Hello gStrom

Again i had a Query. i want to download the transactions from specific date range, or at least transactions has to download from starting date specified by user. Please suggest.

Thanks in advance.

Re: How to get Wellsfargo bank transcations

The detailed spec can be downloaded here: http://www.ofx.net/DownloadPage/Downloads.aspx

Here is what I'm using with Wells:

            sb.AppendLine("<INCTRAN>");
            sb.AppendLine("<DTSTART>20120310");
            sb.AppendLine("<DTEND>20120313");
            sb.AppendLine("<INCLUDE>Y");
            sb.AppendLine("</INCTRAN>");

Still hoping to get setup with Chase soon.  Will post back if Chase presents any new challenges.

Re: How to get Wellsfargo bank transcations

Hello gStrom,

I had tried to connect the Chase bank with the detail above and i was not able to download the trasactions. Please Check my code below

            DataBuffer.AppendLine("OFXHEADER:100");
            DataBuffer.AppendLine("DATA:OFXSGML");
            DataBuffer.AppendLine("VERSION:102");
            DataBuffer.AppendLine("SECURITY:NONE");
            DataBuffer.AppendLine("ENCODING:USASCII");
            DataBuffer.AppendLine("CHARSET:1252");
            DataBuffer.AppendLine("COMPRESSION:NONE");
            DataBuffer.AppendLine("OLDFILEUID:NONE");
            DataBuffer.AppendLine("NEWFILEUID:NONE");
            DataBuffer.AppendLine();
            DataBuffer.AppendLine("<OFX>");
            DataBuffer.AppendLine("<SIGNONMSGSRQV1>");
            DataBuffer.AppendLine("<SONRQ>");
            DataBuffer.AppendLine("<DTCLIENT>" + clientDate);
            DataBuffer.AppendLine("<USERID>" + userName);
            DataBuffer.AppendLine("<USERPASS>" + password);
            DataBuffer.AppendLine("<LANGUAGE>ENG");
            DataBuffer.AppendLine("<FI>");
            DataBuffer.AppendLine("<ORG>" + org);
            DataBuffer.AppendLine("<FID>" + FID);
            DataBuffer.AppendLine("</FI>");
            DataBuffer.AppendLine("<APPID>QWIN");
            DataBuffer.AppendLine("<APPVER>1900");
            DataBuffer.AppendLine("</SONRQ>");
            DataBuffer.AppendLine("</SIGNONMSGSRQV1>");

-------

DataBuffer.Append("<BANKMSGSRQV1>");
                    DataBuffer.Append("<STMTTRNRQ>");
                    DataBuffer.Append("<TRNUID>" + CurrGuid);
                    DataBuffer.Append("<STMTRQ>");
                    DataBuffer.Append("<BANKACCTFROM>");
                    DataBuffer.Append("<BANKID>" + BankID);
                    DataBuffer.Append("<ACCTID>" + AccountID);
                    DataBuffer.Append("<ACCTTYPE>CHECKING");
                    DataBuffer.Append("</BANKACCTFROM>");
                    DataBuffer.Append("<INCTRAN>");
                    //DataBuffer.Append("<DTSTART>20120301");
                    //DataBuffer.Append("<DTEND>20120331");
                    DataBuffer.Append("<INCLUDE>Y");
                    DataBuffer.Append("</INCTRAN>");
                    DataBuffer.Append("</STMTRQ>");
                    DataBuffer.Append("</STMTTRNRQ>");
                    DataBuffer.Append("</BANKMSGSRQV1>");
                    DataBuffer.Append("</OFX>");

    I was passing the values :
      ORG = Chase Bank
      FID = 1601
      objReq = HttpWebRequest.Create(new Uri("https://www.oasis.cfree.com/1601.ofxgp")) as HttpWebRequest;
      BankID =111000614  (Routing Number)
And bank account number, Username, Password.


Please see my response string :
OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:NONE
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE

<OFX>
<SIGNONMSGSRSV1>
<SONRS>
<STATUS>
<CODE>15500
<SEVERITY>ERROR
</STATUS>
<DTSERVER>20120328115354
<LANGUAGE>ENG
<DTPROFUP>19700101000000
<DTACCTUP>19700101000000
<FI>
<ORG>Chase Bank
<FID>1601
</FI>
</SONRS>
</SIGNONMSGSRSV1>
<BANKMSGSRSV1>
<STMTTRNRS>
<TRNUID>bb0b89d4-4e89-418b-bdd8-92e634443e92
<STATUS>
<CODE>15500
<SEVERITY>ERROR
</STATUS>
</STMTTRNRS>
</BANKMSGSRSV1>
</OFX>


Please help me to download the transactions from chase bank.

Re: How to get Wellsfargo bank transcations

I haven't poured through your code listing, but let's check the most-basic thing first.  The URL I'm successfully using is: https://ofx.chase.com.  The URL posted above was wrong -- at least for my account(s).

Re: How to get Wellsfargo bank transcations

I think the problem is with your date format. The dates should be in OFX format: YYYYMMddHHmmss.xxx[G:Z].

Try to set StartDate and EndDate in this format and see if that works for you.

Re: How to get Wellsfargo bank transcations

I tried connecting to the feed but the response returned was : Server returned HTTP response code: 500.

URL : https://ofxdc.wellsfargo.com/ofx/process.ofx
Timestamp :  YYYYMMddHHmmss.xxx[G:Z]
APPID : QWIN
APPVER : 2600

Could anyone suggest what to use for APPID and APPVER for the same?

Re: How to get Wellsfargo bank transcations

I'm still using QWIN and 2400.  Is this Chase or Wells?  Chase has moved to Version:103, and they require the setup of a Client UID.  Wells is working with Version:102.