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

# List dunning flows

> Includes historical versions referenced by existing invoices. The current is_default configuration sorts first. is_active is a kill switch, not a latest-version indicator.



## OpenAPI

````yaml /api-docs/mahnservice-api/openapi.json get /mahnservice/v1/dunning-flows/
openapi: 3.0.3
info:
  description: >-
    Public REST API for the paywise Mahnservice (pre-collection dunning), an
    alternative input path to the bookkeeping integrations (Lexware Office,
    sevDesk) and the CSV import.


    Authentication uses a Bearer token (the same token works for the Inkasso
    API). Each token is bound to a company and a legacy access mode: `test` or
    `production`. Access mode is a data-isolation lane, not the API environment:
    modern credentials use `production` in both production and sandbox. Read
    `/info/`'s `environment` (`production` or `sandbox`) to identify the
    environment serving your request.


    Resources: token introspection (`/info/`), debtors (create/list/get), and
    the invoice lifecycle -- submit (held), upload the invoice PDF (multipart or
    base64; scanned asynchronously, poll the document `status`), release for
    dunning, report payments, cancel / write off, and read the dunning state
    (`dunning_state`, the dunning flow and the sent dunnings with their fees),
    pause and resume the dunning, and read the dunning-flow configuration
    (`/dunning-flows/`). Webhooks notify you about `invoice.created`,
    `invoice.paid`, `invoice.cancelled`, `invoice.written_off`,
    `dunning.level_advanced` and `dunning.handed_to_collection`. Test-mode
    invoices are visible everywhere but never dunned, and their events only
    reach test-mode endpoints.


    Contract: requests are JSON only (documents may also be multipart); unknown
    or read-only body fields and unknown query parameters are rejected with
    `400`; list pages take `limit` (1-100, default 10) and `offset`. Errors are
    English and machine-readable: every error body is `{detail, code[, errors]}`
    -- branch on `code` (`validation_error` with per-field `errors`,
    `not_authenticated`, `permission_denied` -- the token lacks the scope,
    `subscription_required` -- no active Mahnservice subscription (writes other
    than payment reporting), `company_locked` -- the account is locked by
    paywise (every write), `not_found`, `unsupported_media_type`,
    `request_too_large`, `throttled`, `unexpected_body`, and the documented
    `409` codes). A repeat submission of an invoice number that was cancelled,
    written off or archived is a `409` (`invoice_cancelled` /
    `invoice_written_off` / `invoice_archived`), not a replay. `HEAD` mirrors
    `GET` and never writes. Every response carries `X-Paywise-Request-Id`,
    `X-Paywise-Environment` and `Cache-Control: private, no-store`. Token scopes
    apply: `mahnservice:debtors:read` / `:write` and `mahnservice:invoices:read`
    / `:write` (a `:write` grant includes `:read`; keys minted with the full `*`
    grant have everything). Rate limits: 600 requests per minute per key and per
    company, shared with the Case Management API, plus a per-operation window of
    120 writes per minute; a `429` carries `Retry-After`.
  title: paywise Mahnservice API
  version: v1
servers:
  - description: Production environment
    url: https://api.paywise.de
security: []
tags:
  - description: The authenticated credential and its context.
    name: Info
  - description: Debtors invoices are addressed to.
    name: Debtors
  - description: Held invoices, their release, payments and documents.
    name: Invoices
  - description: Dunning flow configurations referenced by invoices.
    name: Dunning flows
externalDocs:
  url: https://docs.paywise.de/api-docs/mahnservice-api/introduction
paths:
  /mahnservice/v1/dunning-flows/:
    get:
      tags:
        - Dunning flows
      summary: List dunning flows
      description: >-
        Includes historical versions referenced by existing invoices. The
        current is_default configuration sorts first. is_active is a kill
        switch, not a latest-version indicator.
      operationId: list-dunning-flows
      parameters:
        - description: Number of results to return per page; defaults to 10.
          in: query
          name: limit
          required: false
          schema:
            default: 10
            maximum: 100
            minimum: 1
            type: integer
        - description: Zero-based index of the first result; defaults to 0.
          in: query
          name: offset
          required: false
          schema:
            default: 0
            minimum: 0
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDunningFlowList'
          description: ''
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            Retry-After:
              description: Integer seconds to wait before retrying a throttled request.
              schema:
                minimum: 1
                type: integer
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
      security:
        - tokenAuth: []
components:
  schemas:
    PaginatedDunningFlowList:
      properties:
        count:
          description: Total number of matching resources.
          example: 123
          type: integer
        next:
          description: URL for the next page, or null on the last page.
          example: http://api.example.org/accounts/?offset=400&limit=100
          format: uri
          nullable: true
          type: string
        previous:
          description: URL for the previous page, or null on the first page.
          example: http://api.example.org/accounts/?offset=200&limit=100
          format: uri
          nullable: true
          type: string
        results:
          description: Resources returned for the requested page.
          items:
            $ref: '#/components/schemas/DunningFlow'
          type: array
      required:
        - count
        - results
      type: object
    Error:
      properties:
        code:
          description: Machine-readable error category.
          type: string
        detail:
          description: Short human-readable summary of the error.
          type: string
        errors:
          description: Field-level validation errors, when applicable.
          items:
            $ref: '#/components/schemas/ErrorItem'
          type: array
      required:
        - detail
        - code
      type: object
    DunningFlow:
      description: |-
        A configured dunning flow (Mahnlauf). `levels` is the ordered level
        configuration; `level_count` matches the summary shape embedded in
        `GET /invoices/{uuid}/dunning/`.
      properties:
        fees_enabled:
          description: >-
            Master switch for dunning fees. A level's fee is charged only when
            this and the level's fee_enabled are true.
          readOnly: true
          type: boolean
        id:
          description: Stable identifier of the dunning flow.
          format: uuid
          readOnly: true
          type: string
        is_activated:
          description: >-
            Whether sending has been activated for this flow in the paywise
            portal. Released invoices remain pending until activation, unless
            another hold applies.
          readOnly: true
          type: boolean
        is_active:
          description: >-
            False = the flow was deactivated by paywise (no new enrollments;
            invoices already running on it continue). Not a deletion.
          readOnly: true
          type: boolean
        is_default:
          description: >-
            Current enrollment configuration. Non-default rows include
            historical versions still referenced by existing invoices; is_active
            does not identify the latest version.
          readOnly: true
          type: boolean
        level_count:
          description: Number of configured dunning levels.
          readOnly: true
          type: integer
        levels:
          description: >-
            Dunning-level configurations in level order. Flow configuration is
            read-only through this API.
          items:
            $ref: '#/components/schemas/DunningFlowLevel'
          readOnly: true
          type: array
        name:
          description: Name of the dunning flow.
          readOnly: true
          type: string
      required:
        - fees_enabled
        - id
        - is_activated
        - is_active
        - is_default
        - level_count
        - levels
        - name
      type: object
    ErrorItem:
      properties:
        code:
          description: Machine-readable field error code.
          type: string
        field:
          description: >-
            Path to the field that caused the error, using dots for objects and
            brackets for list indexes, for example `claims[0].amount`; null for
            an error without a field path.
          nullable: true
          type: string
        message:
          description: Human-readable explanation of the field error.
          type: string
      required:
        - field
        - code
        - message
      type: object
    DunningFlowLevel:
      description: One escalation level of a dunning flow.
      properties:
        channel:
          allOf:
            - $ref: '#/components/schemas/ChannelEnum'
          description: >-
            Configured delivery channel for this level: email, postal letter, or
            both.
          readOnly: true
        days_after_previous:
          description: >-
            Delay in days after the previous level; for level 1, measured from
            the invoice due date.
          readOnly: true
          type: integer
        fee_amount:
          description: >-
            Configured dunning fee for this level in EUR. Charged only when both
            the flow and this level enable fees.
          format: decimal
          pattern: ^-?\d{0,6}(?:\.\d{0,2})?$
          readOnly: true
          type: string
        fee_enabled:
          description: >-
            Whether this level charges a dunning fee; effective only when the
            flow's fees_enabled is also true.
          readOnly: true
          type: boolean
        level:
          description: One-based position of this level in the dunning flow.
          readOnly: true
          type: integer
      required:
        - channel
        - days_after_previous
        - fee_amount
        - fee_enabled
        - level
      type: object
    ChannelEnum:
      description: |-
        * `email` - E-Mail
        * `letter` - Brief
        * `both` - E-Mail & Brief
      enum:
        - email
        - letter
        - both
      type: string
  securitySchemes:
    tokenAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.