Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I use python3, to construct qbXML queries, and Elementree to parse the responses. I use a non-Windows machine for developement, too. I found that I really needed QB and Python together in a Windows VM to make progress. Both QB and COM require it.</p> <p>Here are a couple snippets in Python 3.1 to show how I do it:</p> <p>First, use COM to connect to QuickBooks and disconnect from QuickBooks.</p> <pre><code>import win32com.client def start(external_application_name): """Connect a QuickBooks instance using COM. Start QB if needed""" SessionManager = win32com.client.Dispatch("QBXMLRP2.RequestProcessor") # Example only - insecure! SessionManager.OpenConnection('', external_application_name) return SessionManager def stop(SessionManager): """Disconnect from the existing Quickbooks instance.""" SessionManager.CloseConnection() return </code></pre> <p>Next, I use python to do the logic, construct the qbXML queries, and parse the responses into an ElementTree.</p> <pre><code>import xml.etree.ElementTree as etree def xml_query(QB_SessionManager, company_file_path, qbXML_query_string): """ Do a QuickBooks QBXML query. The query must be valid - this function doesn't do error checking. Return an ElementTree of the XML response. """ ticket = QB_SessionManager.BeginSession(company_file_path, 0) response_string = QB_SessionManager.ProcessRequest(ticket, qbXML_query_string) #print(response_string) # Debug tool SessionManager.EndSession(ticket) QBXML = etree.fromstring(response_string) response_tree = QBXML.find('QBXMLMsgsRs') #etree.dump(QBXML) # Debug tool return response_tree </code></pre> <p>The actual qbXML query string and response string for a check query are on the qbXML reference at <a href="https://member.developer.intuit.com/qbSDK-current/Common/newOSR/index.html" rel="nofollow">https://member.developer.intuit.com/qbSDK-current/Common/newOSR/index.html</a> There, you will see that you can download the check data filtered by payee, date range, check number range, etc. </p> <p>You can chain multiple XML queries or transactions into a single large XML file. Assign each a unique request number (Example: <code>&lt;CustomerQueryRq requestID="1"&gt;</code> ), so you can locate the proper response.</p> <p>Use the <code>&lt;IncludeRetElement&gt;</code> tag to limit the reply size, and speed the search tremendously.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload