Reports API

The Reports API provides endpoints for generating various financial reports following Norwegian accounting standards. Reports can be generated in multiple formats including Excel, HTML, and PDF.

Content Negotiation

Report format is determined by the Accept header on the request, not a query parameter:

Accept Header Format Description
application/json JSON Structured data response (default)
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet Excel Excel workbook download
text/html HTML HTML document download
application/pdf PDF PDF document download

Available Reports

Balance Sheet Report

Generates a balance sheet report showing assets, liabilities, and equity at a specific date.

GET /api/v2/reports/balance-sheet

Query Parameters:

Parameter Type Required Description
client_account_id integer Yes ID of the client account
report_date date No Date in YYYY-MM-DD format (default: today)
dimensions string No Comma-separated dimension tuples in type:id format
include_drafts boolean No Include draft journal entries (default: false)

JSON Response:

{
  "rows": [
    {
      "grouping": {
        "level_1_code": "1000",
        "level_1_name": "Assets",
        "level_2_code": "1100",
        "level_2_name": "Current Assets",
        "level_3_code": "1110",
        "level_3_name": "Cash and Bank"
      },
      "account_code": "1110",
      "account_name": "Bank Account",
      "balance": 50000.00
    }
  ]
}

Income Statement Report

Generates an income statement (profit & loss) report for a specified period.

GET /api/v2/reports/income-statement

Query Parameters:

Parameter Type Required Description
client_account_id integer Yes ID of the client account
date_from date No Start date in YYYY-MM-DD format (default: Jan 1 of current year)
date_to date No End date in YYYY-MM-DD format (default: today)
dimensions string No Comma-separated dimension tuples in type:id format
include_drafts boolean No Include draft journal entries (default: false)
free_text string No Filter by free text search

JSON Response:

{
  "rows": [
    {
      "grouping": {
        "level_1_code": "3000",
        "level_1_name": "Revenue",
        "level_2_code": "3100",
        "level_2_name": "Sales Revenue",
        "level_3_code": "3110",
        "level_3_name": "Product Sales"
      },
      "account_code": "3110",
      "account_name": "Product Sales",
      "period_debit_movements": {
        "1": 10000.00,
        "2": 12000.00,
        "3": 15000.00
      }
    }
  ]
}

Trial Balance Report

Generates a trial balance showing all account balances.

GET /api/v2/reports/trial-balance

Query Parameters:

Parameter Type Required Description
client_account_id integer Yes ID of the client account
date_from date Yes Start date in YYYY-MM-DD format
date_to date Yes End date in YYYY-MM-DD format
account_codes string No Comma-separated list of account codes to filter
dimensions string No Comma-separated dimension tuples in type:id format
include_drafts boolean No Include draft journal entries (default: false)
include_dimensions boolean No Include dimension breakdown in results (default: true)
include_zero_movement boolean No Include accounts with no movement in period (default: true)
free_text string No Filter by free text search
group_by_dimension string No Group results by dimension type. See Dimension Types

JSON Response:

{
  "rows": [
    {
      "grouping": {
        "level_1_code": "1000",
        "level_1_name": "Assets",
        "level_2_code": "1100",
        "level_2_name": "Current Assets",
        "level_3_code": "1110",
        "level_3_name": "Cash and Bank"
      },
      "account_code": "1110",
      "account_name": "Bank Account",
      "incoming_balance": 40000.00,
      "debit": 15000.00,
      "credit": 5000.00,
      "outgoing_balance": 50000.00,
      "relation_type": "bank_account",
      "relation_id": 1,
      "relation_name": "Main Bank Account"
    }
  ]
}

General Ledger Report

Generates a detailed general ledger report showing all transactions.

GET /api/v2/reports/general-ledger

Query Parameters:

Parameter Type Required Description
client_account_id integer Yes ID of the client account
date_from date Yes Start date in YYYY-MM-DD format
date_to date Yes End date in YYYY-MM-DD format
account_codes string No Comma-separated list of account codes to filter
dimensions string No Comma-separated dimension tuples in type:id format
include_drafts boolean No Include draft journal entries (default: false)
include_reconciled boolean No Include reconciled entries (default: true)
tax_codes string No Comma-separated list of tax codes to filter
free_text string No Filter by free text search
group_by_dimension string No Group results by dimension type. See Dimension Types
page integer No Page number (default: 1)
per_page integer No Items per page (default: 100)

Accounts Payable Report

Generates an accounts payable report showing outstanding supplier balances (account 2400).

GET /api/v2/reports/accounts-payable

Query Parameters:

Parameter Type Required Description
client_account_id integer Yes ID of the client account
business_partner_id integer No Filter by specific business partner
date_from date No Start date in YYYY-MM-DD format
date_to date No End date in YYYY-MM-DD format
free_text string No Filter by free text search
include_reconciled boolean No Include reconciled entries (default: true)
include_drafts boolean No Include draft journal entries (default: false)
page integer No Page number (default: 1)
per_page integer No Items per page (default: 100)

Accounts Receivable Report

Generates an accounts receivable report showing outstanding customer balances (account 1500).

GET /api/v2/reports/accounts-receivable

Query Parameters:

Same parameters as Accounts Payable Report above.

Data Export (SAF-T Financial)

Generates a SAF-T Financial export following Norwegian tax authority requirements.

GET /api/v2/reports/data-export

Query Parameters:

Parameter Type Required Description
client_account_id integer Yes ID of the client account
date_from date Yes Start date in YYYY-MM-DD format
date_to date Yes End date in YYYY-MM-DD format

Content Negotiation:

Accept Header Response
text/xml SAF-T XML file download
application/zip Starts async export. Returns 202 Accepted with a message. The ZIP file is emailed when ready.

Dimension Types

The group_by_dimension parameter accepts the following values:

Value Description
business_partner Group by customer or supplier
bank_account Group by bank account
project Group by project
department Group by department
asset Group by fixed asset
tag Group by tag
item Group by item

The dimensions parameter uses type:id format, where type is one of the values above and id is the entity ID. Multiple dimensions are comma-separated: dimensions=project:1,department:2.

Response Formats

Excel Format

Returns an Excel workbook with formatted headers, grouped data with subtotals, and number formatting following Norwegian standards.

HTML Format

Returns an HTML document with responsive table layout, formatted numbers and dates, and print-friendly styling.

PDF Format

Returns a PDF document with professional layout, page headers and footers, and print-optimized formatting.

Error Responses

{
    "error": "string",
    "message": "string",
    "details": {}
}

Common error codes:

  • 400 Bad Request: Invalid parameters (e.g., invalid group_by_dimension value)
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Client account not found
  • 422 Unprocessable Entity: Invalid date range