General Ledger
Trace balances and posted transactions to their source records. 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 General Ledger guide for the workflow.
Accounting / General Ledger
GET/rest/v1.0/companies/{company_id}/accounting/general_ledgerGeneral ledger detail
Posted lines between from (default the start of the fiscal year holding to) and to (default today) in posting order. With account_id the response also carries the opening balance, a running balance per line and the closing balance (debit positive). Filter by entity, project, department or cost code. Requires the accounting:read scope. Deep reads should page by keyset: pass the previous response’s next_cursor as cursor (the running balance travels in the cursor, so no earlier line is re-summed); page is then ignored and the response carries no Link page header. Cursors are at most 512 characters; a longer or malformed one returns 422.
Parameters
- company_idintegerpathrequiredCompany id; must be the token's company
- account_idintegerqueryOne account (enables running balances)
- fromstring (date)queryInclusive start (default the fiscal year start for `to`)
- tostring (date)queryInclusive end
- entity_idintegerqueryEntity
- project_idintegerqueryProject
- department_idintegerqueryDepartment
- dimension_value_idsstringqueryComma-separated dimension value ids: lines carrying one of them or a child value (values of one dimension OR, dimensions AND). Opening, closing and running balances follow the filter.
- cost_code_idintegerqueryCost code
- party_idintegerqueryLines whose vendor or customer is this company vendor. Narrows the lines only: opening, closing and running balance are null.
- source_typestringqueryLines of this source type (manual, ap_bill, ar_invoice, payroll_run, intercompany for generated due-to/due-from lines…). Narrows the lines only: opening, closing and running balance are null.
- pageintegerquery
- per_pageintegerquery
- cursorstringqueryOpaque keyset cursor from `next_cursor` of the previous page; when set, `page` is ignored
Response · 200 · object
- next_cursorstring | nullrequiredCursor for the next page (null on the last page)
- account_idinteger | nullrequired
- fromstring (date)required
- tostring (date)required
- opening_balancestring | nullrequiredDecimal amount as a string, 2 dp
- closing_balancestring | nullrequiredDecimal amount as a string, 2 dp
- total_debitstringrequiredDecimal amount as a string, 2 dp
- total_creditstringrequiredDecimal amount as a string, 2 dp
- rowsobject[]required
- rows[].line_idintegerrequired
- rows[].entry_idintegerrequired
- rows[].entry_numberstring | nullrequired
- rows[].entry_statusanyrequiredOne of: posted, reversed.
- rows[].posting_datestring (date)required
- rows[].journalanyrequiredOne of: GJ, AP, AR, PR, CM, JC, FA, CL, IC, WIP.
- rows[].entry_memostring | nullrequired
- rows[].account_idintegerrequired
- rows[].account_numberstringrequired
- rows[].account_namestringrequired
- rows[].memostring | nullrequired
- rows[].debitstringrequiredDecimal amount as a string, 2 dp
- rows[].creditstringrequiredDecimal amount as a string, 2 dp
- rows[].running_balancestring | nullrequiredDecimal amount as a string, 2 dp
- rows[].entity_idintegerrequired
- rows[].project_idinteger | nullrequired
- rows[].cost_code_idinteger | nullrequired
- rows[].department_idinteger | nullrequired
- rows[].vendor_idinteger | nullrequired
- rows[].customer_idinteger | nullrequired
- rows[].source_typestringrequired
- rows[].source_idinteger | nullrequired
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)
Example request
curl -X GET "https://app.os.construction/rest/v1.0/companies/1/accounting/general_ledger" \
-H "Authorization: Bearer $OS_ACCESS_TOKEN"