---
title: "Generate a report"
method: GET
path: "/reports/{type}"
tags: ["Reports"]
---

# Generate a report

`GET /reports/{type}`

## Request

- Base URL: `https://api.lumabill.ch/v1`
- URL: `https://api.lumabill.ch/v1/reports/{type}`
- Auth: HTTP bearer

Generate the report as the app shows it, amounts in CHF. pnl and vat are period reports (`dateFrom`, `dateTo`); balance-sheet is a point-in-time report (`asOfDate`); trial-balance (Saldenliste) takes `fiscalYearId` and / or `asOfDate` (clamped into the year; one of them is required, 400 INVALID_FISCAL_YEAR_ID for a malformed id, 404 for a year that does not exist) and needs a double-entry profile (403 DOUBLE_ENTRY_REQUIRED otherwise).

## Query parameters

- `dateFrom` string, date
- `dateTo` string, date
- `asOfDate` string, date
- `fiscalYearId` string, uuid

## Response `200`

Generated report

- union
  - Report: The report as the app shows it; the structure varies by type (`sections` / `subtotals` for pnl, assets and liabilities for balance-sheet, the MWST ciphers for vat, see TrialBalance for trial-balance). All amounts are in CHF. pnl adds `fxResult`, balance-sheet adds `fxNote`. In vat every invoice, credit note, expense or revenue (CHF or foreign currency) with a live recognition entry declares the net and VAT its entry booked (2200 / 1170, under the Saldosteuersatz the booked SSS share), so the ciphers equal the ledger; `filingStatus.filedDifferences` lists every cipher of the form (rate ciphers by turnover) that differs from the figures stored when the period was filed (null without a filing).
    - `fxResult` PnlFxResult: pnl only. Exchange differences of the period by origin, income sign (positive = gain): `realized` = lines with fxKind realized (payments, transfers), `unrealized` = fxKind revaluation (year-end revaluation), `other` = the untagged rest of an FX result account (conversion rounding of documents, manual postings), so per account realized + unrealized + other = its saldo. Computed when the period has FX-tagged lines; without them every figure is 0 and accounts is empty. Additive: sections and subtotals are unchanged.
      - `realized` number, double
      - `unrealized` number, double
      - `other` number, double
      - `comparisonRealized` number, double, nullable
      - `comparisonUnrealized` number, double, nullable
      - `comparisonOther` number, double, nullable
      - `accounts` object[]
        - `code` string
        - `name` string
        - `realized` number, double
        - `unrealized` number, double
        - `other` number, double
        - `comparisonRealized` number, double, nullable
        - `comparisonUnrealized` number, double, nullable
        - `comparisonOther` number, double, nullable
    - `fxNote` BalanceSheetFxNote, nullable: balance-sheet only, for the Anhang (OR 959c Abs. 1 Ziff. 1): each foreign-currency account with its saldo in that currency, CHF book value, book rate and the closing rate used, plus the rates block. Null without FW accounts or when no fiscal year covers asOfDate.
      - `asOfDate` string, date
      - `accounts` object[]
        - `chartAccountId` string, uuid
        - `code` string
        - `name` string
        - `type` string
        - `currency` 'CHF' | 'EUR' | 'USD' | 'GBP' | 'JPY' | 'CAD' | 'AUD' | 'SEK' | 'NOK' | 'DKK' | 'HUF': ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.
        - `fwBalance` number, double
        - `chfBalance` number, double
        - `bookRate` number, double, nullable
        - `closingRate` number, double, nullable
        - `rateSource` string: Where a rate came from: `BAZG` (ESTV/BAZG daily or monthly average sell rate), `BAZG_CROSS` (derived through a cross rate), `ICTAX` (ESTV year-end list, mid rate), `ACTUAL` (the CHF amount actually moved), `MANUAL` (entered by you).
        - `rateDate` string, date, nullable
      - `ratesUsed` FxRateUsed[]
        - `currency` 'CHF' | 'EUR' | 'USD' | 'GBP' | 'JPY' | 'CAD' | 'AUD' | 'SEK' | 'NOK' | 'DKK' | 'HUF': ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.
        - `rate` number, double
        - `rateSource` string: Where a rate came from: `BAZG` (ESTV/BAZG daily or monthly average sell rate), `BAZG_CROSS` (derived through a cross rate), `ICTAX` (ESTV year-end list, mid rate), `ACTUAL` (the CHF amount actually moved), `MANUAL` (entered by you).
        - `rateDate` string, date, nullable
        - `retrievedAt` string, date-time, nullable
      - `revaluationRun` FxRevaluationRunRef, nullable: The live year-end revaluation run the closing rates come from
        - `id` string, uuid
        - `runDate` string, date
        - `valuationPolicy` 'stichtag' | 'niederstwert'
        - `threshold` number, double
        - `journalEntryId` string, uuid, nullable
        - `entrySeq` integer, nullable
  - TrialBalance: trial-balance (Saldenliste) of one fiscal year as of `asOfDate`: for every account with lines in scope the opening balance (from the year's opening balance entry), debit and credit movements and the closing balance, in CHF and in the natural direction of the account type. Foreign-currency accounts add their FW saldo, book rate (CHF / FW) and the closing rate of the live revaluation run dated asOfDate. Debit = credit for openings, movements and closings (`isBalanced`).
    - `baseCurrency` 'CHF' | 'EUR' | 'USD' | 'GBP' | 'JPY' | 'CAD' | 'AUD' | 'SEK' | 'NOK' | 'DKK' | 'HUF': ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.
    - `fiscalYear` object
      - `id` string, uuid
      - `year` integer
      - `startDate` string, date
      - `endDate` string, date
      - `status` 'OPEN' | 'CLOSED'
    - `asOfDate` string, date
    - `accounts` object[]
      - `chartAccountId` string, uuid
      - `code` string
      - `name` string
      - `type` 'ASSET' | 'LIABILITY' | 'EQUITY' | 'REVENUE' | 'EXPENSE'
      - `isActive` boolean
      - `openingBalance` number, double
      - `debit` number, double
      - `credit` number, double
      - `closingBalance` number, double
      - `currency` 'CHF' | 'EUR' | 'USD' | 'GBP' | 'JPY' | 'CAD' | 'AUD' | 'SEK' | 'NOK' | 'DKK' | 'HUF': ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.
      - `fwBalance` number, double, nullable
      - `bookRate` number, double, nullable
      - `closingRate` number, double, nullable
      - `rateSource` string, nullable: See FxRateSource
      - `rateDate` string, date, nullable
    - `totals` object
      - `openingDebit` number, double
      - `openingCredit` number, double
      - `debit` number, double
      - `credit` number, double
      - `closingDebit` number, double
      - `closingCredit` number, double
    - `isBalanced` boolean
    - `priorYearNotClosed` boolean: The prior year is not closed, so balance-sheet accounts open at 0
    - `revaluationRun` FxRevaluationRunRef, nullable: The live year-end revaluation run the closing rates come from
      - `id` string, uuid
      - `runDate` string, date
      - `valuationPolicy` 'stichtag' | 'niederstwert'
      - `threshold` number, double
      - `journalEntryId` string, uuid, nullable
      - `entrySeq` integer, nullable
    - `ratesUsed` FxRateUsed[]
      - `currency` 'CHF' | 'EUR' | 'USD' | 'GBP' | 'JPY' | 'CAD' | 'AUD' | 'SEK' | 'NOK' | 'DKK' | 'HUF': ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.
      - `rate` number, double
      - `rateSource` string: Where a rate came from: `BAZG` (ESTV/BAZG daily or monthly average sell rate), `BAZG_CROSS` (derived through a cross rate), `ICTAX` (ESTV year-end list, mid rate), `ACTUAL` (the CHF amount actually moved), `MANUAL` (entered by you).
      - `rateDate` string, date, nullable
      - `retrievedAt` string, date-time, nullable

## Other responses

- `400`: Validation error
- `401`: Invalid or missing API key
- `403`: Subscription required or read-only key on a write endpoint
- `404`: Resource not found
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/lumabill/apis/lumabill-api.md) · [All operations](https://skmtc.dev/lumabill/apis/lumabill-api/llms.txt) · [OpenAPI document](https://skmtc.dev/lumabill/apis/lumabill-api/revisions/e48e7099b545?raw)
