I am creating an overview page for a customer which gets invoice and sales data from Quickbooks using QBXML via a PHP app and web connector.
The customer would like me to include the balance sheet (for the requested date(s)). Is it possible to retrieve this directly, or do I have to get all the item and account data and calculate it myself?
This is definitely possible to do.
Using qbXML and the Web Connector, you can send QuickBooks a qbXML request asking it to generate the report, and return the report data to you. The report data is returned in a nice parseable XML format.
If you look at the OSR:
You'll find an option for:
If you use that syntax to send a qbXML request something like:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<GeneralSummaryReportQueryRq>
<GeneralSummaryReportType>BalanceSheetStandard</GeneralSummaryReportType>
<DisplayReport>false</DisplayReport>
<ReportPeriod>
<FromReportDate>2013-01-01</FromReportDate>
<ToReportDate>2014-01-01</ToReportDate>
</ReportPeriod>
</GeneralSummaryReportQueryRq>
</QBXMLMsgsRq>
</QBXML>
You'll get back a nicely formatted row/column XML document with all the balance sheet details.
More details on this QuickBooks qbXML example site and QuickBooks wiki.