Using Departments/Locations and Classes in QuickBooks Online

QuickBooks Online supports two powerful categorization features for tracking where your business activity happens: Departments and Classes. In the QuickBooks API, business units (departments) are represented by the Department entity.

Enable Locations and Classes in QBO

  • In QuickBooks Online, go to the gear icon → Account and settings → Advanced → Categories.
  • Toggle on Track classes and/or Track locations (QBO's UI label for the Department entity).
  • Optionally choose whether to assign classes/departments per transaction or per line.
  • Save your changes.

Departments and Classes are best used for high‑level categories such as offices, regions, or departments. They are available on QuickBooks Online Plus and Advanced editions.

References:

How Apideck maps QBO Departments

  • The Apideck Accounting API departments resource maps to the QuickBooks Department entity.
  • If your product or domain uses the term “departments”, treat these QBO Departments as departments—they are the same underlying entity in QBO and are exposed via Apideck’s departments endpoints. See: Manage business units (Departments).
  • Supported operations (QBO endpoints):
    • List: GET /query?query=select * from Department (paginate via STARTPOSITION and MAXRESULTS clauses in the query)
    • Create: POST /department
    • Get by ID: GET /department/{id}
    • Update: POST /department/{id} (sparse update)
  • Field mappings (examples):
    • nameName
    • statusActive (Apideck normalizes to active/inactive)
    • row_versionSyncToken
    • created_at/updated_atMetaData.CreateTime/MetaData.LastUpdatedTime (normalized to ISO 8601)

Practical examples (Apideck Accounting API)

Create a department:

curl --request POST \
  https://unify.apideck.com/accounting/departments \
  --header 'x-apideck-consumer-id: {CONSUMER_ID}' \
  --header 'x-apideck-app-id: {APP_ID}' \
  --header 'x-apideck-service-id: quickbooks' \
  --header 'Authorization: Bearer {APIDECK_API_KEY}' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "New York Office",
    "status": "active"
  }'

List departments:

curl --request GET \
  'https://unify.apideck.com/accounting/departments?limit=20&offset=0' \
  --header 'x-apideck-consumer-id: {CONSUMER_ID}' \
  --header 'x-apideck-app-id: {APP_ID}' \
  --header 'x-apideck-service-id: quickbooks' \
  --header 'Authorization: Bearer {APIDECK_API_KEY}'

Get a department by ID:

curl --request GET \
  https://unify.apideck.com/accounting/departments/{id} \
  --header 'x-apideck-consumer-id: {CONSUMER_ID}' \
  --header 'x-apideck-app-id: {APP_ID}' \
  --header 'x-apideck-service-id: quickbooks' \
  --header 'Authorization: Bearer {APIDECK_API_KEY}'

Update a department:

curl --request PATCH \
  https://unify.apideck.com/accounting/departments/{id} \
  --header 'x-apideck-consumer-id: {CONSUMER_ID}' \
  --header 'x-apideck-app-id: {APP_ID}' \
  --header 'x-apideck-service-id: quickbooks' \
  --header 'Authorization: Bearer {APIDECK_API_KEY}' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "NYC Office - Updated",
    "status": "inactive"
  }'

Notes and requirements

  • Ensure Departments/Classes are enabled in the QBO company; otherwise department fields may be ignored or operations may fail validation in the UI.
  • Required scope remains com.intuit.quickbooks.accounting.
  • QBO represents business units as Department in the API; Apideck’s departments abstracts this for consistency across accounting connectors.