Use QuickBooks Online classes and locations for segment reporting via API

domain: developer.intuit.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

QuickBooks OAuth refresh token rotation — the full failure-mode walkthrough related to developer.intuit.com, checked against official docs, with linked verified routes.

Steps

  1. Authenticate with OAuth 2.0 (com.intuit.quickbooks.accounting scope) and note the realmId for all subsequent requests to the base URL https://quickbooks.api.intuit.com/v3/company/{realmId}.
  2. Create a Class entity via POST /v3/company/{realmId}/class with a JSON body containing Name and optionally SubClass=true and ParentRef to model a hierarchy (e.g., Product Line > Region); locations use the Department entity with the same pattern.
  3. Tag transactions (invoices, expenses, journal entries) by including a ClassRef or DepartmentRef object on the transaction body or on individual line items, depending on whether class tracking is set to 'one per transaction' or 'one per line' in company Preferences.
  4. Run a segmented Profit and Loss by calling GET /v3/company/{realmId}/reports/ProfitAndLossDetail with query parameters class or department to filter to a specific segment; use summarize_column_by=Class for a comparative multi-column report.
  5. To retrieve all class or location breakdowns in one pass, call the ProfitAndLoss report without filters and parse the ColData[].value metadata from the Columns section, which lists each Class dimension.
  6. Respect the product-tier limit of 40 combined classes and locations on QBO Plus (enforced via API as of October 2025); query the Preferences entity before bulk-creating to avoid hitting the cap.

Known gotchas

Related routes

Use QuickBooks Online Classes and Locations for segment tracking on transactions via API
developer.intuit.com · 6 steps · unrated
Create a Bill and Vendor record in QuickBooks Online via the Accounting API
developer.intuit.com · 6 steps · unrated
Create a QuickBooks Online JournalEntry with class and location tracking dimensions
developer.intuit.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans