I want to learn how to download bank transactions using the Open Financial Exchange (ofx) file format. I would like to send the request from my website using PHP.
I have not found any PHP examples of using the ofx file format to send a request to connect to a bank in order to download bank transactions. I have only been able to find examples of parsing the data returned.
I have found websites like www.ofxhome.com that provide URLs (and other bank information) to connect to banks. But I do not know how to send a request to the bank using the ofx file format.
For example, using the information from this ofxhome.com link... http://www.ofxhome.com/index.php/institution/view/472 How can I send a request to the bank using the ofx format and PHP? And how to I save the ofx file returned so I may parse and use the information returned?
Many thanks for your help!
UPDATE: I found a working example. It is exactly what I was looking for, ofx request using PHP. Here is a link: http://www.ofxhome.com/ofxforum/viewtopic.php?id=47419
According to the OFX API documentation (http://www.ofxhome.com//api.txt) they use XML.
You may want to research the following:
In your program, the first step would probably would be grabbing the index of all institutions (view source):
http://www.ofxhome.com/api.php?all=yes
Then referencing the ID values from step 1 in a lookup query for a specific institution:
http://www.ofxhome.com/api.php?lookup=424