QuickBooks Desktop profit and loss report API

QuickBooks' standard profit and loss: income, cost of goods sold, expenses and net income for a period. It is QuickBooks' own report (qbXML GeneralSummaryReportQuery (ProfitAndLossStandard)), so the numbers match what you see in QuickBooks for the same period and basis.

Endpoint

GET/v1/files/{file_id}/reports/profit-and-loss

With no parameters you get the scheduled copy (this year to date), refreshed when it is older than 6 hours. Another period is read at the next Web Connector check-in and answered as a queued job (how queued reads work).

Parameters

ParameterInTypeDescription
file_id (required)pathstringThe company file id (file_...), from GET /v1/files.
date_fromquerydatePeriod start (YYYY-MM-DD). Default the start of this year.
date_toquerydatePeriod end (YYYY-MM-DD). Default today.
basisquerystring: accrual, cashaccrual or cash. Default: the company file's preference.
shapequerystring: table, rows, longtable (default for JSON), rows (default for CSV) or long.
if_queuedquerystring: errorerror: for clients that can't come back later, such as a scheduled sheet refresh. Instead of 202, a no-copy file answers 409 no_copy_kept at once and nothing is queued; a report QuickBooks hasn't sent yet answers 409 report_not_ready (it is still asked for at the next check-in).
formatquerystring: json, csvjson (default) or csv. Accept: text/csv works too.

Response format

shape=table (the JSON default) returns the report as QuickBooks lays it out: the title, basis and period, the column titles, and rows with a kind (data, subtotal, total or text), a label, the cells and a depth for indenting. shape=rows (the CSV default) gives one row per line with a key per column; shape=long gives one row per line and column, ready for a pivot table.

Fields of a row (shape=rows)
FieldTypeDescription
topstringThe top heading, or the line itself when nothing is above it (the customer on aging and job reports).
sectionstring
categorystringIncome, Cost of Goods Sold, Expense, Other Income, Other Expense, or the balance sheet section.
groupstringThe heading right above the line.
pathstringEvery heading above the line and the line, joined with ' > '.
linestring
depthinteger
kindstring: data, subtotal, total
StatusMeans
200OK
202The company file keeps no copy here. The answer arrives at the next Web Connector check-in; read the job then.
400A parameter isn't valid, or the key was put in the URL.
401No key, or the key isn't valid.
404No such company file, record or job for this key.
409if_queued=error was sent and the answer would have had to wait for the next check-in: the company file keeps no copy (no_copy_kept), or QuickBooks hasn't sent this report yet (report_not_ready). Run it again after the check-in.
429More than 60 requests a minute with this key. Retry-After says when to try again.

Example

curl -H "Authorization: Bearer dbk_your_key" "https://desktop-app.greatwork.company/v1/files/file_8f2c41/reports/profit-and-loss?date_from=2026-01-01&date_to=2026-10-31&basis=accrual"
{
  "object": "report",
  "report": "profit-and-loss",
  "file_id": "file_8f2c41",
  "shape": "table",
  "table": {
    "title": "Profit & Loss",
    "columns": [
      "",
      "Jan 1 - Nov 27, 26"
    ],
    "rows": [
      {
        "kind": "data",
        "label": "Construction Income",
        "cells": [
          null,
          412880
        ],
        "depth": 1
      },
      {
        "kind": "subtotal",
        "label": "Total Income",
        "cells": [
          null,
          412880
        ],
        "depth": 0
      },
      {
        "kind": "total",
        "label": "Net Income",
        "cells": [
          null,
          61240.15
        ],
        "depth": 0
      }
    ]
  },
  "synced_at": "2026-11-27T07:04:12-06:00",
  "as_of": "2026-11-27T07:03:58-06:00"
}

About this report

Accrual or cash, and who decides

QuickBooks Desktop keeps a company preference for whether summary reports run on accrual or cash basis (Edit > Preferences > Reports & Graphs > Company Preferences; Intuit's article). Leave basis out and you get whatever the file is set to, which is what the bookkeeper sees when they open the report. Pass basis=cash or basis=accrual to choose. The report's own basis field says which one you got, so a sheet can print it under the title.

The default period and other periods

The copy kept here is this year to date, refreshed whenever it is older than 6 hours, so a request with no dates answers at once. Any other period is QuickBooks' report run for those dates at the next Web Connector check-in: the first request answers 202 with a job to read later, and once it has arrived the same request answers from the stored copy. if_queued=error turns that 202 into a plain 409 report_not_ready for tools that can't come back later, such as a scheduled sheet refresh (how queued reads work).

So for a month-by-month view, ask for each month once, let them arrive at the next check-in, and read them after:

GET /v1/files/file_8f2c41/reports/profit-and-loss?date_from=2026-10-01&date_to=2026-10-31&shape=rows&format=csv

Reading the rows

shape=rows gives one row per report line with category (Income, Cost of Goods Sold, Expense, Other Income, Other Expense), group (the heading right above the line), path (every heading joined with " > ") and kind. Keep kind = data for the accounts themselves; the subtotal and total rows repeat sums QuickBooks already made, and adding them in doubles the numbers. Net Income is the last total row.

This is QuickBooks' standard profit and loss for the whole company. For a split by class, see classes; for one job, the job profitability summary. The balance sheet shows net income again in its equity section.

Other reports: Balance sheet, A/R aging summary, A/P aging summary, Job profitability summary.