The QuickBooks Online API includes a Reports API that is used to query a financial report. This topic provides an overview of the report response by showcasing the profit and loss report.
A profit and loss report, also known as the Income Statement, summarizes income and expenses for the company. The report shows subtotals for each income and expense account in the chart of accounts. The report is divided into sub-sections corresponding to the various income and expense groups, and within the groups a row corresponding to each account having data. Accounts with no data are excluded from the report. The total for each sub-section is rolled up into its individual summary, with the last line of the report showing the net income or loss.
As a best practice, limit the date range specified in a report request to six months.
To follow along, you’ll need a sandbox or another QuickBooks company populated with a chart of accounts, customers, and items. The examples in this tutorial use the sandbox company.
Summary of available reports
|QuickBooks Report Name||Reports API Endpoint||Java||.NET||PHP|
|Profit and Loss||ProfitAndLoss||√||√||√|
|Profit and Loss Detail||ProfitAndLossDetail||√|
|Trial Balance||Trial Balance||√||√||√|
|Statement of Cash Flows||CashFlow||√||√||√|
|Inventory Valuation Summary||InventoryValuation||√||√||√|
|Sales by Customer Summary||CustomerSales||√||√||√|
|Sales by Product/Service Summary||ItemSales||√||√||√|
|Sales by Department Summary||DepartmentSales||√||√||√|
|Sales by Class Summary||ClassSales||√||√||√|
|Income by Customer Summary||CustomerIncome||√||√||√|
|Manage Accounts Receivable||√|
|Customer Balance Summary||CustomerBalance||√||√||√|
|Customer Balance Detail||CustomerBalanceDetail||√|
|A/R Aging Summary||AgedReceivables||√||√||√|
|A/R Aging Detail||AgedReceivableDetail||√|
|Manage Accounts Payable||√|
|Vendor Balance Summary||VendorBalance||√||√||√|
|Vendor Balance Detail||VendorBalanceDetail||√||√||√|
|A/P Aging Summary||AgedPayables||√||√||√|
|A/P Aging Detail||AgedPayableDetail||√||√||√|
|Review Expenses and Purchases|
|Expenses by Vendor||VendorExpenses||√||√||√|
|Tax Summary (France region, only)||TaxSummary|
Overview of the report response
The structure of each sub-section echoes that in the chart of accounts. That is, the nesting structure of the chart of accounts is preserved in the report, which can create several nested levels of data. The data returned in the report is subject to one or more filter query parameters submitted with the request.
A report response consists of three sections:
Transaction compliance dates
Reports list transaction compliance dates rather than the actual transaction dates. Consider the following examples:
|Non-payment transaction date||Non-payment transaction due date||Payment transaction date||Compliance date|
|February 6, 2017||February 6, 2017||February 1, 2017—prepaid||February 6, 2017|
|February 1, 2017||February 1, 2017||February 6, 2017||February 6, 2017|
Of particular note, for a transaction where the payment date is before the transaction date, the compliance date is the original transaction date. This correctly accounts for the revenue and any tax liabilities within the intended financial period.
Sample report responses
Report with no data
This is the response for a report that contains no data: there is no data for the resulting date range, which in this case is January 1, 2014 to February 5, 2014. The resulting report has a single column with the default Profit and Loss groups. It is not very interesting, but serves to show the basic report structure.
Report with customer filtering
This section showcases a P&L report for a specific customer for the last quarter. To view the complete response, click here.
1 2 3 4 5
https://quickbooks.api.intuit.com/v3/company/<realmID>/reports/ProfitAndLoss? start_date=2015-01-01& end_date=2015-07-31& customer=1& summarize_column_by=Customers
The image below shows the column structure. The report response has been excerpted in the interest of space.
The next image showcases a part of the Income section of the same report response. Here you can see the nested nature of the accounts and how they map to rows in the response. The report response has been excerpted in the interest of space.
The report object structure
The table below lists all possible attributes that can be returned in the report response. All values are not localized unless indicated. Click here to download the latest XSD.
|→Time||DateTime||Date and timestamp of the report.|
|→ReportName||String||Name of the report.|
|→ReportBasis||ReportBasisEnum||Accounting method. Possible values include Cash and Accrual.|
|→StartPeriod||String||The date specified by the start_date query parameter submitted with the request. Format is yyyy-mm-dd.|
|→EndPeriod||String||The date specified by the end_date query parameter submitted with the request. Format is yyyy-mm-dd.|
|→SummarizeColumnsBy||SummarizeColumnsByEnum||The method by which report columns are organized. This contains the value specified by the summarize_column_by query parameter submitted with the request.|
|→Currency||String||A string containing the currency code associated with the report.|
|String||A string containing the Ids as specified with the corresponding filter query parameter. Only those filter query parameters specified in the request are returned in the header.|
|→Option||Container for one or more name/value pairs that return additional information about the report contents.|
|Columns||Top level container holding information for report columns or subcolumns.|
|→Column [0..n]||Container for an individual report column definition.|
The column label. This string appears at the top of the column. If not defined, the column does not have a label.
The value of this attribute is localized.
The type of information found in the column. Possible values include:
|Rows||Top level container holding report rows.|
Represents a row in a report. A group of rows is enclosed in a <Rows> container. Rows may be nested either as a single row or in sets, based on the accounts represented in the report and query parameters specified in the request. Parameters:
Information for each column of a leaf row <Row type=Data>. There must be a <ColData> definition for each column defined in the <Columns> section. Parameters:
|→→Header||Header row for a report section.|
Information for each column of the header row. There must be a <ColData> definition for each column defined in the <Columns> section. Parameters:
|→→Rows||Container for one or more leaf rows.|
|→→Summary||Summary row for a report section. It is the cumulative total amount of money in the account, including the sub accounts.|
|→→→ColData [0..n]||Information for each column of the summary row. There must be a <ColData> definition for each column defined in the <Columns> section. Parameters: - id—The reference id of the entity as returned in the Identity field. Returned where applicable. - value—The value for column. The type of value is based on the column type.|
View the full Reports API reference here.