> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fynn.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Lines behind one cell of the finance tables

> Returns the records that make up one cell: for movements the items of the accounts with that movement (signed change per item), for `mrr_bop` / `mrr_eop` the items contributing MRR at the snapshot, for `one_off` / `variable` and the revenue-page metrics the invoice positions (net = gross − tax, credit notes negative), for cash the payments and refunds (collected cash counts settled payments with status captured, booked, refunded or partial_refunded; every cash line carries `invoiceMonth`, the month of the invoice it pays), for `cash_collected_this_month` / `cash_collected_other_months` / `cash_collected_unassigned` the payments of the month for invoices of the same month / of other months / without a finalized invoice, for `cash_collected_refund_returned` the refunds that came back from the bank, for `cash_correction` both entries of every correction pair (signed; `counterpartTransactionId` names the other entry; `part` selects one side), for `cash_refunded_refund` / `cash_refunded_chargeback` / `cash_refunded_payout` / `cash_refunded_return_fee` the money-out lines of one kind (refunds / chargebacks / payouts / bank fees of return debits without a return case; they add up to `cash_refunded` and `cash_out`), `amount` = the payment's part (an overpaid invoice's payment splits into the part within its gross and the part above it, which is unassigned), for the receivables rows the invoices (invoices of the month; credit notes and cancellations act only through the credited amount of the invoice they reference) with the amount of that row — `status_paid` payments through payment transactions, `status_settled` settlements without one (customer balance, Skonto), `status_overpaid` the overpaid invoices with the amount paid above the gross, `cash_in_for_month` the payments received for the invoice at any date — for `ageing_*` the invoices open today in that bucket, for `outstanding_eop` / `receivables_eop` the invoices open at the month end (months after the current one: the invoices open today, carried forward) and for `outstanding_not_due_eop` / `outstanding_overdue_eop` those not yet due / overdue at the month end, for `owed_to_customers` the invoices whose customer paid more than the invoice still claims at the month end (credited after payment, paid twice) and got neither a refund nor a balance transfer, amount = the owed part, for `forecast_invoice` the expected invoices of the billing forecast by invoice date (`kind: forecast`, amount = gross), for `accounted_mrr` the recurring invoice positions with their share of the month by service period (`kind: accounted`), for `billing_gap` the difference between contract MRR and Accounted MRR per subscription item and cause (`kind: billing_gap`; `reason` = one cause, filter with `reason`), for `build_failure` (no month) the rows of the latest calculation attempt that broke a consistency check and cancelled it (`kind: build_failure`: `check`, `invoice`, `month`, `expectedText`, `actualText`, no amount; empty when the latest attempt succeeded, see `meta.build` of the finance datasets). `meta.sum` is the exact sum of `amount` over all lines. Customer-base and backlog cells: `cohort` the items of the cohort accounts at cohort month + age (MRR at month end), `churn_reason` the items of the lost accounts in the entry (item change, negative) over `month` or `from` / `to`, `backlog_event` the known future changes of a month (`kind: forward`), `payment_behaviour` the invoices paid in the month (`daysToPayment`), `logo_new` / `logo_lost` the items of the new / lost accounts, `restatement` the restatement findings of the month with their explanations.

Required permission: `analytics:read`.



## OpenAPI

````yaml assets/openapi-v2-finance.json get /api/analytics/mrr-financials/details
openapi: 3.0.3
info:
  title: Fynn Finanzberichte API
  version: 2026-09
  description: >-
    The finance reporting API returns the same figures as the finance pages of
    the app: MRR and its movements, Accounted MRR, cash, receivables, revenue,
    the customer base, month-end snapshots with their restatements and the Excel
    books. Every amount is an exact decimal string in one currency, never
    converted and never a float. Months are `YYYY-MM` in the time zone of the
    organisation.


    Authenticate every request with an API token of your organisation
    (`Authorization: Bearer api_...`). Reading needs `analytics:read`, taking a
    snapshot and changing the settings `analytics:write`. Every route also needs
    the finance reports to be enabled for the organisation (feature flag
    `analytics.advanced`); otherwise it answers 403 `feature-not-available`.
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - ApiToken: []
tags:
  - name: Datensätze
    description: Page datasets and the MRR table.
  - name: Drill-downs und Hinweise
    description: Lines behind a cell and data-quality findings.
  - name: Snapshots
    description: Month-end snapshots and their versions.
  - name: Excel-Exporte
    description: Excel books of the finance pages.
  - name: Definitionen
    description: The versioned definitions catalogue with its changelog.
  - name: Einstellungen
    description: Organisation-wide settings of the finance figures.
paths:
  /api/analytics/mrr-financials/details:
    get:
      tags:
        - Drill-downs und Hinweise
      summary: Lines behind one cell of the finance tables
      description: >-
        Returns the records that make up one cell: for movements the items of
        the accounts with that movement (signed change per item), for `mrr_bop`
        / `mrr_eop` the items contributing MRR at the snapshot, for `one_off` /
        `variable` and the revenue-page metrics the invoice positions (net =
        gross − tax, credit notes negative), for cash the payments and refunds
        (collected cash counts settled payments with status captured, booked,
        refunded or partial_refunded; every cash line carries `invoiceMonth`,
        the month of the invoice it pays), for `cash_collected_this_month` /
        `cash_collected_other_months` / `cash_collected_unassigned` the payments
        of the month for invoices of the same month / of other months / without
        a finalized invoice, for `cash_collected_refund_returned` the refunds
        that came back from the bank, for `cash_correction` both entries of
        every correction pair (signed; `counterpartTransactionId` names the
        other entry; `part` selects one side), for `cash_refunded_refund` /
        `cash_refunded_chargeback` / `cash_refunded_payout` /
        `cash_refunded_return_fee` the money-out lines of one kind (refunds /
        chargebacks / payouts / bank fees of return debits without a return
        case; they add up to `cash_refunded` and `cash_out`), `amount` = the
        payment's part (an overpaid invoice's payment splits into the part
        within its gross and the part above it, which is unassigned), for the
        receivables rows the invoices (invoices of the month; credit notes and
        cancellations act only through the credited amount of the invoice they
        reference) with the amount of that row — `status_paid` payments through
        payment transactions, `status_settled` settlements without one (customer
        balance, Skonto), `status_overpaid` the overpaid invoices with the
        amount paid above the gross, `cash_in_for_month` the payments received
        for the invoice at any date — for `ageing_*` the invoices open today in
        that bucket, for `outstanding_eop` / `receivables_eop` the invoices open
        at the month end (months after the current one: the invoices open today,
        carried forward) and for `outstanding_not_due_eop` /
        `outstanding_overdue_eop` those not yet due / overdue at the month end,
        for `owed_to_customers` the invoices whose customer paid more than the
        invoice still claims at the month end (credited after payment, paid
        twice) and got neither a refund nor a balance transfer, amount = the
        owed part, for `forecast_invoice` the expected invoices of the billing
        forecast by invoice date (`kind: forecast`, amount = gross), for
        `accounted_mrr` the recurring invoice positions with their share of the
        month by service period (`kind: accounted`), for `billing_gap` the
        difference between contract MRR and Accounted MRR per subscription item
        and cause (`kind: billing_gap`; `reason` = one cause, filter with
        `reason`), for `build_failure` (no month) the rows of the latest
        calculation attempt that broke a consistency check and cancelled it
        (`kind: build_failure`: `check`, `invoice`, `month`, `expectedText`,
        `actualText`, no amount; empty when the latest attempt succeeded, see
        `meta.build` of the finance datasets). `meta.sum` is the exact sum of
        `amount` over all lines. Customer-base and backlog cells: `cohort` the
        items of the cohort accounts at cohort month + age (MRR at month end),
        `churn_reason` the items of the lost accounts in the entry (item change,
        negative) over `month` or `from` / `to`, `backlog_event` the known
        future changes of a month (`kind: forward`), `payment_behaviour` the
        invoices paid in the month (`daysToPayment`), `logo_new` / `logo_lost`
        the items of the new / lost accounts, `restatement` the restatement
        findings of the month with their explanations.


        Required permission: `analytics:read`.
      operationId: getMrrFinancialsDetails
      parameters:
        - name: metric
          in: query
          description: The row of the cell.
          required: true
          schema:
            type: string
            enum:
              - new
              - expansion
              - contraction
              - lost
              - resurrecting
              - mrr_bop
              - mrr_eop
              - one_off
              - variable
              - cash_collected
              - cash_collected_this_month
              - cash_collected_other_months
              - cash_collected_unassigned
              - cash_collected_refund_returned
              - cash_refunded
              - cash_refunded_refund
              - cash_refunded_chargeback
              - cash_refunded_payout
              - cash_refunded_return_fee
              - cash_correction
              - cash_net
              - receivables_eop
              - billed_gross
              - billed_net
              - status_paid
              - status_settled
              - status_open
              - status_overdue
              - status_credited
              - status_written_off
              - status_overpaid
              - cash_in
              - cash_out
              - cash_in_for_month
              - outstanding_eop
              - outstanding_not_due_eop
              - outstanding_overdue_eop
              - owed_to_customers
              - forecast_invoice
              - accounted_mrr
              - billing_gap
              - ageing_not_due
              - ageing_1_30
              - ageing_31_60
              - ageing_61_90
              - ageing_over_90
              - revenue_product
              - revenue_customer_product
              - revenue_country
              - cohort
              - churn_reason
              - backlog_event
              - payment_behaviour
              - logo_new
              - logo_lost
              - restatement
              - build_failure
        - name: month
          in: query
          description: >-
            Month of the cell (YYYY-MM, time zone of the organisation). Required
            except for `ageing_*` (as of today), `build_failure` and the
            revenue-page metrics, which accept `from` / `to` instead.
          required: false
          schema:
            type: string
            example: 2026-09
        - name: from
          in: query
          description: >-
            Revenue-page metrics without `month`: first month of the range
            (YYYY-MM).
          required: false
          schema:
            type: string
        - name: to
          in: query
          description: >-
            Revenue-page metrics without `month`: last month of the range
            (YYYY-MM).
          required: false
          schema:
            type: string
        - name: currency
          in: query
          description: >-
            ISO-4217 code of one of the organisation's currencies. Default: the
            default currency.
          required: false
          schema:
            type: string
        - name: scope
          in: query
          description: 'Movement scope. Default: the organisation setting.'
          required: false
          schema:
            type: string
            enum:
              - subscription
              - invoice_address
              - customer
              - organisation
        - name: reason
          in: query
          description: >-
            Movement metrics: only the share of these reasons (comma-separated,
            e.g. `discount_start,discount_end,discount_change`).
          required: false
          schema:
            type: string
        - name: productId
          in: query
          description: >-
            Revenue-page cell: the product (`revenue_product` without it selects
            positions without product).
          required: false
          schema:
            type: string
            format: uuid
        - name: customerId
          in: query
          description: 'Revenue-page cell: the customer (`revenue_customer_product`).'
          required: false
          schema:
            type: string
            format: uuid
        - name: countryCode
          in: query
          description: >-
            Revenue-page cell: the country (`revenue_country`, ISO 3166-1
            alpha-2; `none` or omitted selects positions without country).
          required: false
          schema:
            type: string
        - name: segmentId
          in: query
          description: Analytics segment filter of the page.
          required: false
          schema:
            type: string
            format: uuid
        - name: customerIds[]
          in: query
          description: Customer filter of the page.
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: productIds[]
          in: query
          description: Product filter of the page.
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: search
          in: query
          description: >-
            Free text over customer name and number, subscription, item, product
            and invoice number.
          required: false
          schema:
            type: string
            maxLength: 100
        - name: groupBy
          in: query
          description: >-
            Revenue metrics only (`one_off`, `variable`, `revenue_*`):
            `document` groups the lines by the invoice they belong to (the
            invoice with its cancellations and credit notes) and pages over
            groups.
          required: false
          schema:
            type: string
            enum:
              - document
        - name: cancellationReason
          in: query
          description: >-
            `lost` with `reason=contract_end`: only contract ends with this
            cancellation reason code (`none`: without one). `churn_reason`: the
            churn-by-reason entry (a code, `none`, `pause` or `voided`).
          required: false
          schema:
            type: string
        - name: cohortMonth
          in: query
          description: '`cohort` (required): first month of the cohort (YYYY-MM).'
          required: false
          schema:
            type: string
        - name: age
          in: query
          description: '`cohort` (required): months since the cohort month.'
          required: false
          schema:
            type: integer
            minimum: 0
        - name: paymentMethod
          in: query
          description: >-
            `payment_behaviour`: payment method type (`sepa_debit`,
            `bank_transfer`, `card`, …). Default: every method.
          required: false
          schema:
            type: string
        - name: eventKind
          in: query
          description: '`backlog_event`: only this kind of known change.'
          required: false
          schema:
            type: string
            enum:
              - end
              - price
              - discount_end
              - ramp
              - trial_end
              - start
              - other
        - name: part
          in: query
          description: >-
            `cash_correction`: one side of the correction pairs, `reversed` (the
            cancelled entries, positive) or `counter` (the counter-entries,
            negative). Default: both. Only with `metric=cash_correction`; with
            any other metric the answer is 422 at `part` with code
            `analytics.mrr_financials.part_correction_only`.
          required: false
          schema:
            type: string
            enum:
              - reversed
              - counter
        - name: cell
          in: query
          description: >-
            `restatement`: only the findings of this restated figure (`mrr_eop`,
            `lost_mrr`, `reasons.<movement>.<reason>`, …).
          required: false
          schema:
            type: string
        - name: page
          in: query
          description: Page, starting at 1.
          required: false
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: pageSize
          in: query
          description: Lines per page.
          required: false
          schema:
            type: integer
            default: 25
            maximum: 200
            minimum: 1
      responses:
        '200':
          description: >-
            One page of lines, with `groupBy=document` one page of document
            groups, for `restatement` one page of findings with explanations.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/DetailsPageView'
                  - $ref: '#/components/schemas/DetailGroupsPageView'
                  - $ref: '#/components/schemas/FindingDetailsPageView'
        '401':
          description: Missing or invalid authentication.
        '403':
          description: >-
            Missing permission `analytics:read` (`FRAMEWORK__ACCESS_DENIED`), or
            the finance reports are not enabled for the organisation (feature
            flag `analytics.advanced`, `type`
            https://fynn.dev/problems/feature-not-available).
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Problem'
                  - $ref: '#/components/schemas/FeatureNotAvailableProblem'
        '422':
          description: >-
            Invalid or missing query parameter. The body lists the offending
            parameters in `violations` (`propertyPath`, `message`, `code`).
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblem'
      security:
        - ApiToken: []
components:
  schemas:
    DetailsPageView:
      description: One page of the lines behind a cell.
      properties:
        data:
          description: Lines of this page.
          type: array
          items:
            $ref: '#/components/schemas/DetailLineView'
        meta:
          description: Pagination, the sum over all lines and the calculation time.
          allOf:
            - $ref: '#/components/schemas/PageMetaView'
      type: object
    DetailGroupsPageView:
      description: >-
        One page of document groups (`groupBy=document`), ordered by the
        finalization date of each group's first document.
      properties:
        data:
          description: Groups of this page.
          type: array
          items:
            $ref: '#/components/schemas/DetailGroupView'
        meta:
          description: >-
            Pagination over groups (`total` = number of groups); `sum` over all
            lines of all groups.
          allOf:
            - $ref: '#/components/schemas/PageMetaView'
      type: object
    FindingDetailsPageView:
      description: >-
        One page of findings, each with its explanation (the restatements behind
        a cell).
      properties:
        data:
          description: Findings of this page with their explanations.
          type: array
          items:
            $ref: '#/components/schemas/FindingDetailView'
        meta:
          description: Pagination and the calculation time.
          allOf:
            - $ref: '#/components/schemas/PageMetaView'
      type: object
    Problem:
      type: object
      description: >-
        Error body (problem+json). `type` is the error key, e.g.
        `ANALYTICS_MRR_FINANCIALS__SNAPSHOT_MONTH_NOT_ENDED`; further keys carry
        the parameters of the error.
      properties:
        status:
          type: integer
          example: 409
        type:
          type: string
          example: ANALYTICS_MRR_FINANCIALS__SNAPSHOT_MONTH_NOT_ENDED
        title:
          type: string
          example: An error occurred
        detail:
          type: string
          description: German sentence that can be shown to the user.
      required:
        - status
        - type
        - title
        - detail
      additionalProperties: true
    FeatureNotAvailableProblem:
      type: object
      description: >-
        403 body when the finance reports are not enabled for the organisation
        (feature flag `analytics.advanced`).
      properties:
        type:
          type: string
          enum:
            - https://fynn.dev/problems/feature-not-available
        title:
          type: string
          example: Feature not available
        detail:
          type: string
          example: >-
            The requested feature is not available. Please contact customer
            support.
        featureFlags:
          type: array
          items:
            type: string
          example:
            - analytics.advanced
      required:
        - type
        - title
        - detail
        - featureFlags
      additionalProperties: true
    ValidationProblem:
      type: object
      description: '422 body: one entry per rejected field in `violations`.'
      properties:
        status:
          type: integer
          example: 422
        type:
          type: string
          example: https://tools.ietf.org/html/rfc2616#section-10
        title:
          type: string
          example: Validation Failed
        detail:
          type: string
        violations:
          type: array
          items:
            $ref: '#/components/schemas/Violation'
      required:
        - status
        - type
        - violations
      additionalProperties: true
    DetailLineView:
      description: >-
        One line behind a cell. `kind` tells which fields are set: `movement`
        (an item of an account with the requested movement), `snapshot` (an item
        contributing MRR at the month end), `revenue` (an invoice position),
        `cash` (a payment or refund), `invoice` (an invoice document), `forward`
        (a known future change of an item), `forecast` (an expected invoice of
        the billing forecast), `accounted` (a recurring invoice position with
        its share of the month), `billing_gap` (the difference contract −
        invoice of an item in the month for one cause), `build_failure` (a row
        that broke a consistency check of the latest calculation attempt;
        `check`, `invoice`, `month`, `expectedText`, `actualText`, no amount).
        `amount` is the line's share of the cell.
      properties:
        kind:
          description: Kind of line.
          type: string
          enum:
            - movement
            - snapshot
            - revenue
            - cash
            - invoice
            - forward
            - forecast
            - accounted
            - billing_gap
            - build_failure
        id:
          description: >-
            Id of the line (item, invoice position, payment transaction or
            invoice).
          type: string
          nullable: true
        month:
          description: >-
            Month of the line (YYYY-MM, time zone of the organisation). Null for
            ageing lines (as of now).
          type: string
          nullable: true
        amount:
          description: The line's share of the cell (signed).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        account:
          description: The MRR account the movement was classified on (movement lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/AccountRefView'
        customer:
          description: The customer.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RefView'
        subscription:
          description: The subscription (movement and snapshot lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RefView'
        item:
          description: >-
            The subscription item or schedule product row (movement and snapshot
            lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ItemRefView'
        product:
          description: The product.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RefView'
        productName:
          description: 'Product name (revenue lines: the name on the invoice position).'
          type: string
          nullable: true
        invoice:
          description: The invoice (revenue, cash and invoice lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/InvoiceRefView'
        transaction:
          description: The payment transaction (cash lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/TransactionRefView'
        countryCode:
          description: >-
            Country of the invoice address (ISO 3166-1 alpha-2), revenue and
            invoice lines.
          type: string
          nullable: true
        movementType:
          description: Movement type of the account (movement lines).
          type: string
          enum:
            - new
            - expansion
            - contraction
            - lost
            - resurrecting
          nullable: true
        revenueClass:
          description: Revenue class of the invoice position (revenue lines).
          type: string
          enum:
            - recurring
            - one_off
            - variable
          nullable: true
        reason:
          description: >-
            Main reason of the line: for movement lines the reason with the
            largest share of the change, for revenue lines the classification
            reason, for invoice lines the status bucket.
          type: string
          nullable: true
        reasons:
          description: >-
            Movement lines: the change split by reason (signed amounts that add
            up to `delta`).
          type: object
          nullable: true
          additionalProperties:
            $ref: '#/components/schemas/MoneyView'
        mrrBop:
          description: >-
            Monthly contribution at the end of the previous month (movement and
            snapshot lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        mrrEop:
          description: >-
            Monthly contribution at the end of the month (movement and snapshot
            lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        delta:
          description: >-
            Change of the monthly contribution, `mrrEop − mrrBop` (movement
            lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        netAmount:
          description: >-
            Net amount (revenue lines: gross minus tax, i.e. after the position
            discount; invoice lines: document net). Signed: credit notes and
            cancellations are negative.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        grossAmount:
          description: Gross amount (revenue and invoice lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        openAmount:
          description: >-
            Open amount (invoice lines: as of now, or at the month end for
            outstanding receivables).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        unitAmount:
          description: Unit price per interval before discounts (snapshot lines).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        quantity:
          description: >-
            Quantity as an exact decimal string (snapshot lines; null for flat
            fees).
          type: string
          example: '3'
          nullable: true
        billingInterval:
          description: Billing interval (snapshot lines), e.g. `1M`, `P1Y`.
          type: string
          nullable: true
        from:
          description: Start of the contribution window or service period (ISO 8601).
          type: string
          format: date-time
          nullable: true
        to:
          description: >-
            Exclusive end of the contribution window or service period (ISO
            8601); null when open.
          type: string
          format: date-time
          nullable: true
        finalizationDate:
          description: Finalization date of the invoice (ISO 8601).
          type: string
          format: date-time
          nullable: true
        dueDate:
          description: Due date of the invoice (ISO 8601).
          type: string
          format: date-time
          nullable: true
        paidDate:
          description: Payment date of the transaction (ISO 8601).
          type: string
          format: date-time
          nullable: true
        documentKind:
          description: 'Revenue lines: `invoice`, `cancellation` or `credit_note`.'
          type: string
          enum:
            - invoice
            - cancellation
            - credit_note
          nullable: true
        documentNumber:
          description: 'Revenue lines: number of the document the position is on.'
          type: string
          nullable: true
        documentId:
          description: 'Revenue lines: id of that document.'
          type: string
          nullable: true
        referencedInvoiceId:
          description: >-
            Revenue lines: the invoice the line belongs to — for a cancellation
            or credit note the original invoice, for an invoice itself.
          type: string
          nullable: true
        referencedInvoiceNumber:
          description: 'Revenue lines: number of that invoice.'
          type: string
          nullable: true
        positionName:
          description: 'Revenue lines: the position text.'
          type: string
          nullable: true
        net:
          description: >-
            Revenue lines: net (gross − tax after position discounts), signed;
            the same value as `amount`.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        sources:
          description: Where the figures of the line come from.
          type: array
          items:
            $ref: '#/components/schemas/SourceRefView'
        daysToPayment:
          description: >-
            Invoice lines of a payment behaviour cell: calendar days from
            finalization to payment (the value the cell averages).
          type: integer
          example: 12
          nullable: true
        forwardKind:
          description: >-
            Forward lines: kind of the known change (`scheduled_end`,
            `scheduled_price_change`, `discount_end`, `pending_schedule_event`,
            `trial_end`, `scheduled_start`, `other`).
          type: string
          example: scheduled_end
          nullable: true
        cancellationReason:
          description: >-
            Movement and forward lines of a contract end: the cancellation
            reason code; null without one.
          type: string
          nullable: true
        invoiceDate:
          description: >-
            Forecast lines: invoice date the billing forecast expects (ISO
            8601).
          type: string
          format: date-time
          nullable: true
        forecastKind:
          description: >-
            Forecast lines: `pending_billing_item` (every billing item of the
            invoice is already pending), `pending_credit` (a net credit carrying
            a credit billing item: the only negative forecast line) or
            `projected` (projected by the billing forecast). `from` / `to` carry
            the billing period the invoice covers.
          type: string
          enum:
            - pending_billing_item
            - pending_credit
            - projected
          nullable: true
        days:
          description: >-
            Accounted lines: days of the service period in the month (30/360);
            null for a position without service period (counts fully in its
            finalization month).
          type: integer
          example: 30
          nullable: true
        totalDays:
          description: 'Accounted lines: days of the whole service period (30/360).'
          type: integer
          example: 360
          nullable: true
        contractAmount:
          description: 'Billing gap lines: MRR of the item at the month end ("Vertrag").'
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        expectedAmount:
          description: >-
            Billing gap lines: the contract by its days in the month (what the
            invoices should cover).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        accountedAmount:
          description: >-
            Billing gap lines: Accounted MRR of the item in the month
            ("Rechnung").
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        cause:
          description: 'Billing gap lines: cause of this part of the difference.'
          type: string
          enum:
            - partial_month
            - billing_start_later
            - not_yet_billed
            - upcoming_invoice
            - trial
            - credit_or_cancellation
            - billed_after_end
            - period_shift
            - price_mismatch
            - unknown
            - not_billed
          nullable: true
        causeLabel:
          description: 'Billing gap lines: German label of the cause ("Ursache").'
          type: string
          example: Abrechnung beginnt später
          nullable: true
        expectedText:
          description: >-
            Billing gap and build failure lines: what was expected ("Erwartet"),
            e.g. "erste Rechnung am 01.12.2026".
          type: string
          example: erste Rechnung am 01.12.2026
          nullable: true
        invoiceMonth:
          description: >-
            Cash lines: finalization month (YYYY-MM, time zone of the
            organisation) of the invoice the payment is attributed to; null when
            it pays no finalized invoice.
          type: string
          example: 2026-03
          nullable: true
        billableSince:
          description: >-
            Forecast lines: the day the invoice became billable when that lies
            before its invoice date (a catch-up of past billing periods the next
            run invoices, "Nachholrechnung"); null for an invoice on its regular
            date.
          type: string
          format: date-time
          nullable: true
        reasonLabel:
          description: >-
            Movement lines: German name of `reason` from the one reason catalog
            (the same as the table's `reasonLabels`); null without a reason.
          type: string
          example: Preisänderung
          nullable: true
        check:
          description: >-
            Build failure lines: code of the broken check ("Prüfung"), e.g.
            `CASH_WITHIN_DOCUMENT`; `IDENTITY` for the MRR identity.
          type: string
          example: CASH_WITHIN_DOCUMENT
          nullable: true
        actualText:
          description: >-
            Build failure lines: what the build found ("Tatsächlich");
            `expectedText` holds what the check expected.
          type: string
          example: collected 23800 − overpaid 0
          nullable: true
        counterpartTransactionId:
          description: >-
            Cash correction lines (transaction type `correction`): the
            transaction of the other entry of the pair (the cancelled refund for
            a counter-entry, the counter-entry for a cancelled refund).
          type: string
          nullable: true
        paymentMethodKind:
          description: >-
            Cash lines: payment method type of the transaction (`sepa_debit`,
            `card`, `bank_transfer`, …; else the gateway name). A `charged_back`
            line is a "Rücklastschrift" for `sepa_debit`, a "Chargeback" for
            `card`, never a return debit for a bank transfer.
          type: string
          example: sepa_debit
          nullable: true
      type: object
    PageMetaView:
      description: Pagination of a list response.
      properties:
        page:
          description: Current page, starting at 1.
          type: integer
          example: 1
        pageSize:
          description: Maximum number of entries per page.
          type: integer
          example: 25
        total:
          description: Number of entries over all pages.
          type: integer
          example: 112
        sum:
          description: >-
            Sum of `amount` over all entries of all pages (drill-down lists
            only). It equals the value of the cell the list explains; for
            contraction and lost the lines carry the signed change, so their sum
            is the negative of the unsigned cell.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        asOf:
          description: >-
            When the figures were last calculated (ISO 8601). Null when no
            calculation exists yet.
          type: string
          format: date-time
          nullable: true
      type: object
    DetailGroupView:
      description: >-
        The revenue lines that belong to one invoice: the invoice's own
        positions plus the cancellations and credit notes that refer to it.
      properties:
        referencedInvoiceId:
          description: Id of the invoice the group belongs to.
          type: string
        referencedInvoiceNumber:
          description: Number of that invoice.
          type: string
          nullable: true
        groupNet:
          description: >-
            Sum of `net` over the group's lines within the requested cell:
            invoice − cancellations − credit notes.
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        lines:
          description: The lines, by finalization date.
          type: array
          items:
            $ref: '#/components/schemas/DetailLineView'
      type: object
    FindingDetailView:
      description: >-
        One finding with the explanation of what the calculation assumed and the
        data it saw.
      properties:
        finding:
          description: The finding, as in the findings list.
          allOf:
            - $ref: '#/components/schemas/FindingView'
        explanation:
          description: Why the finding exists and the records behind it.
          allOf:
            - $ref: '#/components/schemas/FindingExplanationView'
      type: object
    Violation:
      type: object
      properties:
        propertyPath:
          type: string
          example: to
        message:
          type: string
          example: Der Zeitraum darf höchstens 36 Monate umfassen.
        code:
          type: string
          example: analytics.mrr_financials.range_too_long
      required:
        - propertyPath
        - message
        - code
    MoneyView:
      description: >-
        A money amount. `amount` is an exact decimal string with two decimal
        places (net, excluding VAT, unless stated otherwise); `currency` is the
        ISO-4217 code.
      properties:
        amount:
          description: >-
            Exact decimal amount with two decimal places, dot as separator.
            Negative amounts carry a leading minus.
          type: string
          example: '1234.56'
        currency:
          description: ISO-4217 currency code.
          type: string
          example: EUR
      type: object
    AccountRefView:
      description: >-
        An MRR account: one subscription, invoice address, customer or
        organisation, depending on the movement scope.
      properties:
        key:
          description: >-
            Account key: the subscription id, the invoice address id (or
            `customer:<id>` when the subscription uses the customer default),
            the customer id or the id of the organisation's root customer.
          type: string
        label:
          description: Display label of the account.
          type: string
          nullable: true
      type: object
    RefView:
      description: >-
        Reference to a customer, subscription, product or invoice: id, number
        and display name where they exist.
      properties:
        id:
          description: Id (UUID).
          type: string
          nullable: true
        number:
          description: >-
            Human-readable number (customer number, subscription number, invoice
            number).
          type: string
          nullable: true
        name:
          description: Display name.
          type: string
          nullable: true
      type: object
    ItemRefView:
      description: A subscription item (or a schedule product row that has no item yet).
      properties:
        id:
          description: Item id, or the product row id for a scheduled row without item.
          type: string
        name:
          description: Display name of the item.
          type: string
          nullable: true
        productName:
          description: Name of the product.
          type: string
          nullable: true
      type: object
    InvoiceRefView:
      description: Reference to an invoice document.
      properties:
        id:
          description: Invoice id (UUID).
          type: string
          nullable: true
        number:
          description: Invoice number.
          type: string
          nullable: true
        type:
          description: Document type.
          type: string
          enum:
            - TYPE_INVOICE
            - TYPE_CREDIT
            - TYPE_CANCEL
          nullable: true
        status:
          description: Document status at the time of the calculation.
          type: string
          nullable: true
      type: object
    TransactionRefView:
      description: Reference to a payment transaction.
      properties:
        id:
          description: Transaction id (UUID).
          type: string
        type:
          description: >-
            Direction and cause: `collected` for a payment, `refund_returned`
            for a refund that came back from the customer's bank, `refunded` for
            a refund, `charged_back` for a returned debit or chargeback,
            `paid_out` for a balance paid out to the customer, `return_fee` for
            the bank fee of a return debit without a return case (cash out, not
            part of the invoice), `correction` for a refund entered by hand and
            its counter-entry (no money moved).
          type: string
          enum:
            - collected
            - refund_returned
            - refunded
            - charged_back
            - paid_out
            - correction
      type: object
    SourceRefView:
      description: A source record behind a line.
      properties:
        kind:
          description: >-
            Kind of source: `subscription_item` (contract without schedule),
            `schedule_row` (subscription schedule), `invoice_position`,
            `payment_transaction`, `invoice`.
          type: string
          example: subscription_item
        id:
          description: Id of the source record.
          type: string
          nullable: true
      type: object
    FindingView:
      description: >-
        A data-quality finding of the latest calculation. Findings report, they
        never change data.
      properties:
        id:
          description: Id of the finding (stable across recalculations of unchanged data).
          type: string
        code:
          description: >-
            Finding code, e.g. `BILLED_VS_CONTRACT_DIFF`,
            `PRICE_HISTORY_UNKNOWN`, `INTRA_MONTH_LIFECYCLE`.
          type: string
          example: PRICE_HISTORY_UNKNOWN
        codeLabel:
          description: >-
            German name of the code (the one catalog; the code itself for an
            unknown code).
          type: string
          example: Preisverlauf unbekannt
        severity:
          description: Severity.
          type: string
          enum:
            - error
            - warning
            - info
        message:
          description: One English sentence describing the finding.
          type: string
        entityType:
          description: >-
            Kind of record the finding is about, e.g. `subscription_item`,
            `subscription`, `invoice_position`, `account:customer`.
          type: string
        entityId:
          description: Id of that record.
          type: string
        monthStart:
          description: >-
            Month the finding applies to (first day of the month, ISO 8601).
            Null when it is not month-specific.
          type: string
          format: date-time
          nullable: true
        customer:
          description: The customer the finding belongs to.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RefView'
        subscriptionId:
          description: Id of the subscription the finding belongs to.
          type: string
          nullable: true
        details:
          description: >-
            Code-specific details (for example billed and expected amounts as
            decimal strings).
          type: object
      type: object
    FindingExplanationView:
      description: >-
        Explanation of a finding: the records it is about, the assumption the
        calculation made, the key facts, and code-specific sections. A section
        is null when it does not apply to the code.
      properties:
        entity:
          description: Customer, subscription, item and product the finding is about.
          allOf:
            - $ref: '#/components/schemas/FindingEntityView'
        assumption:
          description: >-
            The assumption the calculation made for this code, one German
            sentence.
          type: string
        facts:
          description: Key facts of the finding with German labels.
          type: array
          items:
            $ref: '#/components/schemas/FindingFactView'
        months:
          description: >-
            `BILLED_VS_CONTRACT_DIFF`: every checked month of the item, contract
            against billed.
          type: array
          items:
            $ref: '#/components/schemas/FindingContractMonthView'
          nullable: true
        invoices:
          description: >-
            `BILLED_VS_CONTRACT_DIFF`: the recurring invoice positions of the
            item billed into the finding's month; `MANUAL_INVOICE_POSITION`: the
            position.
          type: array
          items:
            $ref: '#/components/schemas/FindingInvoiceView'
          nullable: true
        contract:
          description: >-
            The contract segments of the item, row or subscription as the
            calculation stored them.
          type: array
          items:
            $ref: '#/components/schemas/FindingSegmentView'
          nullable: true
        priceHistory:
          description: >-
            Price changes recorded for the item's price plan (an empty list:
            none recorded).
          type: array
          items:
            $ref: '#/components/schemas/FindingPriceHistoryView'
          nullable: true
      type: object
    FindingEntityView:
      description: The records a finding is about, with numbers and names.
      properties:
        type:
          description: >-
            Kind of record, e.g. `subscription_item`, `subscription`,
            `invoice_position`.
          type: string
        id:
          description: Id of that record.
          type: string
        customer:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RefView'
        subscription:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RefView'
        item:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ItemRefView'
        product:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RefView'
      type: object
    FindingFactView:
      description: >-
        One fact of a finding: the key in `details`, a German label and the
        value as text.
      properties:
        key:
          description: Key in the finding's `details`.
          type: string
        label:
          description: German label.
          type: string
        value:
          description: Value as text (amounts as exact decimals, instants in ISO 8601).
          type: string
          nullable: true
        money:
          description: >-
            The value as a money amount, for the amounts of a `RESTATEMENT`
            finding (`snapshotValue`, `currentValue`, `delta`); null otherwise.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        causeLabel:
          description: >-
            German labels of the causes of a `RESTATEMENT` finding (key
            `causes`), comma-separated; null otherwise.
          type: string
          example: Vertragsende geändert
          nullable: true
      type: object
    FindingContractMonthView:
      description: >-
        One month of the billed-against-contract check of an item (30/360 day
        count).
      properties:
        month:
          description: Month (YYYY-MM).
          type: string
          example: 2026-03
        contractAmount:
          description: 'Contract amount of the month: monthly amount × contract days / 30.'
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        billedAmount:
          description: >-
            Billed recurring net of the month: each position prorated by the
            days of its service period.
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        difference:
          description: Billed − contract.
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        prorationDays:
          description: Days of the month covered by the contract (30/360).
          type: integer
        tolerance:
          description: 'Allowed difference: max(2.00, 2 % of the contract amount).'
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        invoiceLines:
          description: Number of invoice positions billed into the month.
          type: integer
        flagged:
          description: >-
            Whether the difference exceeds the tolerance (a finding exists for
            the month).
          type: boolean
        cause:
          description: >-
            Why billed and contract differ in the month (null when they are
            equal): `billing_start_later`, `not_yet_billed` (the next billing
            run will invoice it), `not_billed` (an elapsed month no run will
            invoice), `upcoming_invoice`, `trial`, `credit_or_cancellation`,
            `billed_after_end` (the contract ended before the month end, the
            invoices still bill it), `period_shift` (a service period starts at
            23:00 local time the day before, one day lands in the previous
            month), `price_mismatch`, `unknown`.
          type: string
          example: billing_start_later
          nullable: true
        causeLabel:
          description: German label of the cause ("Ursache").
          type: string
          example: Abrechnung beginnt später
          nullable: true
        expectedText:
          description: What was expected ("Erwartet"), e.g. "erste Rechnung am 01.12.2026".
          type: string
          example: erste Rechnung am 01.12.2026
          nullable: true
      type: object
    FindingInvoiceView:
      description: An invoice position behind a finding.
      properties:
        invoice:
          description: Invoice, cancellation or credit note.
          allOf:
            - $ref: '#/components/schemas/InvoiceRefView'
        positionId:
          description: Id of the position.
          type: string
        net:
          description: Net of the position (signed).
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        shareInMonth:
          description: >-
            Part of the net that falls into the finding's month; equal to `net`
            without a service period.
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        daysInMonth:
          description: >-
            Days of the service period in the month (30/360); null without a
            service period.
          type: integer
          nullable: true
        servicePeriodDays:
          description: >-
            Days of the whole service period (30/360); null without a service
            period.
          type: integer
          nullable: true
        serviceFrom:
          description: Service period start.
          type: string
          format: date-time
          nullable: true
        serviceTo:
          description: Service period end.
          type: string
          format: date-time
          nullable: true
        finalizationDate:
          description: Finalization date of the document.
          type: string
          format: date-time
          nullable: true
      type: object
    FindingSegmentView:
      description: >-
        A stored contract segment: a period with one monthly amount and the
        price inputs it was calculated from.
      properties:
        itemId:
          description: Subscription item, or the schedule product row without item.
          type: string
          nullable: true
        validFrom:
          description: Start (inclusive).
          type: string
          format: date-time
        validTo:
          description: End (exclusive); null while open.
          type: string
          format: date-time
          nullable: true
        monthlyAmount:
          description: Monthly amount (MRR contribution).
          allOf:
            - $ref: '#/components/schemas/MoneyView'
        quantity:
          description: Quantity as exact decimal.
          type: string
          nullable: true
        billingInterval:
          description: Billing interval of the price, e.g. `P1M`.
          type: string
          nullable: true
        priceSource:
          description: >-
            Where the price came from: `current` (the plan today), `history` (a
            recorded price change), `audit` (the change log), `assumed`.
          type: string
          nullable: true
        priceHistoryId:
          description: The price-history entry used, if any.
          type: string
          nullable: true
        sourceKind:
          description: 'Kind of source: `legacy_item` or `schedule_row`.'
          type: string
        inputs:
          description: >-
            The stored inputs (price inputs, price source, measurement,
            discounts, events).
          type: object
      type: object
    FindingPriceHistoryView:
      description: A recorded price change of a price plan.
      properties:
        id:
          description: Id of the entry.
          type: string
        appliedOn:
          description: From when the price applies.
          type: string
          format: date-time
        priceUpdate:
          description: The stored price of the entry.
          type: object
      type: object
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      description: >-
        API token of the organisation. Send it as Authorization: Bearer api_...
        The token is bound to exactly one organisation.

````