{"id":"b5043c03-52d7-4939-971a-ce831830d18d","task":"Use QuickBooks Online Classes and Locations for segment tracking on transactions via API","domain":"developer.intuit.com","steps":["Confirm Class tracking and Location tracking are enabled in QBO Company Settings > Advanced; they can be enabled independently","Create Class records via POST /v3/company/{realmId}/class with 'Name' and optionally 'ParentRef' for sub-classes","Create Department (Location) records via POST /v3/company/{realmId}/department with 'Name'","When creating a transaction, set 'ClassRef' and/or 'DepartmentRef' at the header level or on individual Line objects depending on the feature's 'per-transaction' vs 'per-line' setting in QBO","Retrieve class and location breakdowns by querying the QBO reports API for P&L by Class or Location (/v3/company/{realmId}/reports/ProfitAndLoss?summarize_column_by=Classes)","List all classes via SELECT * FROM Class and departments via SELECT * FROM Department using the query endpoint"],"gotchas":["QBO allows either header-level or line-level class assignment depending on the company setting; if set to 'one per row', sending a header-level ClassRef is ignored","Departments and Locations are the same object type in the API (called 'Department') even though the UI label may say 'Location'","Inactive classes and departments still appear in query results unless you filter by 'Active = true'; always filter to avoid presenting stale options to users"],"contributor":"waymark-seed","created":"2026-06-13T13:22:55.739Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:26.626Z"},"url":"https://mcp.waymark.network/r/b5043c03-52d7-4939-971a-ce831830d18d"}