QuickBooks Online reports, plus flatten-report, which turns a report's nested sections into flat records an agent or a spreadsheet can use.

Every report takes a params Map with Intuit's own parameter names; common ones are start_date / end_date (YYYY-MM-DD), date_macro ("This Fiscal Year-to-date", "Last Month", ...), accounting_method (Cash / Accrual), summarize_column_by (Total, Month, Quarter, Customers, Classes, ...), customer, vendor, class, department, report_date and aging_period / num_periods (aged reports), and columns (TransactionList, GeneralLedger; a Vec is comma-joined). Null values are dropped.

::r ::quickbooks::reports

pnl ::r/profit-and-loss({start_date: "2026-01-01", end_date: "2026-09-30", accounting_method: "Accrual"})
rows ::r/flatten-report(pnl)
revenue find-first(rows, (row) { eq(row.label, "Total Income") })
revenue.values.Total

Reports are read calls: under the Intuit App Partner Program they are metered CorePlus calls.

Values

REPORTS

REPORTS: Vec [
  "ProfitAndLoss",
  "ProfitAndLossDetail",
  "BalanceSheet",
  "CashFlow",
  "TrialBalance",
  "GeneralLedger",
  "TransactionList",
  "AgedReceivables",
  "AgedReceivableDetail",
  "AgedPayables",
  "AgedPayableDetail",
  "CustomerBalance",
  "VendorBalance",
  "AccountList",
  "JournalReport"
]

Functions

aged-payables

fn (params: Map): Map
fn (params: Map, opts: Map): Map

The AgedPayables (A/P aging summary) report. report_date, aging_period, num_periods and vendor narrow it.

Example

report ::quickbooks::reports/aged-payables({report_date: "2026-09-30", vendor: "56"})
rows ::quickbooks::reports/flatten-report(report)
map(rows, %.label)

::quickbooks::reports/aged-payables({report_date: "2026-09-30", vendor: "56"}, {realm-id: "9341453"})

aged-receivables

fn (params: Map): Map
fn (params: Map, opts: Map): Map

The AgedReceivables (A/R aging summary) report. report_date, aging_period, num_periods and customer narrow it.

Example

report ::quickbooks::reports/aged-receivables({report_date: "2026-09-30", aging_period: 30, num_periods: 4})
rows ::quickbooks::reports/flatten-report(report)
map(rows, %.label)

::quickbooks::reports/aged-receivables({report_date: "2026-09-30", aging_period: 30, num_periods: 4}, {realm-id: "9341453"})

balance-sheet

fn (params: Map): Map
fn (params: Map, opts: Map): Map

The BalanceSheet report.

Example

report ::quickbooks::reports/balance-sheet({start_date: "2026-01-01", end_date: "2026-09-30"})
rows ::quickbooks::reports/flatten-report(report)
map(rows, %.label)

::quickbooks::reports/balance-sheet({start_date: "2026-01-01", end_date: "2026-09-30"}, {realm-id: "9341453"})

cash-flow

fn (params: Map): Map
fn (params: Map, opts: Map): Map

The CashFlow (statement of cash flows) report.

Example

report ::quickbooks::reports/cash-flow({date_macro: "This Fiscal Year-to-date"})
rows ::quickbooks::reports/flatten-report(report)
map(rows, %.label)

::quickbooks::reports/cash-flow({date_macro: "This Fiscal Year-to-date"}, {realm-id: "9341453"})

check-name

fn (name: Str): Str

A report name (letters only, e.g. ProfitAndLoss), or an Err. Names outside REPORTS are allowed for reports this package does not list.

Example

::quickbooks::reports/check-name("ProfitAndLoss")  // "ProfitAndLoss"
is-err(::quickbooks::reports/check-name("../company"))  // true

column-keys

fn (report: Map): Vec

The key for each report column: its ColTitle, else its ColKey metadata, else its ColType, else col{i}. Repeated keys get _{i} appended, so every key is unique.

Example

report {Columns: {Column: [{ColTitle: "Account"}, {ColTitle: ""}, {ColTitle: "Account"}, {ColType: "Money"}]}}
::quickbooks::reports/column-keys(report)  // ["Account", "col1", "Account_2", "Money"]

flatten-report

fn (report: Map): Vec

Flatten a report into records, in report order:

  • type - "Data" for detail rows, "Summary" for section totals
  • label - the first column (account, customer or transaction name)
  • id - the first column's entity id, when the report links one
  • values - every column by column-keys ({"Total": "1200.00"})
  • cells - the column values as a Vec of Str
  • path - the section headers above the row (["Income", "Services"])
  • group - the nearest section's group ("Income", "NetIncome", ...)
  • depth - nesting level, 0 at the top

Amounts stay as the Strs QuickBooks sends; parse-amount converts one.

Example

report {
  Columns: {Column: [{ColTitle: "Account"}, {ColTitle: "Total"}]},
  Rows: {Row: [{
    group: "Income",
    Header: {ColData: [{value: "Income"}, {value: ""}]},
    Rows: {Row: [{ColData: [{value: "Services", id: "1"}, {value: "1200.00"}]}]},
    Summary: {ColData: [{value: "Total Income"}, {value: "1200.00"}]}
  }]}
}
rows ::quickbooks::reports/flatten-report(report)
map(rows, %.label)  // ["Services", "Total Income"]
rows[0].id  // "1"
rows[0].path  // ["Income"]
rows[1].values  // {Account: "Total Income", Total: "1200.00"}

general-ledger

fn (params: Map): Map
fn (params: Map, opts: Map): Map

The GeneralLedger report. account (comma-separated ids), columns and source_account_type narrow it.

Example

report ::quickbooks::reports/general-ledger({start_date: "2026-09-01", end_date: "2026-09-30", account: "35,36"})
rows ::quickbooks::reports/flatten-report(report)
map(rows, %.label)

::quickbooks::reports/general-ledger({start_date: "2026-09-01", end_date: "2026-09-30", account: "35,36"}, {realm-id: "9341453"})

parse-amount

fn (value: Any): Dec?

A report amount Str ("1200.00", "-35.5") as a Dec; null for blanks and non-numbers.

Example

::quickbooks::reports/parse-amount("1200.00")  // 1200.0
::quickbooks::reports/parse-amount("-35.5")  // -35.5
::quickbooks::reports/parse-amount("n/a")  // null

profit-and-loss

fn (params: Map): Map
fn (params: Map, opts: Map): Map

The ProfitAndLoss report (income statement).

Example

report ::quickbooks::reports/profit-and-loss({date_macro: "Last Month", accounting_method: "Accrual"})
rows ::quickbooks::reports/flatten-report(report)
map(rows, %.label)

::quickbooks::reports/profit-and-loss({date_macro: "Last Month", accounting_method: "Accrual"}, {realm-id: "9341453"})

run-report

fn (name: Str): Map
fn (name: Str, params: Map): Map
fn (name: Str, params: Map, opts: Map): Map

GET /reports/{name} with params. Returns the report (Header, Columns, Rows). Use flatten-report for records.

Example

report ::quickbooks::reports/run-report("VendorBalance", {report_date: "2026-09-30"})
report.Header.ReportName

transaction-list

fn (params: Map): Map
fn (params: Map, opts: Map): Map

The TransactionList report: every transaction in a period, the usual input to reconciliation. transaction_type, columns, payment_method and cleared narrow it.

Example

report ::quickbooks::reports/transaction-list({start_date: "2026-09-01", end_date: "2026-09-30", transaction_type: "Invoice"})
rows ::quickbooks::reports/flatten-report(report)
map(rows, %.label)

::quickbooks::reports/transaction-list({start_date: "2026-09-01", end_date: "2026-09-30", transaction_type: "Invoice"}, {realm-id: "9341453"})