Trial Balance
Review account balances and drill into the entries behind them. Every operation below is generated from the published OpenAPI contract. Paths are company-scoped; read the Accounting API guide for scopes, step-up and permissions, and the Trial Balance guide for the workflow.
Accounting / Trial Balance
GET/rest/v1.0/companies/{company_id}/accounting/trial_balanceTrial balance
Debit and credit totals and the net balance per account from posted lines up to as_of (default today), optionally from from. Split by a dimension with group_by (entity, project, department, cost_code), or restrict to one entity, project or department. Net debit and net credit totals are always equal. Requires the accounting:read scope.
Parameters
- company_idintegerpathrequiredCompany id; must be the token's company
- as_ofstring (date)queryInclusive end date (default today)
- fromstring (date)queryInclusive start date (activity only)
- entity_idintegerqueryOne entity
- project_idintegerqueryOne project
- department_idintegerqueryOne department
- group_bystringquerySplit rows by a dimension. `dimension:<code>` groups by a user-defined dimension: dimension_id on each row is then the value id (null = lines with no value), rolled up by dimension_level; the rows of each account sum to its ungrouped balance.
- dimension_levelintegerqueryWith group_by=dimension:<code>: roll values up to this hierarchy level (1 = top-level values); omitted = the posted value.
- dimension_value_idsstringqueryComma-separated dimension value ids: lines carrying one of them or a child value (values of one dimension OR, dimensions AND).
- include_zeroanyqueryAlso list postable accounts with no activity One of: true, false.
Response · 200 · object
- as_ofstring (date)required
- fromstring | null (date)required
- entity_idinteger | nullrequired
- group_byanyrequiredOne of: entity, project, department, cost_code, null.
- rowsobject[]required
- rows[].account_idintegerrequired
- rows[].account_numberstringrequired
- rows[].account_namestringrequired
- rows[].account_typeanyrequiredOne of: bank, cash, accounts_receivable, retainage_receivable, contract_asset, other_current_asset, inventory, fixed_asset, accumulated_depreciation, other_asset, accounts_payable, retainage_payable, contract_liability, credit_card, payroll_liability, sales_tax_payable, other_current_liability, long_term_liability, equity, retained_earnings, income, other_income, cost_of_revenue, expense, other_expense.
- rows[].normal_balanceanyrequiredOne of: debit, credit.
- rows[].dimension_idinteger | nullrequired
- rows[].debitstringrequiredDecimal amount as a string, 2 dp
- rows[].creditstringrequiredDecimal amount as a string, 2 dp
- rows[].net_debitstringrequiredDecimal amount as a string, 2 dp
- rows[].net_creditstringrequiredDecimal amount as a string, 2 dp
- totalsobjectrequired
- totals.debitstringrequiredDecimal amount as a string, 2 dp
- totals.creditstringrequiredDecimal amount as a string, 2 dp
- totals.net_debitstringrequiredDecimal amount as a string, 2 dp
- totals.net_creditstringrequiredDecimal amount as a string, 2 dp
Errors
401Missing or invalid bearer token403No accounting access, missing permission, wrong company, or read-only workspace404Not found in this company422Validation failed (field errors) or the ledger refused the change (message list)429Company heavy-read budget spent (ACCT_HEAVY_BUDGET units per minute); retry after the Retry-After seconds
Example request
Generated from the contractcurl
curl -X GET "https://app.os.construction/rest/v1.0/companies/1/accounting/trial_balance" \
-H "Authorization: Bearer $OS_ACCESS_TOKEN"