File: query.nu 3 exported commands 0 internal commands

qb query

Run a QuickBooks query (QBO SQL).

Returns the matching records as a table. Use --raw to get the full QueryResponse. Use --all to auto-paginate through all pages. Use --max-results and --start-position for manual pagination.

Usage

qb query <select> --max-results <int> --start-position <int> [--all] [--raw]

Parameters

select <string>
QBO SQL query string (e.g. "SELECT * FROM Customer")

Flags

--max-results <int>
Maximum results per page
--start-position <int>
Starting position (1-based)
--all
Auto-paginate to fetch all records
--raw
Return the raw QueryResponse

Input/output types

inputoutput
anyany

Examples

query all active customers

qb query "SELECT * FROM Customer WHERE Active = true"

query with pagination

qb query "SELECT * FROM Invoice" --max-results 50 --start-position 1

query all records (auto-paginate)

qb query "SELECT * FROM Customer" --all

get raw response

qb query "SELECT * FROM Customer MAXRESULTS 5" --raw

qb count

Get the record count for an entity, with optional where clause.

The where clause should NOT include the "WHERE" keyword.

Usage

qb count <entity> <where_clause?>

Parameters

entity <string>
Entity type (e.g. Customer, Invoice)
where_clause <string>
Optional WHERE clause (without 'WHERE') (optional)

Input/output types

inputoutput
anyany

Examples

count all customers

qb count Customer

count active customers

qb count Customer "Active = true"

count invoices for a customer

qb count Invoice "CustomerRef = '100'"

qb report

Fetch a QuickBooks report.

See Intuit documentation for available report types and parameters.

Usage

qb report <report_type> --params <record>

Parameters

report_type <string>
Report type (e.g. ProfitAndLoss, BalanceSheet, TrialBalance)

Flags

--params <record>
Optional query parameters for the report

Input/output types

inputoutput
anyany

Examples

get Profit and Loss report

qb report ProfitAndLoss

get Balance Sheet with date range

qb report BalanceSheet --params {start_date: "2024-01-01" end_date: "2024-12-31"}

get Trial Balance

qb report TrialBalance