General Ledger Accounts API

General ledger (GL) accounts are the foundation of your accounting system in Snapbooks. They provide a structured way to store and categorize financial information for bank accounts, sales, expenses, and other financial transactions in accordance with Norwegian accounting standards.

The system supports industry-specific GL account plan extensions that automatically provide additional accounts relevant to specific business sectors based on the organization’s SN2007 industrial classification code.

Available Endpoints

Method Endpoint Description
GET /general-ledger-accounts List general ledger accounts
GET /general-ledger-accounts/balances Balance per account code as of a date
GET /general-ledger-accounts/{id} Get a specific general ledger account

List General Ledger Accounts

GET /general-ledger-accounts

Retrieve a paginated list of general ledger accounts with optional filtering.

Query Parameters

Parameter Type Default Description
description string - Filter accounts by description
country_code string “NO” Filter accounts by country code (currently only “NO” supported)
account_code string - Filter accounts by one or more account codes (comma-separated)
client_account_id integer - Scope industry-extension visibility to a specific client account. Required when with=statistics is requested
with string - Comma-separated list of relations to include. Supported: mandatory_dimensions, tax_codes, tax_codes.tax_code, statistics
order_by string - Sort the results
page integer 1 The page number for pagination
per_page integer 100 The number of items per page

Examples

# Get accounts with specific account codes
GET /general-ledger-accounts?account_code=1000,2000,3000

# Combine with other filters
GET /general-ledger-accounts?account_code=1000,2000&description=revenue

# Single account code
GET /general-ledger-accounts?account_code=1000

# Include the per-account tax-code whitelist with full tax-code details
GET /general-ledger-accounts?with=tax_codes,tax_codes.tax_code

# Include usage statistics (requires client_account_id)
GET /general-ledger-accounts?with=statistics&client_account_id=7

Account Balances

GET /general-ledger-accounts/balances

Balance of one or more accounts as of a date, in ledger sign (debit positive), optionally scoped to a sub-ledger dimension. The figures are computed by the same function an external reconciliation sign-off stores for a LEDGER_BALANCE entry, so they compare directly with a document reconciliation line’s expected amount. Balance sheet accounts accumulate from the beginning of time; profit and loss accounts from the first day of the as-of year.

Query Parameters

Parameter Type Required Description
client_account_id integer Yes The client account
account_code string Yes One or more account codes, comma-separated. Codes that do not exist for the client are omitted from the result
as_of_date date Yes Postings on or before this date count
currency_code string No Sum the foreign-currency legs of lines booked in this currency. Defaults to the client’s accounting currency
relation_type string No Scope to one dimension: businesspartner, bankacc, project, department or asset. Requires relation_id. Cannot be combined with split_by_mandatory_dimension
relation_id integer No The dimension record (e.g. the business partner id). Requires relation_type
split_by_mandatory_dimension boolean No For accounts that carry a mandatory sub-ledger dimension (e.g. a bank clearing account), return one row per value of that dimension instead of a single total. Rows with no value set are returned with relation_id: null. Cannot be combined with relation_type

Response

A plain JSON array, one row per account found, ordered by account code:

[
  {
    "account_id": 864,
    "account_code": "2400",
    "description": "Leverandørgjeld",
    "balance": -12500.0,
    "currency_code": "NOK",
    "as_of_date": "2026-06-30",
    "relation_type": "businesspartner",
    "relation_id": 56,
    "relation_name": null
  }
]

relation_name is only populated (looked up from the dimension record) when the row came from split_by_mandatory_dimension; otherwise it is null.

# The supplier's balance on 2400 at period end
GET /general-ledger-accounts/balances?client_account_id=7&account_code=2400,2460&as_of_date=2026-06-30&relation_type=businesspartner&relation_id=56

With split_by_mandatory_dimension, an account like 1920 (bank clearing, mandatory bank-account dimension) returns one row per bank account:

[
  {
    "account_id": 512,
    "account_code": "1920",
    "description": "Bankinnskudd",
    "balance": 42000.0,
    "currency_code": "NOK",
    "as_of_date": "2026-06-30",
    "relation_type": "bankacc",
    "relation_id": 24,
    "relation_name": "Sparebanken Vest"
  },
  {
    "account_id": 512,
    "account_code": "1920",
    "description": "Bankinnskudd",
    "balance": 1500.0,
    "currency_code": "NOK",
    "as_of_date": "2026-06-30",
    "relation_type": "bankacc",
    "relation_id": null,
    "relation_name": null
  }
]
# Balance per bank account on the clearing account
GET /general-ledger-accounts/balances?client_account_id=7&account_code=1920&as_of_date=2026-06-30&split_by_mandatory_dimension=true

Get General Ledger Account

GET /general-ledger-accounts/{id}

Retrieve a single general ledger account.

Query Parameters

Parameter Type Default Description
client_account_id integer - Scope industry-extension visibility. Required when with=statistics. Returns 403 if the requested client account is missing the industry extension this account belongs to
with string - Comma-separated list of relations to include. Supported: mandatory_dimensions, tax_codes, tax_codes.tax_code, statistics

Account Attributes

Attribute Type Description
id integer The ID of the general ledger account
created_at date The date and time when the account was created
created_by_id integer The ID of the user that created the account
updated_at date The date and time when the account was last updated
updated_by_id integer The ID of the user that last updated the account
account_code string The unique code for the account
description string The description of the account (language-dependent)
category_code_1 string The primary category code
category_description_1 string The description of the primary category (language-dependent)
category_code_2 string The secondary category code
category_description_2 string The description of the secondary category (language-dependent)
category_code_3 string The tertiary category code
category_description_3 string The description of the tertiary category (language-dependent)
industry_extension string Industry-specific extension category (e.g., “REALESTATE”, “RESTAURANT”)
is_active boolean Indicates whether the account is active
country_code string The country code associated with the account

Relationships

Relationship Type Description
mandatory_dimensions [MandatoryDimension] The mandatory dimensions associated with the account
tax_codes [AccountTaxCode] The per-account tax-code whitelist (see Per-Account Tax Code Whitelist)
statistics object Usage statistics scoped to a client account (see Statistics). Requires client_account_id query param

Per-Account Tax Code Whitelist

GL accounts may carry a list of allowed tax codes. When set, journal-entry lines posting to this account can only specify a tax_code from this list — an explicit tax_code outside the whitelist is rejected with 400. Lines with no tax_code are still accepted. An empty list means no restriction (any tax code is allowed).

One entry in the list may be marked is_default: true and is used to prefill the tax code in the booking UI.

Include via ?with=tax_codes for ID-only references, or ?with=tax_codes,tax_codes.tax_code to embed the full tax code object.

{
  "id": 42,
  "account_code": "3000",
  "description": "Sales — high-rate VAT",
  "tax_codes": [
    {
      "tax_code_id": 1,
      "is_default": true,
      "tax_code": {
        "id": 1,
        "code": "3",
        "description": "Outgoing VAT, high rate",
        "tax_rate": "25.00"
      }
    },
    {
      "tax_code_id": 2,
      "is_default": false
    }
  ]
}

Statistics

The statistics relation returns aggregated usage data for a GL account scoped to a specific client account. The result is cached for 24 hours. Amounts are formatted using the client account’s accounting currency decimal places.

Field Type Description
total_entries integer Number of journal-entry lines posted to this account for the client account
current_balance decimal Sum of debit − credit across all postings
last_used_date string ISO date of the most recent posting, or null if unused
average_transaction_amount decimal Mean absolute amount per posted line
largest_transaction decimal Largest absolute amount on a single posted line
{
  "id": 42,
  "account_code": "3000",
  "description": "Sales — high-rate VAT",
  "statistics": {
    "total_entries": 132,
    "current_balance": "-1250000.00",
    "last_used_date": "2026-05-19",
    "average_transaction_amount": "9469.70",
    "largest_transaction": "125000.00"
  }
}

Error Responses

Status Description
400 client_account_id is required when requesting statistics — passed with=statistics without a client_account_id
400 Invalid country code — country_code is set to anything other than NO
400 client_account_id is required, account_code is required, as_of_date is required, Invalid relation_type, relation_type and relation_id must be given together, split_by_mandatory_dimension cannot be combined with relation_type, Invalid currency_code — GET /general-ledger-accounts/balances parameter errors
403 No access to client account — the user cannot access the supplied client_account_id
403 This account requires an industry extension that is not enabled for your organization — GET /general-ledger-accounts/{id} returned an account whose industry_extension is not active for the requested client_account_id
404 General ledger account not found

Industry-Specific Extensions

The GL account system includes industry-specific extensions that provide additional accounts relevant to specific business sectors:

  • REALESTATE: Additional accounts for real estate companies (SN2007 codes 68.x)
  • RESTAURANT: Additional accounts for food and beverage service businesses (SN2007 codes 56.x)

How Industry Extensions Work

  1. Automatic Assignment: When a client account is created, the system automatically determines the appropriate industry extension based on the organization’s SN2007 industrial classification code
  2. Unified Account Plan: API responses include both base GL accounts (available to all clients) and industry-specific accounts (only for relevant industries)
  3. Seamless Integration: Industry extensions work transparently - clients see a complete, unified chart of accounts

Supported Industry Mappings

SN2007 Code Range Industry Extension Description
68.x REALESTATE Real Estate Activities
56.x RESTAURANT Food and Beverage Service Activities

Important Notes

  • Language Support: Descriptions and category descriptions are language-dependent and will be returned based on the user’s locale settings
  • Country Support: Currently only supports Norwegian country code (“NO”)
  • Industry Extensions: Account lists automatically include relevant industry-specific accounts based on the client’s organization
  • Pagination: Results are paginated by default
  • Active Status: Inactive accounts are excluded from the default list response

For practical examples and implementation details, refer to our Getting Started Guide.