> ## 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.

# Settle a credit note or cancellation

> Books the settlement the preview shows, in one transaction: a waiting refund of the credit note is cancelled, the document is booked against its invoice (a cancellation adjustment on the invoice; for a credit note also on the credit note), the rest of a credit note goes to the customer balance and is applied to the customer's open invoices with the oldest due date first. Every touched document gets an activity entry. No accounting posting is written. A second call finds nothing to settle and returns `executed: false`. The same endpoint exists as `/api/invoices/cancellations/{id}/settlement`.

Required permission: `invoice:credit`.



## OpenAPI

````yaml assets/openapi-v2-finance.json post /api/invoices/credit-notes/{id}/settlement
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, the investor
    update 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`, closing an offer
    `offer:write`. Every `/api/analytics/` route also needs the finance reports
    to be enabled for the organisation (feature flag `analytics.advanced`);
    otherwise it answers 403 `feature-not-available`. The recurring revenue,
    customer base and liquidity data, the snapshots and the investor update also
    need the Advanced Insights function.
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 und Investor-Update
    description: Month-end snapshots and the investor pack.
  - 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.
  - name: Gutschriften verrechnen
    description: Preview and settle a credit note or cancellation.
  - name: Angebote schließen
    description: Seller-side end states of an offer. Beta.
paths:
  /api/invoices/credit-notes/{id}/settlement:
    post:
      tags:
        - Gutschriften verrechnen
      summary: Settle a credit note or cancellation
      description: >-
        Books the settlement the preview shows, in one transaction: a waiting
        refund of the credit note is cancelled, the document is booked against
        its invoice (a cancellation adjustment on the invoice; for a credit note
        also on the credit note), the rest of a credit note goes to the customer
        balance and is applied to the customer's open invoices with the oldest
        due date first. Every touched document gets an activity entry. No
        accounting posting is written. A second call finds nothing to settle and
        returns `executed: false`. The same endpoint exists as
        `/api/invoices/cancellations/{id}/settlement`.


        Required permission: `invoice:credit`.
      operationId: settleCreditNote
      parameters:
        - name: id
          in: path
          description: Id of the credit note or cancellation.
          required: true
          schema:
            type: string
            format: uuid
            pattern: '[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}'
      responses:
        '200':
          description: >-
            The booked rows (`executed: true`), or the unchanged plan when
            nothing was left to settle (`executed: false`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteSettlementView'
        '401':
          description: Missing or invalid authentication.
        '403':
          description: Missing permission invoice:credit.
        '404':
          description: No such document in this environment.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '409':
          description: >-
            INVOICE__CREDIT_NOTE_SETTLEMENT_BLOCKED with `reasons`:
            `written_off` (the invoice is written off), `refund_in_progress` (a
            refund of the credit note is being executed or cannot be cancelled),
            `credit_note_closed` (the credit note is closed on its own side, the
            rest cannot be recorded on it), `plan_changed` (the customer balance
            or an open amount changed meanwhile). Nothing is booked.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '422':
          description: >-
            INVOICE__CREDIT_DOCUMENT_REQUIRED: the document is no finalized
            credit note, or a cancellation without an invoice.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblem'
      security:
        - ApiToken: []
components:
  schemas:
    CreditNoteSettlementView:
      description: >-
        Settlement of a credit note or cancellation against its invoice and the
        customer balance, as rows.
      properties:
        creditDocument:
          $ref: '#/components/schemas/CreditNoteSettlementPartyView'
        currency:
          description: Currency of every amount (ISO 4217).
          type: string
          example: EUR
        unsettledAmount:
          description: >-
            Part of the document not yet settled before this settlement, decimal
            string; 0.00 when there is nothing to settle.
          type: string
          example: '1943.27'
        steps:
          description: >-
            The rows in booking order: the document against its invoice, the
            rest to the customer balance, the balance applied to open invoices
            (oldest due date first).
          type: array
          items:
            $ref: '#/components/schemas/CreditNoteSettlementStepView'
        remainingBalance:
          description: >-
            Customer balance after the settlement (the last row), decimal
            string.
          type: string
          example: '174.93'
        remainingBalanceTags:
          description: Notes on the last row.
          type: array
          items:
            $ref: '#/components/schemas/CreditNoteSettlementTagView'
        warnings:
          description: Every warning of the rows, once each.
          type: array
          items:
            $ref: '#/components/schemas/CreditNoteSettlementTagView'
        executable:
          description: >-
            True when the settlement can run: something is unsettled and nothing
            blocks it.
          type: boolean
        executed:
          description: >-
            True when this response booked the rows. False for the preview and
            for a settlement that found nothing to settle.
          type: boolean
      type: object
    Problem:
      type: object
      description: >-
        Error body (problem+json). `type` is the error key, e.g.
        `OFFER__NOT_CLOSABLE`; further keys carry the parameters of the error.
      properties:
        status:
          type: integer
          example: 409
        type:
          type: string
          example: ANALYTICS_FINANCE__PACK_WITHOUT_SNAPSHOT
        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
    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
    CreditNoteSettlementPartyView:
      description: 'One end of a settlement row: a document or the customer balance.'
      properties:
        kind:
          description: '`document` or `customer_balance`.'
          type: string
          enum:
            - document
            - customer_balance
        id:
          description: Id of the document; null for the customer balance.
          type: string
          format: uuid
          nullable: true
        number:
          description: Number of the document; null for the customer balance.
          type: string
          example: GS-7019-2025
          nullable: true
        documentType:
          description: Type of the document; null for the customer balance.
          type: string
          enum:
            - invoice
            - credit_note
            - cancellation
          nullable: true
        label:
          description: 'Display text: the document number, or "Kundenkonto".'
          type: string
          example: RE-3843-2025
      type: object
    CreditNoteSettlementStepView:
      description: >-
        One row of a credit-note settlement: an amount moves from one document
        or the customer balance to another.
      properties:
        from:
          $ref: '#/components/schemas/CreditNoteSettlementPartyView'
        to:
          $ref: '#/components/schemas/CreditNoteSettlementPartyView'
        amount:
          description: >-
            Amount as a decimal string in the currency of the settlement, never
            negative (0.00 when the invoice is paid already).
          type: string
          example: '1943.27'
        tags:
          description: Notes on the row.
          type: array
          items:
            $ref: '#/components/schemas/CreditNoteSettlementTagView'
      type: object
    CreditNoteSettlementTagView:
      description: A note on one row of a credit-note settlement.
      properties:
        key:
          description: Stable key of the note.
          type: string
          enum:
            - already_paid
            - cancellation
            - refund_cancelled
            - payment_present
            - double_covered
            - excess_balance
            - written_off
            - refund_in_progress
            - credit_note_closed
        label:
          description: German label of the note.
          type: string
          example: bereits bezahlt
        warning:
          description: >-
            True for a warning: a check that flags the result after the
            settlement, or a reason the settlement cannot run.
          type: boolean
      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
  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.

````