gnubok

Accounts

Read the chart of accounts (BAS).

Endpoints


GET /api/v1/companies/:companyId/accounts {#get-accounts-list}

accounts.list · scope reports:read

List chart-of-accounts entries (BAS chart).

Returns every account in the company's chart of accounts, ordered by sort_order (the BAS canonical sequence). Filter by ?class=<1..8> (BAS account class — 1=assets, 2=equity/liabilities, 3=revenue, 4=cost of goods sold, 5=övriga externa kostnader (rents, supplies, services), 6=övriga externa kostnader (marketing, professional services, IT), 7=labour, 8=financial). Note: BAS 5xxx and 6xxx are both övriga externa kostnader but cover distinct subgroups — see the BAS chart for the canonical mapping. Pass ?active=false to include archived accounts.

Use when: You need account numbers and names to render verifikation tables, build a custom report, or look up the canonical BAS label for an account.

Don't use for: Fetching balances — use the trial-balance report. Creating new accounts — this endpoint is read-only in v1 (use the dashboard).

Pitfalls

  • account_number is a STRING — "1930", not 1930. The leading character can be 0 in non-BAS plans.
  • is_system_account=true means the account was seeded by gnubok and cannot be archived or renamed.
  • Default filter excludes archived accounts; pass ?active=false to include them.

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no

Example response

{
  "data": [
    {
      "account_number": "1930",
      "account_name": "Företagskonto",
      "account_class": 1,
      "account_type": "asset",
      "normal_balance": "debit",
      "is_active": true
    }
  ],
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}