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/{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

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 codecountry_code is set to anything other than NO
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 organizationGET /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.