{
    "openapi": "3.1.0",
    "info": {
        "title": "FlowAccounting API",
        "version": "v1",
        "description": "Invoicing API for invoices, quotes, credit notes, line items, transactions, products, tax rates and recurring billing, as well as expenses and receipts. With PDF, ZUGFeRD and XRechnung export and Stripe payment reconciliation."
    },
    "servers": [
        {
            "url": "https://api.flowsuite.one",
            "description": "FlowSuite API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "invoices",
            "description": "Invoices"
        },
        {
            "name": "items",
            "description": "Invoice line items"
        },
        {
            "name": "transactions",
            "description": "Transactions"
        },
        {
            "name": "products",
            "description": "Products"
        },
        {
            "name": "tax-rates",
            "description": "Tax rates"
        },
        {
            "name": "recurring",
            "description": "Recurring invoices"
        },
        {
            "name": "installment-plans",
            "description": "Installment plans"
        },
        {
            "name": "billable-items",
            "description": "Billable items"
        },
        {
            "name": "quotes",
            "description": "Quotes"
        },
        {
            "name": "quote-items",
            "description": "Quote line items"
        },
        {
            "name": "credit-notes",
            "description": "Credit notes"
        },
        {
            "name": "expenses",
            "description": "Expenses"
        },
        {
            "name": "suppliers",
            "description": "Suppliers"
        },
        {
            "name": "expense-categories",
            "description": "Expense categories"
        },
        {
            "name": "income-categories",
            "description": "Income categories"
        },
        {
            "name": "reports",
            "description": "Reports and context"
        },
        {
            "name": "tax-profile",
            "description": "Tax profile and features"
        }
    ],
    "paths": {
        "/flowaccounting/invoices": {
            "get": {
                "operationId": "invoices-list",
                "summary": "List invoices",
                "description": "Retrieves a paginated list of all invoices of the team (sorted by invoice date, newest first).",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "include",
                        "in": "query",
                        "required": false,
                        "description": "With items, the invoice line items including name and description are embedded",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter: draft, sent, partially_paid, paid, overdue, past_due, cancelled",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter by customer UUID (cmm_clients). Breaking change: the former filters client_id and contact_id are rejected with 422 instead of being silently ignored",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search term (invoice number, recipient name, company)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Invoice date from (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Invoice date to (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1-200, default: 15)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                            "invoice_number": "RE-2026-0042",
                                            "status": "sent",
                                            "recipient_name": "Doe GmbH",
                                            "total": 1190,
                                            "allowed_transitions": [
                                                "paid",
                                                "cancelled"
                                            ]
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 42
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "invoices-create",
                "summary": "Create invoice",
                "description": "Creates a new invoice. The invoice number is assigned automatically from the team's number series, but only when the invoice is issued (status change to sent, sending by email or send on creation): a draft has invoice_number: null, and a deleted draft uses up no number. If you need the number, read it from the response after issuing or with GET. For importing old invoices it can be set with invoice_number. An invoice with a given number gets the payment method bank_transfer if payment_method is missing; the customer's default payment method is not used then. The full order of a takeover is described in the section \"Taking over documents from another system\". If the number series collides with existing documents when issuing, the issuing endpoint responds with 409 and error_code: document_number_conflict. Line items can either be passed directly on creation via items or added afterwards with the line item endpoint; both ways are valid. Without send the invoice is created with status draft. With send it is sent by email right after creation and moves to status sent. In that case the response also contains the field sent, and if sending failed, also send_error_code and send_message. The invoice is still created with 201. If billing_operation_key is passed and the invoice for it already exists, the API returns the existing state and applies neither items nor send a second time, so a repeated call never sends twice. Breaking change: the former numeric fields client_id, contact_id and items.*.product_id are no longer accepted (validation error); customer, contact and product are given only with client_uuid, contact_uuid and items.*.product_uuid. § 19 notice: if the confirmed tax profile says the team is a small business in Germany (Kleinunternehmer under Section 19 UStG) and the amount still open on the invoice would, once paid, exceed this year's revenue limit (or the limit is already exceeded), the response also contains the field notices: a list with code small_business_limit, level would_exceed or already_exceeded, context invoice, year, the amounts in euros (limit_eur, known_turnover_eur, amount_eur, turnover_after_eur), complete (false if payments are unresolved), blocking (always false) and message. The notice never blocks and never changes the tax profile; without a notice the field is absent.",
                "tags": [
                    "invoices"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "invoice_number": null,
                                        "status": "draft"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "recipient_name": {
                                        "type": "string",
                                        "description": "Name of the invoice recipient"
                                    },
                                    "invoice_date": {
                                        "type": "string",
                                        "description": "Invoice date (YYYY-MM-DD)"
                                    },
                                    "due_date": {
                                        "type": "string",
                                        "description": "Due date (>= invoice_date). If empty: invoice_date + the team's payment term (default 14 days)"
                                    },
                                    "currency_code": {
                                        "type": "string",
                                        "description": "ISO 4217 currency code (3 characters, e.g. EUR)"
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "Optional: customer UUID (cmm_clients, team-bound)"
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "Optional: contact UUID (team-bound)"
                                    },
                                    "invoice_number": {
                                        "type": "string",
                                        "description": "Optional: your own invoice number, meant only for importing old invoices. Normally leave it out so the number series assigns the number. AI assistants and agents only set the field if the user explicitly insists on their own number. At most 40 characters from the letters A to Z, digits, space, dot, underscore and hyphen, starting and ending with a letter or digit. Must be unique within the team, also against deleted drafts and cancelled invoices. If the number lies within the current number series, it must be below the next counter value; to do this, first set the next invoice number in the FlowAccounting settings above the highest import number. The counter stays unchanged. After creation the number can no longer be changed"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Visible note on the invoice"
                                    },
                                    "payment_method": {
                                        "type": "string",
                                        "description": "Payment method: bank_transfer | sepa | stripe | paypal | cash | other. Without a value, the customer's default payment method from FlowCRM applies (not set = bank transfer); credit card or SEPA are therefore only used if they are stored as the default there or given here explicitly. Exception: with a given invoice_number, bank_transfer always applies without a value, so that an imported old invoice is not charged to a payment method stored for the customer; an explicitly given payment method applies even then. stripe, sepa and paypal require a saved Stripe payment method of the matching type for the customer (otherwise 422)."
                                    },
                                    "stripe_pm_id": {
                                        "type": "string",
                                        "description": "Optional: a specific Stripe payment method (pm_...) of the customer. Without a value, for stripe, sepa and paypal it is filled in from the customer's default payment method."
                                    },
                                    "tax_treatment": {
                                        "type": "string",
                                        "description": "Tax treatment of this invoice: standard | reverse_charge | reverse_charge_domestic | intra_community_supply | export | non_taxable_abroad | tax_exempt. Without a value, manual invoices use the customer's tax treatment from FlowCRM. With every value except standard, the invoice shows no VAT and carries the matching mandatory note: line items with a tax_rate above 0 or with unit_price_gross are rejected with 422. Only for source manual. reverse_charge_domestic (domestic reverse charge under Section 13b UStG) and tax_exempt (exempt under Section 4 UStG) only exist under German law: a team that is not subject to German law according to its tax profile cannot set them anew (422), a value already stored stays allowed."
                                    },
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption for tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters). Appears in the note \"Steuerfrei nach … UStG\"; without a value a general note on Section 4 UStG. Ignored for other tax treatments"
                                    },
                                    "property_retention_notice": {
                                        "type": "boolean",
                                        "description": "Service connected with a property for a private person: prints the note on the two-year retention obligation (Section 14b (1) sentence 5 UStG)"
                                    },
                                    "document_language": {
                                        "type": "string",
                                        "description": "Document language of the invoice: de | en | pt. Without a value, manual invoices use the customer's invoice language from FlowCRM, otherwise de"
                                    },
                                    "send": {
                                        "type": "boolean",
                                        "description": "Send the invoice by email right after creation. Without this flag it stays a draft"
                                    },
                                    "items": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Pass invoice line items directly, 1 to 200. For each line item <code>quantity</code> and <code>unit_price</code> are required, <code>name</code>, <code>description</code>, <code>tax_rate</code>, <code>unit</code>, <code>position</code>, <code>product_uuid</code>, <code>discount_percent</code> and <code>type</code> are optional. Without <code>position</code> the line items are numbered consecutively"
                                    }
                                },
                                "required": [
                                    "recipient_name",
                                    "invoice_date",
                                    "currency_code"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}": {
            "get": {
                "operationId": "invoices-show",
                "summary": "Get invoice details",
                "description": "Get invoice details, including line items, transactions as well as total_paid, remaining_amount and allowed_transitions. sent_date is the day the invoice was sent and is null for a draft. kind is invoice or cancellation (cancellation invoice). A cancellation invoice is a document of its own with its own number from the invoice series and negative amounts; cancels_invoice names the cancelled invoice (uuid, invoice_number, invoice_date). A cancelled invoice keeps its number and content, cancelled_by_invoice points to its cancellation invoice and cancelled_at gives the time. original_invoice_number is only set for cancellations from before cancellation invoices existed: back then the cancelled invoice itself got a new number, and the field names the number it was issued under. credit_notes lists the credit notes created for this invoice, ascending by credit note date, each with uuid, credit_note_number, status, credit_note_date, total and currency_code; the full credit note comes from the credit note endpoint. credit_notes only exists in this detail response, not in the list.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "invoice_number": "RE-2026-0042",
                                        "original_invoice_number": null,
                                        "kind": "invoice",
                                        "cancels_invoice": null,
                                        "cancelled_by_invoice": null,
                                        "cancelled_at": null,
                                        "status": "paid",
                                        "invoice_date": "2026-01-10T00:00:00+01:00",
                                        "due_date": "2026-01-24T00:00:00+01:00",
                                        "sent_date": "2026-01-10",
                                        "paid_date": "2026-01-20",
                                        "total": 1190,
                                        "currency_code": "EUR",
                                        "payment_method": "bank_transfer",
                                        "total_paid": 1190,
                                        "remaining_amount": 0,
                                        "allowed_transitions": [
                                            "cancelled"
                                        ],
                                        "items": [
                                            {
                                                "uuid": "3f2b1c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                                                "name": "Beratung",
                                                "quantity": 10,
                                                "unit_price": 100,
                                                "tax_rate": 19,
                                                "total": 1190
                                            }
                                        ],
                                        "transactions": [
                                            {
                                                "uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
                                                "type": "payment",
                                                "amount": 952,
                                                "currency_code": "EUR",
                                                "transaction_date": "2026-01-16T00:00:00+01:00"
                                            },
                                            {
                                                "uuid": "1d4e5f6a-7b8c-4d9e-a0b1-c2d3e4f5a6b7",
                                                "type": "credit",
                                                "amount": 238,
                                                "currency_code": "EUR",
                                                "transaction_date": "2026-01-20T00:00:00+01:00"
                                            }
                                        ],
                                        "credit_notes": [
                                            {
                                                "uuid": "9b2e4f6a-1c3d-4e5f-8a7b-6c5d4e3f2a1b",
                                                "credit_note_number": "GS-2026-0003",
                                                "status": "settled",
                                                "credit_note_date": "2026-01-20",
                                                "total": 238,
                                                "currency_code": "EUR"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "invoices-update",
                "summary": "Update invoice",
                "description": "Update an invoice. Only possible with status draft or sent and source manual (otherwise 422). A draft accepts the same header fields as on creation. An issued invoice is locked in content (GoBD, the German bookkeeping rules): only internal_notes, payment_method and stripe_pm_id can still be changed, as in the web interface. If the request contains another field (e.g. client_uuid, recipient_*, invoice_date, due_date, service_date_*, currency_code, document_language, notes, greeting_text, closing_text, payment_reference), the endpoint responds with 422 and error_code invoice_locked, names the fields in locked_fields, the allowed ones in allowed_fields and the ways to correct in correction, and writes nothing, not even the allowed fields of the same request. This also applies to a draft while a payment is running or a payment link is open. Content corrections go through POST /invoices/{uuid}/correct (correct invoice), a credit note (POST /credit-notes) or a cancellation. Breaking change: client_id and contact_id are no longer accepted; only client_uuid and contact_uuid.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": false,
                                    "error_code": "invoice_locked",
                                    "message": "Die Rechnung ist ausgestellt und inhaltlich festgeschrieben. …",
                                    "locked_fields": [
                                        "recipient_name"
                                    ],
                                    "allowed_fields": [
                                        "internal_notes",
                                        "payment_method",
                                        "stripe_pm_id"
                                    ],
                                    "correction": [
                                        {
                                            "action": "correct",
                                            "method": "POST",
                                            "path": "/api/flowaccounting/invoices/{uuid}/correct"
                                        },
                                        {
                                            "action": "credit_note",
                                            "method": "POST",
                                            "path": "/api/flowaccounting/credit-notes",
                                            "body": {
                                                "invoice_uuid": "{uuid}"
                                            }
                                        },
                                        {
                                            "action": "cancel",
                                            "method": "POST",
                                            "path": "/api/flowaccounting/invoices/{uuid}/status",
                                            "body": {
                                                "status": "cancelled"
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "recipient_name": {
                                        "type": "string",
                                        "description": "Name of the invoice recipient. Only changeable in a draft"
                                    },
                                    "due_date": {
                                        "type": "string",
                                        "description": "Due date. Only changeable in a draft"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Visible note on the invoice. Only changeable in a draft"
                                    },
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption for tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters). Only changeable in a draft"
                                    },
                                    "property_retention_notice": {
                                        "type": "boolean",
                                        "description": "Note on the retention obligation for property-related services to private persons (Section 14b (1) sentence 5 UStG). Only changeable in a draft"
                                    },
                                    "document_language": {
                                        "type": "string",
                                        "description": "Document language of the invoice: de | en | pt. Only changeable in a draft"
                                    },
                                    "internal_notes": {
                                        "type": "string",
                                        "description": "Internal note, does not appear on the invoice. Still changeable after issuing"
                                    },
                                    "payment_method": {
                                        "type": "string",
                                        "description": "Payment method (bank_transfer | stripe | sepa | paypal | cash | other). Still changeable after issuing"
                                    },
                                    "stripe_pm_id": {
                                        "type": "string",
                                        "description": "Saved Stripe payment method of the customer (pm_…) matching the payment method. Still changeable after issuing"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "invoices-delete",
                "summary": "Delete invoice",
                "description": "Delete an invoice. Only possible with status draft (otherwise 422). A draft without a number is deleted and uses up no number. If the draft already has a number (saved before 2026-11-22, taken over with a given invoice_number, or a correction draft), it is discarded: the number stays taken and is never assigned again, and the response names it in retained_invoice_number.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Entwurf verworfen. Die Rechnungsnummer RE-2026-0041 bleibt belegt und wird nicht erneut vergeben.",
                                    "retained_invoice_number": "RE-2026-0041"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/status": {
            "post": {
                "operationId": "invoices-status",
                "summary": "Set invoice status",
                "description": "Direct status change. This endpoint only allows the transitions to sent (send) and cancelled (cancel). For a transition that is not allowed: 422 with the field allowed_transitions. On the change to sent, an invoice without a number gets its invoice number from the number series, and today counts as the sent date; no email is sent. When an issued invoice changes to cancelled, a separate cancellation invoice (kind cancellation) with a new number and negative line items is created; the invoice itself keeps its number and content and points to it with cancelled_by_invoice. A draft is cancelled without a cancellation invoice. A cancellation invoice itself can't be cancelled, corrected or duplicated. For old invoices from another system, the actual sent date can be passed with sent_date. An invoice with a sent date before the day it was recorded counts as a taken-over old document: it is not dunned automatically and not charged automatically. Both still work by hand. § 19 notice: if the confirmed tax profile says the team is a small business in Germany (Kleinunternehmer under Section 19 UStG) and the amount still open on the invoice would, once paid, exceed this year's revenue limit (or the limit is already exceeded), the response also contains the field notices: a list with code small_business_limit, level would_exceed or already_exceeded, context invoice, year, the amounts in euros (limit_eur, known_turnover_eur, amount_eur, turnover_after_eur), complete (false if payments are unresolved), blocking (always false) and message. The notice never blocks and never changes the tax profile; without a notice the field is absent.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "description": "Target status: sent or cancelled"
                                    },
                                    "sent_date": {
                                        "type": "string",
                                        "description": "Optional: actual sent date (YYYY-MM-DD), meant only for taking over old invoices from another system. Normally leave it out, then today applies. Only together with status sent, only on the change from draft and only for manual invoices (source manual), otherwise 422. No earlier than the invoice date, no later than today. If the date is before the day the invoice was recorded here, it counts as a taken-over old document and is not dunned or charged automatically"
                                    }
                                },
                                "required": [
                                    "status"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/send": {
            "post": {
                "operationId": "invoices-send",
                "summary": "Send invoice by email",
                "description": "Sends the invoice by email to the stored recipient. A cancelled invoice is not sent again (422, error_code: not_sendable); its cancellation invoice (kind cancellation, UUID from cancelled_by_invoice) can be sent with this endpoint and keeps the status cancelled. On the first send, an invoice with status draft automatically changes to sent and gets its invoice number; if the number series collides, the endpoint responds with 409 and error_code: document_number_conflict, and the invoice stays a draft without a number. An invoice that has already been sent can be sent again; the status stays unchanged. The endpoint is limited to 10 requests per minute per API key; further requests get 429. Not sendable are cancelled invoices, invoices without a recipient email, and e-invoice formats with open validation errors. In addition, only invoices from the sources manual, hosting_checkout and hosting_renewal can be sent, because automatically billed sources already send their invoice email themselves. In all these cases the API responds with 422 and the field error_code, which can be not_sendable, no_recipient_email or einvoice_invalid. An unknown UUID results in 404. § 19 notice: if the confirmed tax profile says the team is a small business in Germany (Kleinunternehmer under Section 19 UStG) and the amount still open on the invoice would, once paid, exceed this year's revenue limit (or the limit is already exceeded), the response also contains the field notices: a list with code small_business_limit, level would_exceed or already_exceeded, context invoice, year, the amounts in euros (limit_eur, known_turnover_eur, amount_eur, turnover_after_eur), complete (false if payments are unresolved), blocking (always false) and message. The notice never blocks and never changes the tax profile; without a notice the field is absent.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/pdf": {
            "get": {
                "operationId": "invoices-pdf",
                "summary": "Download invoice as PDF",
                "description": "Downloads the invoice as a standard PDF (team setting einvoice_format=pdf). The response is a file download, not JSON. Issued invoices return the file saved at issuing byte for byte (headers X-FlowAccounting-Document-Source: frozen and X-FlowAccounting-Document-SHA256); drafts and invoices issued before freezing existed are generated with the current data (regenerated).",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/duplicate": {
            "post": {
                "operationId": "invoices-duplicate",
                "summary": "Duplicate invoice",
                "description": "Duplicates the invoice including its line items as a new draft without an invoice number; the number is assigned on issuing. Response: 201 with the new invoice.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/correct": {
            "post": {
                "operationId": "invoices-correct",
                "summary": "Correct invoice",
                "description": "Cancels the sent invoice with a separate cancellation invoice and creates a correction draft with the same content. The correction carries the original's number with a correction suffix; the original keeps its number, is set to cancelled and points to the cancellation invoice and the correction. Possible with sent, overdue, past_due and partially_paid and only for manually managed invoices; otherwise 422. Response: 201 with the corrected invoice.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "invoice_number": "RE-2026-0042-1",
                                        "status": "draft"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/dunning": {
            "post": {
                "operationId": "invoices-dunning",
                "summary": "Send dunning notice",
                "description": "Orders a payment reminder or dunning notice. level must be exactly the next level due: a skipped or repeated level is rejected with 422 and dunning_level_not_due. Which level is due depends on the dunning intervals in the team settings and the levels already sent, so on the same rules as the automatic dunning run. Without recipient_emails the customer's recipients apply.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "level": "reminder",
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "overdue"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "level": {
                                        "type": "string",
                                        "description": "Dunning level: reminder, dunning_1, dunning_2 or dunning_3"
                                    },
                                    "recipient_emails": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Different recipient addresses, at most 50"
                                    }
                                },
                                "required": [
                                    "level"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/mark-paid": {
            "post": {
                "operationId": "invoices-mark-paid",
                "summary": "Mark invoice as paid",
                "description": "Marks the invoice as fully paid using a Stripe PaymentIntent ID. Idempotent: a repeated request with the same PaymentIntent ID returns the current state (200). Allowed starting statuses: sent, requires_action, past_due.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "stripe_payment_intent_id": {
                                        "type": "string",
                                        "description": "Stripe PaymentIntent ID (pi_3Q...)"
                                    },
                                    "date_paid": {
                                        "type": "string",
                                        "description": "Payment date (YYYY-MM-DD), today at the latest (calendar day in Germany)"
                                    }
                                },
                                "required": [
                                    "stripe_payment_intent_id"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/record-payment-intent": {
            "post": {
                "operationId": "invoices-record-payment-intent",
                "summary": "Store PaymentIntent",
                "description": "Stores a Stripe PaymentIntent ID on the invoice without setting the payment status to paid. For payments awaiting 3DS or past due.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "stripe_payment_intent_id": {
                                        "type": "string",
                                        "description": "Stripe PaymentIntent ID"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "Optional: past_due | requires_action"
                                    }
                                },
                                "required": [
                                    "stripe_payment_intent_id"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/charge": {
            "post": {
                "operationId": "invoices-charge",
                "summary": "Charge invoice via Stripe",
                "description": "Starts the charge of the invoice through the stored Stripe payment method (card or SEPA direct debit). Requirement: the invoice has a customer and a Stripe-backed payment method, otherwise the endpoint responds with 422 and an error_code (no_client, wrong_payment_method). A draft is issued before the charge (invoice number, status sent, no email), because a payment never runs against an invoice without a number; if the number series collides, the endpoint responds with 409 and error_code: document_number_conflict, and the draft stays unchanged. A declined payment is not a request error: the response is 200 with charged: false. A repeated call never charges twice. If Stripe is temporarily unreachable, the endpoint responds with 503. The call is rate-limited per API key.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/payment-status": {
            "get": {
                "operationId": "invoices-payment-status",
                "summary": "Query payment status",
                "description": "Lightweight status query for polling after a charge, without line items and transactions. Returns uuid, status, payment_intent_status, last_charge_error and stripe_charge_id. SEPA direct debits are only finally confirmed after some days; the status then changes without any further call.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/issue-check": {
            "get": {
                "operationId": "invoices-issue-check",
                "summary": "Checklist before issuing",
                "description": "Checks an invoice before issuing for the mandatory details under Sections 14 and 14a of the German VAT Act (UStG): addresses of issuer and customer, tax number or VAT ID, line items, service date, reverse charge, Section 19 UStG, deadlines. Returns the findings. Read-only. findings is a list with code (e.g. seller.address, buyer.vat_id, tax.small_business_limit), severity (error, warning or info), message in the language of the key owner, legal_basis and target (where the finding is fixed: invoice, recipient, company, tax_profile). blocks_manual_issue says whether the web interface refuses issuing because of errors, requires_confirmation whether notes have to be confirmed there. Issuing through the API (POST /invoices/{uuid}/status, POST /invoices/{uuid}/send) is never blocked (blocks_api_issue is always false); the findings are saved with the invoice on issuing and are then available in issued_snapshot. Without a confirmed tax profile, the findings that depend on the VAT status (e.g. tax number, service date, reverse charge, deadlines) are only info. The mandatory details of every invoice still remain errors and block issuing in the web interface: address of the issuer, name and address of the customer, invoice date and line items with a quantity; the same goes for the e-invoice validation. The Section 19 warning (tax.small_business_limit) stays a warning; tax_profile names the state used (confirmed, vat_regime, governs). Teams that are not registered for VAT in Germany according to their tax profile get no German VAT findings. An unknown UUID results in 404.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "draft",
                                        "is_draft": true,
                                        "blocks_api_issue": false,
                                        "checked_at": "2026-11-23T10:00:00+01:00",
                                        "blocks_manual_issue": true,
                                        "requires_confirmation": true,
                                        "summary": {
                                            "errors": 1,
                                            "warnings": 1,
                                            "infos": 0
                                        },
                                        "tax_profile": {
                                            "version_uuid": "0f6d…",
                                            "confirmed": true,
                                            "vat_regime": "standard",
                                            "governs": true
                                        },
                                        "findings": [
                                            {
                                                "code": "seller.tax_id",
                                                "severity": "error",
                                                "message": "Deine Steuernummer oder USt-IdNr. fehlt. Eine davon muss auf jeder Rechnung stehen.",
                                                "legal_basis": "§ 14 Abs. 4 Nr. 2 UStG",
                                                "target": "company"
                                            },
                                            {
                                                "code": "service_date.missing",
                                                "severity": "warning",
                                                "message": "Es ist kein Leistungsdatum angegeben. Trage den Leistungszeitraum ein, oder bestätige, dass die Leistung am Rechnungsdatum erbracht wurde.",
                                                "legal_basis": "§ 14 Abs. 4 Nr. 6 UStG",
                                                "target": "invoice"
                                            }
                                        ],
                                        "issued_snapshot": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/einvoice": {
            "get": {
                "operationId": "invoices-einvoice",
                "summary": "Download archived e-invoice",
                "description": "Returns the e-invoice archived on issuing byte for byte: for XRechnung the XML file (application/xml), for ZUGFeRD the PDF/A-3 with embedded XML (application/pdf). The response is a file download, not JSON; it is never regenerated. Headers: X-FlowAccounting-Einvoice-SHA256 (SHA-256 of the returned file), X-FlowAccounting-Einvoice-XML-SHA256 (SHA-256 of the invoice XML, for ZUGFeRD the embedded one), X-FlowAccounting-Einvoice-Uuid (archive entry). Without an archived e-invoice (draft, classic PDF, issued before archiving existed) the endpoint responds with 404 and error: einvoice_not_archived; if the file fails the hash check, with 409 and error: einvoice_integrity_failed. An unknown UUID or an invoice of another team results in 404.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/einvoice/validation": {
            "get": {
                "operationId": "invoices-einvoice-validation",
                "summary": "Validation report of the archived e-invoice",
                "description": "Returns the latest validation report of the invoice's archived e-invoice. Read-only. The validation ran on exactly the issued bytes when archiving (well-formedness, XSD, business rules according to EN 16931 and XRechnung, mandatory details under Section 14 (4) UStG). validation_status is valid, valid_with_warnings, business_rule_errors, mandatory_field_errors or format_error. report.messages is a list with code (e.g. BR-DE-2, FAC-PFLICHT-6), severity (error or warning), category (format, business_rule, mandatory_vat) and message. Without an archived e-invoice 404 with error: einvoice_not_archived; an unknown UUID or an invoice of another team results in 404.",
                "tags": [
                    "invoices"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "8d1f2c4e-6a0b-4c1d-9e2f-3a4b5c6d7e8f",
                                        "document_uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "format": "xrechnung",
                                        "profile": "xrechnung_3",
                                        "specification_id": "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0",
                                        "type_code": "380",
                                        "invoice_number": "RE-00042",
                                        "xml_sha256": "3f5a…",
                                        "file_sha256": "3f5a…",
                                        "archived_at": "2026-11-24T10:00:00+01:00",
                                        "validation_status": "valid_with_warnings",
                                        "report": {
                                            "uuid": "0c9e…",
                                            "engine": "internal",
                                            "engine_version": "internal-1.0",
                                            "status": "valid_with_warnings",
                                            "errors_count": 0,
                                            "warnings_count": 1,
                                            "messages": [
                                                {
                                                    "code": "FAC-FX-2",
                                                    "severity": "warning",
                                                    "category": "mandatory_vat",
                                                    "message": "Die Umsatzsteuer in Euro (BT-111) beruht auf einem vorläufigen Kurs, der BMF-Monatskurs ist noch nicht veröffentlicht."
                                                }
                                            ],
                                            "created_at": "2026-11-24T10:00:00+01:00"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/items": {
            "get": {
                "operationId": "items-list",
                "summary": "List line items",
                "description": "List all line items of an invoice.",
                "tags": [
                    "items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "items-create",
                "summary": "Add line item",
                "description": "Adds a line item to the invoice. Breaking change: the former numeric field product_id is no longer accepted; the product is given only with product_uuid.",
                "tags": [
                    "items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "quantity": {
                                        "type": "number",
                                        "description": "Quantity (min 0.01)"
                                    },
                                    "unit_price": {
                                        "type": "number",
                                        "description": "Unit price (negative allowed for credit notes)"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Line item name (max 255)"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Description (max 1000)"
                                    },
                                    "tax_rate": {
                                        "type": "number",
                                        "description": "Tax rate in percent (0-100). Without a value 0 %"
                                    },
                                    "unit": {
                                        "type": "string",
                                        "description": "Unit (e.g. hrs)"
                                    },
                                    "product_uuid": {
                                        "type": "string",
                                        "description": "Product UUID (fac_products, team-bound)"
                                    }
                                },
                                "required": [
                                    "quantity",
                                    "unit_price"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/items/{itemUuid}": {
            "put": {
                "operationId": "items-update",
                "summary": "Edit line item",
                "description": "Edit a line item. The line item is addressed by its UUID; numeric IDs are no longer accepted (HTTP 404). Only with draft.",
                "tags": [
                    "items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "itemUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "quantity": {
                                        "type": "number",
                                        "description": "Quantity"
                                    },
                                    "unit_price": {
                                        "type": "number",
                                        "description": "Unit price"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Line item name"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "items-delete",
                "summary": "Delete line item",
                "description": "Delete a line item. The line item is addressed by its UUID. Only with draft.",
                "tags": [
                    "items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "itemUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/transactions": {
            "get": {
                "operationId": "transactions-list",
                "summary": "List transactions of an invoice",
                "description": "List all transactions of an invoice (sorted by date, newest first).",
                "tags": [
                    "transactions"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "transactions-create",
                "summary": "Record transaction",
                "description": "Records a transaction. Only allowed if the invoice has the status sent, partially_paid or overdue. The transaction is booked in the invoice currency. If it settles the invoice, the invoice takes the transaction_date of this payment as its paid_date, also for payments recorded later. § 19 notice: only payments of type payment trigger it. If the confirmed tax profile says the team is a small business in Germany (Kleinunternehmer under Section 19 UStG) and this payment would exceed the revenue limit of its calendar year (or the limit is already exceeded), the response also contains the field notices: a list with code small_business_limit, level would_exceed or already_exceeded, context payment, year, the amounts in euros (limit_eur, known_turnover_eur, amount_eur, turnover_after_eur), complete (false if payments are unresolved), blocking (always false) and message. The notice never blocks and never changes the tax profile; without a notice the field is absent.",
                "tags": [
                    "transactions"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
                                        "amount": 1190,
                                        "currency_code": "EUR",
                                        "type": "payment",
                                        "transaction_date": "2026-01-16T00:00:00+00:00"
                                    },
                                    "invoice": {
                                        "uuid": "550e8400-...",
                                        "status": "paid",
                                        "paid_date": "2026-01-16",
                                        "total_paid": 1190,
                                        "remaining_amount": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "description": "Transaction type: payment | refund | credit"
                                    },
                                    "amount": {
                                        "type": "number",
                                        "description": "Amount (min 0.01)"
                                    },
                                    "transaction_date": {
                                        "type": "string",
                                        "description": "Transaction date (YYYY-MM-DD), today at the latest (calendar day in Germany)"
                                    },
                                    "payment_method": {
                                        "type": "string",
                                        "description": "Payment method: bank_transfer | sepa | stripe | paypal | cash | other"
                                    },
                                    "reference": {
                                        "type": "string",
                                        "description": "Reference (max 255)"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Note (max 1000)"
                                    }
                                },
                                "required": [
                                    "type",
                                    "amount",
                                    "transaction_date",
                                    "payment_method"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/invoices/{uuid}/transactions/{transactionUuid}": {
            "delete": {
                "operationId": "transactions-delete",
                "summary": "Delete transaction",
                "description": "Delete a transaction. The transaction is addressed by its UUID; numeric IDs are no longer accepted (HTTP 404). Not possible for invoices with status draft or cancelled.",
                "tags": [
                    "transactions"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "transactionUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/transactions": {
            "get": {
                "operationId": "transactions-all",
                "summary": "Team-wide transaction overview",
                "description": "Team-wide transaction overview across all invoices (paginated, 25 per page).",
                "tags": [
                    "transactions"
                ],
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Transaction date from (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Transaction date to (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search term (note, reference, invoice number)",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/products": {
            "get": {
                "operationId": "products-list",
                "summary": "List products",
                "description": "List products (paginated, sorted by frequency of use).",
                "tags": [
                    "products"
                ],
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "Filter by source (e.g. manual)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search term (title/description)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1-200, default: 50)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "products-create",
                "summary": "Create product",
                "description": "Create a new product.",
                "tags": [
                    "products"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Product name (max 255)"
                                    },
                                    "unit_price": {
                                        "type": "number",
                                        "description": "Net unit price (min 0). Required if <code>unit_price_gross</code> is missing; not together with <code>unit_price_gross</code>"
                                    },
                                    "unit_price_gross": {
                                        "type": "number",
                                        "description": "Gross unit price incl. VAT (min 0), as an alternative to <code>unit_price</code>. Stored exactly; the net price is derived from it"
                                    },
                                    "tax_rate": {
                                        "type": "number",
                                        "description": "Tax rate (0-100)"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Description"
                                    },
                                    "unit": {
                                        "type": "string",
                                        "description": "Unit (max 50)"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active (default: true)"
                                    }
                                },
                                "required": [
                                    "title",
                                    "unit_price",
                                    "tax_rate"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/products/{uuid}": {
            "get": {
                "operationId": "products-show",
                "summary": "Get product",
                "description": "Retrieves a single product of your team by its uuid. Unknown entries or entries of another team result in 404.",
                "tags": [
                    "products"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "products-update",
                "summary": "Update product",
                "description": "Update a product.",
                "tags": [
                    "products"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Product name"
                                    },
                                    "unit_price": {
                                        "type": "number",
                                        "description": "Net unit price, makes the product a net product"
                                    },
                                    "unit_price_gross": {
                                        "type": "number",
                                        "description": "Gross unit price incl. VAT, stored exactly; not together with <code>unit_price</code>"
                                    },
                                    "tax_rate": {
                                        "type": "number",
                                        "description": "Tax rate"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "products-delete",
                "summary": "Delete product",
                "description": "Delete a product.",
                "tags": [
                    "products"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/tax-rates": {
            "get": {
                "operationId": "tax-rates-list",
                "summary": "List tax rates",
                "description": "Get all tax rates of the team (not paginated, sorted by sort_order).",
                "tags": [
                    "tax-rates"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "tax-rates-create",
                "summary": "Create tax rate",
                "description": "Create a new tax rate.",
                "tags": [
                    "tax-rates"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name (max 255)"
                                    },
                                    "rate": {
                                        "type": "number",
                                        "description": "Tax rate in percent (0-100)"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Description"
                                    },
                                    "is_default": {
                                        "type": "boolean",
                                        "description": "Set as default"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active"
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Sort order (>= 0)"
                                    }
                                },
                                "required": [
                                    "name",
                                    "rate"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/tax-rates/{uuid}": {
            "get": {
                "operationId": "tax-rates-show",
                "summary": "Get tax rate",
                "description": "Retrieves a single tax rate of your team by its uuid. Unknown entries or entries of another team result in 404.",
                "tags": [
                    "tax-rates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "tax-rates-update",
                "summary": "Update tax rate",
                "description": "Update a tax rate.",
                "tags": [
                    "tax-rates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name"
                                    },
                                    "rate": {
                                        "type": "number",
                                        "description": "Tax rate"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "tax-rates-delete",
                "summary": "Delete tax rate",
                "description": "Delete a tax rate. Not possible if it is used in invoice line items (422).",
                "tags": [
                    "tax-rates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/tax-rates/{uuid}/default": {
            "post": {
                "operationId": "tax-rates-default",
                "summary": "Set as default",
                "description": "Sets this tax rate as the team default (all others lose the default flag).",
                "tags": [
                    "tax-rates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/recurring-invoices": {
            "get": {
                "operationId": "recurring-list",
                "summary": "List",
                "description": "List recurring invoices (paginated, 25 per page).",
                "tags": [
                    "recurring"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter: active, paused",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter by customer UUID. Breaking change: the former filter client_id is rejected with 422 instead of being silently ignored",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "recurring-create",
                "summary": "Create recurring invoice",
                "description": "Create a new recurring invoice. Breaking change: the former numeric field client_id is no longer accepted; the customer is given only with client_uuid.",
                "tags": [
                    "recurring"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption if the customer has the tax treatment tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters). Taken over into the generated invoices and printed in the note"
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "Customer UUID (cmm_clients, team-bound)"
                                    },
                                    "interval_value": {
                                        "type": "integer",
                                        "description": "Interval value (>= 1)"
                                    },
                                    "interval_unit": {
                                        "type": "string",
                                        "description": "Interval unit: day | week | month | year"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "description": "Start date (YYYY-MM-DD)"
                                    },
                                    "template_items": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Line items of the template (min 1)"
                                    },
                                    "auto_send": {
                                        "type": "boolean",
                                        "description": "Send automatically"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "description": "End date (>= start_date)"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "Status: active | paused"
                                    }
                                },
                                "required": [
                                    "client_uuid",
                                    "interval_value",
                                    "interval_unit",
                                    "start_date",
                                    "template_items"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/recurring-invoices/{uuid}": {
            "get": {
                "operationId": "recurring-show",
                "summary": "Get recurring invoice",
                "description": "Retrieves a single recurring invoice of your team by its uuid. Unknown entries or entries of another team result in 404.",
                "tags": [
                    "recurring"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "recurring-update",
                "summary": "Update",
                "description": "Update a recurring invoice.",
                "tags": [
                    "recurring"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption if the customer has the tax treatment tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters). Taken over into the generated invoices and printed in the note"
                                    },
                                    "interval_value": {
                                        "type": "integer",
                                        "description": "Interval value"
                                    },
                                    "interval_unit": {
                                        "type": "string",
                                        "description": "Interval unit"
                                    },
                                    "auto_send": {
                                        "type": "boolean",
                                        "description": "Send automatically"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "recurring-delete",
                "summary": "Delete",
                "description": "Delete a recurring invoice.",
                "tags": [
                    "recurring"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/recurring-invoices/{uuid}/pause": {
            "post": {
                "operationId": "recurring-pause",
                "summary": "Pause",
                "description": "Pauses the template (status paused): no new invoices are generated.",
                "tags": [
                    "recurring"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/recurring-invoices/{uuid}/activate": {
            "post": {
                "operationId": "recurring-activate",
                "summary": "Activate",
                "description": "Activates the template again (status active) and sets what the automatic run may do. auto_send, auto_charge and recipient_emails are the actual approval: without them only drafts are created. auto_send is on by default, auto_charge is off by default and requires a Stripe or SEPA payment method on the series (otherwise 422). Without recipient_emails the customer's recipients apply; if no address is stored there and the invoices should be sent, the API responds with 422.",
                "tags": [
                    "recurring"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "auto_send": {
                                        "type": "boolean",
                                        "description": "Send generated invoices automatically (default: true)"
                                    },
                                    "auto_charge": {
                                        "type": "boolean",
                                        "description": "Charge generated invoices automatically (default: false, requires payment method stripe or sepa)"
                                    },
                                    "recipient_emails": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Recipient addresses for automatic sending, at most 50"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/recurring-invoices/{uuid}/generate": {
            "post": {
                "operationId": "recurring-generate",
                "summary": "Generate next invoice",
                "description": "Generates the due invoice of the series right away, without waiting for the nightly run. If no invoice is due right now or the series' approval is no longer valid, the API responds with 422 and nothing_to_generate.",
                "tags": [
                    "recurring"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "invoice_number": "RE-2026-0042",
                                        "status": "sent"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/installment-plans": {
            "get": {
                "operationId": "installment-plans-list",
                "summary": "List",
                "description": "Installment plans of the team (paginated, 25 per page) with amounts, converted invoices and schedule.",
                "tags": [
                    "installment-plans"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter: active, paused, completed, cancelled",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter by customer UUID",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "installment-plans-create",
                "summary": "Convert invoices into an installment plan",
                "description": "Converts open, sent invoices (source manual or quote_accepted) of one customer into an installment plan. Unpaid invoices are cancelled, partly paid ones are settled for the open rest with a credit note. The open amount is then issued on each date as a numbered part invoice. Refused conversions respond with 422 and error=installment_plan_refused.",
                "tags": [
                    "installment-plans"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "invoice_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs of the invoices (team-bound, same customer and same currency)"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "description": "First installment on (YYYY-MM-DD)"
                                    },
                                    "schedule_mode": {
                                        "type": "string",
                                        "description": "Split: amount (fixed installment amount, smaller final installment) | count (number of equal installments) | end_date (until an end date)"
                                    },
                                    "installment_amount": {
                                        "type": "number",
                                        "description": "Amount per installment, required with schedule_mode=amount"
                                    },
                                    "installment_count": {
                                        "type": "integer",
                                        "description": "Number of installments (1 to 240), required with schedule_mode=count"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "description": "Last installment by (YYYY-MM-DD), required with schedule_mode=end_date"
                                    },
                                    "interval_unit": {
                                        "type": "string",
                                        "description": "month (default) | week"
                                    },
                                    "interval_value": {
                                        "type": "integer",
                                        "description": "Interval (1 to 12), e.g. 3 with month = quarterly"
                                    },
                                    "payment_method": {
                                        "type": "string",
                                        "description": "bank_transfer | stripe | sepa | paypal | cash | other (default: payment method of the invoice)"
                                    },
                                    "auto_charge": {
                                        "type": "boolean",
                                        "description": "Charge part invoices automatically on the day they are created (stripe/sepa only)"
                                    },
                                    "auto_send": {
                                        "type": "boolean",
                                        "description": "Number part invoices and send them automatically (default true; false = draft)"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Note on every part invoice and on the installment agreement"
                                    }
                                },
                                "required": [
                                    "invoice_uuids",
                                    "start_date",
                                    "schedule_mode"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/installment-plans/{uuid}": {
            "get": {
                "operationId": "installment-plans-show",
                "summary": "Get installment plan",
                "description": "An installment plan with all installments and part invoices. public_url is the link to the public customer page (null as long as no link has been created or the link is revoked). Installments with kind=extra are extra payments the customer made there. Unknown entries or entries of another team result in 404.",
                "tags": [
                    "installment-plans"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/installment-plans/{uuid}/invoices": {
            "post": {
                "operationId": "installment-plans-add-invoice",
                "summary": "Add invoice",
                "description": "Adds another open invoice of the same customer. keep_rate extends the plan with the same installment, new_rate spreads the whole rest again with the given plan values, separate creates a second installment plan and returns it.",
                "tags": [
                    "installment-plans"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "invoice_uuid": {
                                        "type": "string",
                                        "description": "UUID of the invoice (team-bound)"
                                    },
                                    "add_mode": {
                                        "type": "string",
                                        "description": "keep_rate | new_rate | separate"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "description": "First installment, required with add_mode=separate"
                                    },
                                    "schedule_mode": {
                                        "type": "string",
                                        "description": "Split: amount (fixed installment amount, smaller final installment) | count (number of equal installments) | end_date (until an end date)"
                                    },
                                    "installment_amount": {
                                        "type": "number",
                                        "description": "Amount per installment, required with schedule_mode=amount"
                                    },
                                    "installment_count": {
                                        "type": "integer",
                                        "description": "Number of installments (1 to 240), required with schedule_mode=count"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "description": "Last installment by (YYYY-MM-DD), required with schedule_mode=end_date"
                                    },
                                    "interval_unit": {
                                        "type": "string",
                                        "description": "month (default) | week"
                                    },
                                    "interval_value": {
                                        "type": "integer",
                                        "description": "Interval (1 to 12), e.g. 3 with month = quarterly"
                                    },
                                    "payment_method": {
                                        "type": "string",
                                        "description": "bank_transfer | stripe | sepa | paypal | cash | other (default: payment method of the invoice)"
                                    },
                                    "auto_charge": {
                                        "type": "boolean",
                                        "description": "Charge part invoices automatically on the day they are created (stripe/sepa only)"
                                    },
                                    "auto_send": {
                                        "type": "boolean",
                                        "description": "Number part invoices and send them automatically (default true; false = draft)"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Note on every part invoice and on the installment agreement"
                                    }
                                },
                                "required": [
                                    "invoice_uuid",
                                    "add_mode"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/installment-plans/{uuid}/reschedule": {
            "post": {
                "operationId": "installment-plans-reschedule",
                "summary": "Recalculate installments",
                "description": "Spreads the rest not yet billed again. Part invoices already issued stay unchanged.",
                "tags": [
                    "installment-plans"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "schedule_mode": {
                                        "type": "string",
                                        "description": "Split: amount (fixed installment amount, smaller final installment) | count (number of equal installments) | end_date (until an end date)"
                                    },
                                    "installment_amount": {
                                        "type": "number",
                                        "description": "Amount per installment, required with schedule_mode=amount"
                                    },
                                    "installment_count": {
                                        "type": "integer",
                                        "description": "Number of installments (1 to 240), required with schedule_mode=count"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "description": "Last installment by (YYYY-MM-DD), required with schedule_mode=end_date"
                                    },
                                    "interval_unit": {
                                        "type": "string",
                                        "description": "month (default) | week"
                                    },
                                    "interval_value": {
                                        "type": "integer",
                                        "description": "Interval (1 to 12), e.g. 3 with month = quarterly"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "description": "Next installment on (default: next open date)"
                                    }
                                },
                                "required": [
                                    "schedule_mode"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/installment-plans/{uuid}/installments": {
            "put": {
                "operationId": "installment-plans-installments",
                "summary": "Set installments individually",
                "description": "Replaces all installments that are still open. The total must match the rest not yet billed exactly, otherwise 422.",
                "tags": [
                    "installment-plans"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "installments": {
                                        "type": "array",
                                        "items": [],
                                        "description": "List of objects with date (YYYY-MM-DD, from today) and amount (from 0.01)"
                                    }
                                },
                                "required": [
                                    "installments"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/installment-plans/{uuid}/pause": {
            "post": {
                "operationId": "installment-plans-pause",
                "summary": "Pause",
                "description": "Pauses an active installment plan. No part invoices are created until it is resumed.",
                "tags": [
                    "installment-plans"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/installment-plans/{uuid}/resume": {
            "post": {
                "operationId": "installment-plans-resume",
                "summary": "Resume",
                "description": "Resumes a paused installment plan. The open installments keep their amounts and start on the new date.",
                "tags": [
                    "installment-plans"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "next_date": {
                                        "type": "string",
                                        "description": "Next installment on (YYYY-MM-DD, from today)"
                                    }
                                },
                                "required": [
                                    "next_date"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/installment-plans/{uuid}/cancel": {
            "post": {
                "operationId": "installment-plans-cancel",
                "summary": "End",
                "description": "Ends the installment plan early. bill_rest issues the rest right away as the last part invoice, waive waives it without any further invoice.",
                "tags": [
                    "installment-plans"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "mode": {
                                        "type": "string",
                                        "description": "bill_rest | waive"
                                    }
                                },
                                "required": [
                                    "mode"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/billable-items": {
            "get": {
                "operationId": "billable-items-list",
                "summary": "List",
                "description": "List billable items (paginated, 25 per page).",
                "tags": [
                    "billable-items"
                ],
                "parameters": [
                    {
                        "name": "open",
                        "in": "query",
                        "required": false,
                        "description": "true = open items only, false = billed items only",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "client_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter by customer UUID. Breaking change: the former filter client_id is rejected with 422 instead of being silently ignored",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "billable-items-create",
                "summary": "Create item",
                "description": "Create a new billable item. Breaking change: the former numeric field client_id is no longer accepted; the customer is given only with client_uuid.",
                "tags": [
                    "billable-items"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption if the customer has the tax treatment tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters). Taken over into the generated invoices and printed in the note"
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "Customer UUID (cmm_clients, team-bound)"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Description (max 255)"
                                    },
                                    "unit_price": {
                                        "type": "number",
                                        "description": "Unit price"
                                    },
                                    "quantity": {
                                        "type": "number",
                                        "description": "Quantity (min 0.01)"
                                    },
                                    "unit": {
                                        "type": "string",
                                        "description": "Unit (max 50)"
                                    },
                                    "tax_rate": {
                                        "type": "number",
                                        "description": "Tax rate"
                                    },
                                    "due_date": {
                                        "type": "string",
                                        "description": "Due date"
                                    },
                                    "auto_bill": {
                                        "type": "boolean",
                                        "description": "Bill automatically"
                                    }
                                },
                                "required": [
                                    "client_uuid",
                                    "description",
                                    "unit_price"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/billable-items/{uuid}": {
            "get": {
                "operationId": "billable-items-show",
                "summary": "Get billable item",
                "description": "Retrieves a single billable item of your team by its uuid. Unknown entries or entries of another team result in 404.",
                "tags": [
                    "billable-items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "billable-items-update",
                "summary": "Edit item",
                "description": "Edit. Only possible as long as the item has not been billed (422).",
                "tags": [
                    "billable-items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption if the customer has the tax treatment tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters). Taken over into the generated invoices and printed in the note"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Description"
                                    },
                                    "unit_price": {
                                        "type": "number",
                                        "description": "Unit price"
                                    },
                                    "quantity": {
                                        "type": "number",
                                        "description": "Quantity"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "billable-items-delete",
                "summary": "Delete item",
                "description": "Delete. Only possible as long as it has not been billed (422).",
                "tags": [
                    "billable-items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/billable-items/consolidate": {
            "post": {
                "operationId": "billable-items-consolidate",
                "summary": "Consolidate items",
                "description": "Combines several open items into invoices: one draft invoice is created per customer. Response: 201 with the invoices created.",
                "tags": [
                    "billable-items"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs of the items to consolidate (min 1, unique)"
                                    }
                                },
                                "required": [
                                    "uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/billable-items/{uuid}/generate": {
            "post": {
                "operationId": "billable-items-generate",
                "summary": "Bill a single item",
                "description": "Bills exactly this item right away and returns the draft invoice. The due date is deliberately skipped, and nothing is sent. An item that has already been billed returns its existing invoice with 200 instead of a second one.",
                "tags": [
                    "billable-items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "draft"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/quotes": {
            "get": {
                "operationId": "quotes-list",
                "summary": "List quotes",
                "description": "Retrieves a paginated list of all quotes of the team, sorted by quote date, newest first.",
                "tags": [
                    "quotes"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter: draft, sent, accepted, declined, expired, withdrawn",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter by customer UUID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search term (quote number, recipient name, company)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Quote date from (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Quote date to (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1-200, default: 25)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                            "quote_number": "AN-2026-0007",
                                            "status": "sent",
                                            "total": 1190,
                                            "available_actions": [
                                                "send",
                                                "withdraw"
                                            ]
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 25,
                                        "total": 7
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "quotes-create",
                "summary": "Create quote",
                "description": "Creates a quote with status draft. The quote number is assigned automatically from the team's number series; for taking over existing quotes from another system it can be set with quote_number. Fields not given are filled in from the team settings and the customer data, such as currency, language, validity, greeting and closing text. The complete list of writable fields comes from GET /flowaccounting/context. The quote takes over the tax treatment from the customer in FlowCRM and returns it as tax_treatment (standard, reverse_charge, reverse_charge_domestic, intra_community_supply, export, non_taxable_abroad or tax_exempt). With every value except standard the quote shows no VAT: a given tax_rate is set to 0. The invoice created from an accepted quote takes over its tax treatment.",
                "tags": [
                    "quotes"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "quote_number": "AN-2026-0007",
                                        "status": "draft"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "Customer UUID (team-bound)"
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "Contact UUID of the customer"
                                    },
                                    "quote_number": {
                                        "type": "string",
                                        "description": "Optional: your own quote number, meant only for taking over existing quotes from another system. Normally leave it out so the number series assigns the number on creation. AI assistants and agents only set the field if the user explicitly insists on their own number. At most 40 characters from the letters A to Z, digits, space, dot, underscore and hyphen, starting and ending with a letter or digit. Must be unique within the team, also against deleted drafts and withdrawn quotes. If the number lies within the current number series, it must be below the next counter value; to do this, first set the next quote number in the FlowAccounting settings above the highest import number. The counter stays unchanged. After creation the number can no longer be changed"
                                    },
                                    "quote_date": {
                                        "type": "string",
                                        "description": "Quote date (YYYY-MM-DD, default: today)"
                                    },
                                    "valid_until": {
                                        "type": "string",
                                        "description": "Valid until (YYYY-MM-DD, default: the team's validity period)"
                                    },
                                    "signature_type": {
                                        "type": "string",
                                        "description": "Acceptance type: button or canvas"
                                    },
                                    "currency_code": {
                                        "type": "string",
                                        "description": "EUR, USD, CHF or GBP"
                                    },
                                    "document_language": {
                                        "type": "string",
                                        "description": "de, en or pt"
                                    },
                                    "discount_percent": {
                                        "type": "number",
                                        "description": "Overall discount in percent"
                                    },
                                    "greeting_text": {
                                        "type": "string",
                                        "description": "Cover text above the line items"
                                    },
                                    "closing_text": {
                                        "type": "string",
                                        "description": "Closing text below the line items"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Visible note on the quote"
                                    },
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption with the tax treatment tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters), printed in the note on the document"
                                    },
                                    "internal_notes": {
                                        "type": "string",
                                        "description": "Internal note, not on the document"
                                    },
                                    "items": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Line items, 1 to 200. For each line item <code>name</code>, <code>quantity</code>, <code>unit_price</code> and <code>tax_rate</code>; optional <code>description</code>, <code>unit</code>, <code>discount_percent</code>, <code>type</code>, <code>unit_code</code>, <code>product_uuid</code> and <code>project_uuid</code>"
                                    },
                                    "recipient_name": {
                                        "type": "string",
                                        "description": "Different recipient name"
                                    },
                                    "recipient_company": {
                                        "type": "string",
                                        "description": "Different recipient company"
                                    },
                                    "recipient_email": {
                                        "type": "string",
                                        "description": "Different recipient address"
                                    }
                                },
                                "required": [
                                    "client_uuid",
                                    "items"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/quotes/{uuid}": {
            "get": {
                "operationId": "quotes-show",
                "summary": "Get quote details",
                "description": "Quote details including line items, totals, available_actions and allowed_transitions.",
                "tags": [
                    "quotes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "quotes-update",
                "summary": "Update quote",
                "description": "Changes a quote with status draft; otherwise 422. Only the fields sent are changed, all others stay as they are. If items is passed, the list replaces all line items. The quote number can't be changed: quote_number is rejected here with 422.",
                "tags": [
                    "quotes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "valid_until": {
                                        "type": "string",
                                        "description": "Valid until (YYYY-MM-DD)"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Visible note on the quote"
                                    },
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption with the tax treatment tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters), printed in the note on the document"
                                    },
                                    "items": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Replaces all line items"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "quotes-delete",
                "summary": "Delete quote",
                "description": "Deletes a quote with status draft; otherwise 422.",
                "tags": [
                    "quotes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/quotes/{uuid}/send": {
            "post": {
                "operationId": "quotes-send",
                "summary": "Send quote by email",
                "description": "Sends the quote and sets it to sent. Requires an Idempotency-Key header in UUID format; the same key never sends twice. Without recipient_emails the customer's recipients apply. If the sender domain is not verified, the API responds with 409 and sender_domain_not_verified.",
                "tags": [
                    "quotes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "sent": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "sent"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "recipient_emails": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Different recipient addresses, at most 50"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/quotes/{uuid}/withdraw": {
            "post": {
                "operationId": "quotes-withdraw",
                "summary": "Withdraw quote",
                "description": "Withdraws a sent quote. Only possible from status sent; otherwise 422.",
                "tags": [
                    "quotes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/quotes/{uuid}/accept": {
            "post": {
                "operationId": "quotes-accept",
                "summary": "Record acceptance",
                "description": "Records that the customer accepted the quote, for example by phone or email. Only possible from status sent and only once; otherwise 422. This endpoint is not meant for acceptance through the customer's quote link, where the signature is recorded as well.",
                "tags": [
                    "quotes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "accepted"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/quotes/{uuid}/convert": {
            "post": {
                "operationId": "quotes-convert",
                "summary": "Convert to invoice",
                "description": "Creates a draft invoice from an accepted quote. Only possible with status accepted; otherwise 422 with quote_not_accepted. A second call returns the invoice already created with 200 instead of another one.",
                "tags": [
                    "quotes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "draft"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/quotes/{uuid}/pdf": {
            "get": {
                "operationId": "quotes-pdf",
                "summary": "Download quote PDF",
                "description": "Returns the quote as a PDF file (application/pdf), in the team's document layout and in the language recorded on the document.",
                "tags": [
                    "quotes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/quotes/{uuid}/items": {
            "get": {
                "operationId": "quote-items-list",
                "summary": "List line items",
                "description": "Lists the line items of a quote, sorted by their order.",
                "tags": [
                    "quote-items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1-200, default: 50)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "quote-items-create",
                "summary": "Add line item",
                "description": "Adds a line item to the quote. Without position it is appended at the end. A project_uuid must belong to a project of the quote's customer; otherwise 422.",
                "tags": [
                    "quote-items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the line item"
                                    },
                                    "quantity": {
                                        "type": "number",
                                        "description": "Quantity"
                                    },
                                    "unit_price": {
                                        "type": "number",
                                        "description": "Net unit price"
                                    },
                                    "tax_rate": {
                                        "type": "number",
                                        "description": "Tax rate in percent"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Description text"
                                    },
                                    "unit": {
                                        "type": "string",
                                        "description": "Unit, such as hour or piece"
                                    },
                                    "discount_percent": {
                                        "type": "number",
                                        "description": "Line item discount in percent"
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "service, product or hours"
                                    },
                                    "position": {
                                        "type": "integer",
                                        "description": "Order"
                                    },
                                    "product_uuid": {
                                        "type": "string",
                                        "description": "Product UUID from the product catalogue"
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "Project UUID of the quote's customer"
                                    }
                                },
                                "required": [
                                    "name",
                                    "quantity",
                                    "unit_price",
                                    "tax_rate"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/quotes/{uuid}/items/{itemUuid}": {
            "put": {
                "operationId": "quote-items-update",
                "summary": "Update line item",
                "description": "Changes a single line item. Only the fields sent are changed.",
                "tags": [
                    "quote-items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "itemUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "quantity": {
                                        "type": "number",
                                        "description": "Quantity"
                                    },
                                    "unit_price": {
                                        "type": "number",
                                        "description": "Net unit price"
                                    },
                                    "tax_rate": {
                                        "type": "number",
                                        "description": "Tax rate in percent"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "quote-items-delete",
                "summary": "Delete line item",
                "description": "Removes a line item from the quote and recalculates the totals.",
                "tags": [
                    "quote-items"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "itemUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/credit-notes": {
            "get": {
                "operationId": "credit-notes-list",
                "summary": "List credit notes",
                "description": "Retrieves a paginated list of all credit notes of the team, sorted by credit note date, newest first.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter: draft, issued, settled, cancelled",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter by customer UUID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Credit note date from (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Credit note date to (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1-200, default: 25)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "credit-notes-create",
                "summary": "Create credit note",
                "description": "Creates a credit note with status draft. With invoice_uuid it is linked to the invoice to be credited; that invoice must belong to the same customer and use the same currency. Credit note line items are free rows without a product or project link. A credit note for an invoice takes over its tax treatment, a free credit note the customer's; the response names it as tax_treatment. With every value except standard (e.g. reverse_charge, tax_exempt) the credit note shows no VAT: a given tax_rate is set to 0. The credit note only gets its number from the team's number series on issuing; for taking over existing credit notes from another system it can be set with credit_note_number.",
                "tags": [
                    "credit-notes"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "draft"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "Customer UUID (team-bound)"
                                    },
                                    "invoice_uuid": {
                                        "type": "string",
                                        "description": "UUID of the invoice to be credited"
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "Contact UUID of the customer"
                                    },
                                    "credit_note_number": {
                                        "type": "string",
                                        "description": "Optional: your own credit note number, meant only for taking over existing credit notes from another system. Normally leave it out so the number series assigns the number on issuing. AI assistants and agents only set the field if the user explicitly insists on their own number. At most 40 characters from the letters A to Z, digits, space, dot, underscore and hyphen, starting and ending with a letter or digit. Must be unique within the team, also against deleted drafts and cancelled credit notes. If the number lies within the current number series, it must be below the next counter value; to do this, first set the next credit note number in the FlowAccounting settings above the highest import number. The counter stays unchanged, also on issuing. After creation the number can no longer be changed"
                                    },
                                    "credit_note_date": {
                                        "type": "string",
                                        "description": "Credit note date (YYYY-MM-DD, default: today)"
                                    },
                                    "currency_code": {
                                        "type": "string",
                                        "description": "EUR, USD, CHF or GBP"
                                    },
                                    "document_language": {
                                        "type": "string",
                                        "description": "de, en or pt"
                                    },
                                    "einvoice_format": {
                                        "type": "string",
                                        "description": "pdf, zugferd or xrechnung"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Visible note on the credit note"
                                    },
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption with the tax treatment tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters), printed in the note on the document. A credit note for an invoice takes over the invoice's legal basis"
                                    },
                                    "items": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Line items, 1 to 200, with <code>name</code>, <code>quantity</code>, <code>unit_price</code> and <code>tax_rate</code>"
                                    }
                                },
                                "required": [
                                    "client_uuid",
                                    "items"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/credit-notes/{uuid}": {
            "get": {
                "operationId": "credit-notes-show",
                "summary": "Get credit note details",
                "description": "Credit note details including line items, totals and available_actions.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "credit-notes-update",
                "summary": "Update credit note",
                "description": "Changes a credit note with status draft; otherwise 422. If items is passed, the list replaces all line items. The credit note number can't be changed: credit_note_number is rejected here with 422.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "notes": {
                                        "type": "string",
                                        "description": "Visible note on the credit note"
                                    },
                                    "tax_exemption_basis": {
                                        "type": "string",
                                        "description": "Legal basis of the exemption with the tax treatment tax_exempt, e.g. \"§ 4 Nr. 14\" (max. 40 characters), printed in the note on the document. A credit note for an invoice takes over the invoice's legal basis"
                                    },
                                    "items": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Replaces all line items"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "credit-notes-delete",
                "summary": "Delete credit note",
                "description": "Deletes a credit note with status draft; otherwise 422.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/credit-notes/{uuid}/issue": {
            "post": {
                "operationId": "credit-notes-issue",
                "summary": "Issue credit note",
                "description": "Issues the credit note and assigns its number, unless one was given on creation. If the underlying invoice was paid through Stripe, the refund is started. The field refund_status reports started, not_required or review_required. Only possible with status draft; otherwise 422. Also 422 if the linked invoice is still a draft (issue the invoice first), if it was cancelled, or if its tax treatment changed since the credit note was saved: then first save the credit note again with its line items via PUT.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "refund_status": "not_required",
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "issued"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/credit-notes/{uuid}/settle": {
            "post": {
                "operationId": "credit-notes-settle",
                "summary": "Apply credit note",
                "description": "Applies an issued credit note and books exactly one transaction of type credit for it. With mode offset the amount is booked to the linked invoice: it may exceed neither the credit note total nor the invoice's open amount, and invoice and credit note must use the same currency. If the booking covers the open amount, the invoice counts as paid (paid), otherwise as partially paid (partially_paid); a draft invoice or a cancelled invoice is rejected. With pool the amount goes to the customer's credit without reference to an invoice and is available there for later invoices. In both cases the credit note is fully settled afterwards (settled), even for a partial amount: the rest does not go to the credit and can't be applied later. Without amount the highest allowed amount is booked. transaction_date is meant for taking over historical documents and sets the booking date of the transaction. The response contains the credit note in data, the booked transaction in transaction and, with offset, the state of the invoice in invoice (uuid, invoice_number, status, paid_date, remaining_amount); with pool, invoice is null. The call is guarded by the status: a repetition books nothing and returns 422 with credit_note_already_settled, a draft or a cancelled credit note 422 with credit_note_not_issued. Further rejections with 422: credit_note_without_invoice, invoice_not_settleable, currency_mismatch, amount_exceeds_limit and transaction_date_out_of_range.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "settled"
                                    },
                                    "transaction": {
                                        "uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
                                        "type": "credit",
                                        "amount": 238,
                                        "credit_note_uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "invoice_uuid": "9b2e4f6a-1c3d-4e5f-8a7b-6c5d4e3f2a1b"
                                    },
                                    "invoice": {
                                        "uuid": "9b2e4f6a-1c3d-4e5f-8a7b-6c5d4e3f2a1b",
                                        "invoice_number": "RE-2026-0042",
                                        "status": "partially_paid",
                                        "paid_date": null,
                                        "remaining_amount": 952
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "mode": {
                                        "type": "string",
                                        "description": "<code>offset</code> (apply to the linked invoice) or <code>pool</code> (credit to the customer's credit balance)"
                                    },
                                    "amount": {
                                        "type": "number",
                                        "description": "Amount to book, at least 0.01. Default: the credit note total, with <code>offset</code> at most the invoice's open amount"
                                    },
                                    "transaction_date": {
                                        "type": "string",
                                        "description": "Booking date (YYYY-MM-DD, default: today). No earlier than the credit note date, no later than today"
                                    }
                                },
                                "required": [
                                    "mode"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/credit-notes/{uuid}/cancel": {
            "post": {
                "operationId": "credit-notes-cancel",
                "summary": "Cancel credit note",
                "description": "Cancels a credit note with status draft or issued; the call has no body. Cancelling is final. The document and its number are kept: the credit note can still be retrieved, and its number is never freed again. This also applies to a draft created with a given credit_note_number; it keeps that number. A settled or already cancelled credit note returns 422 with action_not_available. Also 422, with credit_note_refund_started, if a Stripe refund was started for the linked invoice and has not failed: the money has then gone back to the customer, and the document for it must remain.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "cancelled"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/credit-notes/{uuid}/send": {
            "post": {
                "operationId": "credit-notes-send",
                "summary": "Send credit note by email",
                "description": "Sends the issued credit note to exactly one address; several recipients are rejected with 422. Requires an Idempotency-Key header in UUID format. Without recipient_emails the customer's stored address applies.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "recipient_emails": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Exactly one different recipient address"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/credit-notes/{uuid}/pdf": {
            "get": {
                "operationId": "credit-notes-pdf",
                "summary": "Download credit note PDF",
                "description": "Returns the credit note as a PDF file (application/pdf) in the team's document layout. Issued credit notes return the file saved on issuing (header X-FlowAccounting-Document-Source: frozen), otherwise regenerated.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/credit-notes/{uuid}/einvoice": {
            "get": {
                "operationId": "credit-notes-einvoice",
                "summary": "Download archived e-invoice",
                "description": "Returns the e-invoice of the credit note archived on issuing byte for byte: for XRechnung the XML file (application/xml), for ZUGFeRD the PDF/A-3 with embedded XML (application/pdf). The response is a file download, not JSON; it is never regenerated. Headers: X-FlowAccounting-Einvoice-SHA256 (SHA-256 of the returned file), X-FlowAccounting-Einvoice-XML-SHA256 (SHA-256 of the invoice XML, for ZUGFeRD the embedded one), X-FlowAccounting-Einvoice-Uuid (archive entry). Without an archived e-invoice (draft, classic PDF, issued before archiving existed) the endpoint responds with 404 and error: einvoice_not_archived; if the file fails the hash check, with 409 and error: einvoice_integrity_failed. An unknown UUID or a credit note of another team results in 404.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/credit-notes/{uuid}/einvoice/validation": {
            "get": {
                "operationId": "credit-notes-einvoice-validation",
                "summary": "Validation report of the archived e-invoice",
                "description": "Returns the latest validation report of the credit note's archived e-invoice. Read-only. The validation ran on exactly the issued bytes when archiving (well-formedness, XSD, business rules according to EN 16931 and XRechnung, mandatory details under Section 14 (4) UStG). validation_status is valid, valid_with_warnings, business_rule_errors, mandatory_field_errors or format_error. report.messages is a list with code (e.g. BR-DE-2, FAC-PFLICHT-6), severity (error or warning), category (format, business_rule, mandatory_vat) and message. Without an archived e-invoice 404 with error: einvoice_not_archived; an unknown UUID or a credit note of another team results in 404.",
                "tags": [
                    "credit-notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "8d1f2c4e-6a0b-4c1d-9e2f-3a4b5c6d7e8f",
                                        "document_uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "format": "xrechnung",
                                        "profile": "xrechnung_3",
                                        "specification_id": "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0",
                                        "type_code": "380",
                                        "invoice_number": "RE-00042",
                                        "xml_sha256": "3f5a…",
                                        "file_sha256": "3f5a…",
                                        "archived_at": "2026-11-24T10:00:00+01:00",
                                        "validation_status": "valid_with_warnings",
                                        "report": {
                                            "uuid": "0c9e…",
                                            "engine": "internal",
                                            "engine_version": "internal-1.0",
                                            "status": "valid_with_warnings",
                                            "errors_count": 0,
                                            "warnings_count": 1,
                                            "messages": [
                                                {
                                                    "code": "FAC-FX-2",
                                                    "severity": "warning",
                                                    "category": "mandatory_vat",
                                                    "message": "Die Umsatzsteuer in Euro (BT-111) beruht auf einem vorläufigen Kurs, der BMF-Monatskurs ist noch nicht veröffentlicht."
                                                }
                                            ],
                                            "created_at": "2026-11-24T10:00:00+01:00"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/expenses": {
            "get": {
                "operationId": "expenses-list",
                "summary": "List expenses",
                "description": "Retrieves a paginated list of all expenses of the team, sorted by booking date, newest first.",
                "tags": [
                    "expenses"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter: pending or booked",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "supplier_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter by supplier UUID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "expense_category_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter by category UUID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search term (description, supplier invoice number)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "intake_status",
                        "in": "query",
                        "required": false,
                        "description": "Filter by intake status: needs_review returns the review queue (all open receipts before review), also received, processing, failed or reviewed",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "missing_receipt",
                        "in": "query",
                        "required": false,
                        "description": "Only receipts with input VAT but without an invoice file (task \"receipt missing\")",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Booking date from (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Booking date to (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1-200, default: 25)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "expenses-create",
                "summary": "Record expense",
                "description": "Records an expense with status pending; it is booked in a separate step with POST /flowaccounting/expenses/{uuid}/book. Net, tax and gross amounts are calculated from gross_amount, tax_rate and vat_mode. A second expense with the same supplier invoice number from the same supplier (or the same number and the same VAT ID on the receipt) is rejected with 422, unless the call confirms with confirm_not_duplicate and a reason in duplicate_reason (at least 10 characters) that it is not a duplicate. The decision is stored on the expense with reason, time and the person who made it. A credit note with the opposite sign does not count as a duplicate.",
                "tags": [
                    "expenses"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "pending",
                                        "has_receipt": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "booking_date": {
                                        "type": "string",
                                        "description": "Booking date (YYYY-MM-DD)"
                                    },
                                    "gross_amount": {
                                        "type": "number",
                                        "description": "Gross amount"
                                    },
                                    "tax_rate": {
                                        "type": "number",
                                        "description": "Tax rate in percent (default: the team's tax rate)"
                                    },
                                    "vat_mode": {
                                        "type": "string",
                                        "description": "full, none or reverse_charge (default: full)"
                                    },
                                    "currency_code": {
                                        "type": "string",
                                        "description": "EUR, USD, CHF or GBP"
                                    },
                                    "supplier_uuid": {
                                        "type": "string",
                                        "description": "Supplier UUID"
                                    },
                                    "expense_category_uuid": {
                                        "type": "string",
                                        "description": "Category UUID"
                                    },
                                    "supplier_invoice_number": {
                                        "type": "string",
                                        "description": "Supplier's invoice number"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Short description"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Internal note"
                                    },
                                    "confirm_not_duplicate": {
                                        "type": "boolean",
                                        "description": "Confirms that a receipt with the same invoice number is not a duplicate (only with duplicate_reason)"
                                    },
                                    "duplicate_reason": {
                                        "type": "string",
                                        "description": "Reason for confirm_not_duplicate, 10 to 500 characters"
                                    }
                                },
                                "required": [
                                    "booking_date",
                                    "gross_amount"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/expenses/{uuid}": {
            "get": {
                "operationId": "expenses-show",
                "summary": "Get expense details",
                "description": "Expense details including the calculated amounts as well as has_receipt and receipt_name. intake_status shows the way through the review queue (needs_review, failed, reviewed …), reviewed_at the time of the review, duplicate_decision a duplicate decision (not_duplicate) and missing_receipt whether input VAT is claimed but the invoice file is missing.",
                "tags": [
                    "expenses"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "expenses-update",
                "summary": "Update expense",
                "description": "Changes an expense with status pending. Expenses already booked stay unchanged and are rejected with 422. A changed supplier invoice number is checked for duplicates as on recording (confirm_not_duplicate, duplicate_reason).",
                "tags": [
                    "expenses"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "gross_amount": {
                                        "type": "number",
                                        "description": "Gross amount"
                                    },
                                    "expense_category_uuid": {
                                        "type": "string",
                                        "description": "Category UUID"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Short description"
                                    },
                                    "confirm_not_duplicate": {
                                        "type": "boolean",
                                        "description": "Confirms that a receipt with the same invoice number is not a duplicate (only with duplicate_reason)"
                                    },
                                    "duplicate_reason": {
                                        "type": "string",
                                        "description": "Reason for confirm_not_duplicate, 10 to 500 characters"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "expenses-delete",
                "summary": "Delete expense",
                "description": "Deletes an expense with status pending; otherwise 422.",
                "tags": [
                    "expenses"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/expenses/{uuid}/receipt": {
            "post": {
                "operationId": "expenses-receipt-upload",
                "summary": "Upload receipt",
                "description": "Attaches the receipt to the expense as multipart/form-data. PDF, JPEG and PNG up to 10 MB are allowed; the type is determined from the file content. An existing receipt is replaced once the new one is saved and is kept as an earlier version. A booked expense without a receipt file takes the missing invoice once (task \"receipt missing\"); if it already has a receipt, the API responds with 422 expense_booked, if the same file is already the receipt of another expense of the team with 422 receipt_duplicate, and for a file that is not a receipt with 422 invalid_receipt.",
                "tags": [
                    "expenses"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "has_receipt": true,
                                        "receipt_name": "beleg.pdf"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Receipt file (PDF, JPEG or PNG, at most 10 MB)"
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "expenses-receipt-download",
                "summary": "Download receipt",
                "description": "Returns the stored receipt file. Without a receipt the API responds with 404. The file is checked against its SHA-256 before delivery; if it is missing or no longer matches, the API responds with 409 receipt_integrity_failed. If the security check on intake found something (script, launch action, malicious code), the API responds with 409 receipt_flagged and the findings in security_flags, until the call passes acknowledge_security_findings=1.",
                "tags": [
                    "expenses"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "acknowledge_security_findings",
                        "in": "query",
                        "required": false,
                        "description": "Confirms that a file with a security finding should be delivered anyway",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/expenses/{uuid}/book": {
            "post": {
                "operationId": "expenses-book",
                "summary": "Book expense",
                "description": "Books an expense with status pending: it changes to status booked and gets the payment date paid_date. Only a booked expense counts in the reports, in the period of its payment date. The order is: create the expense, upload the receipt, book. After booking, changing, deleting and replacing the receipt through the API are blocked (422). Booking can't be undone through the API; a booked expense is corrected in the web interface. The call is guarded by the status: a repetition books nothing and returns 422 with expense_booked.",
                "tags": [
                    "expenses"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "booked",
                                        "paid_date": "2026-03-14",
                                        "available_actions": []
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "paid_date": {
                                        "type": "string",
                                        "description": "Payment date (YYYY-MM-DD), today at the latest"
                                    }
                                },
                                "required": [
                                    "paid_date"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/expenses/{uuid}/review": {
            "post": {
                "operationId": "expenses-review",
                "summary": "Mark receipt as reviewed",
                "description": "Marks an open expense from the review queue as reviewed (intake_status becomes reviewed, reviewed_at and the person who reviewed are saved). Booking still only happens with POST /flowaccounting/expenses/{uuid}/book. A gross amount and a receipt date are required, otherwise 422 review_incomplete. If an earlier receipt has the same supplier and the same invoice number (or the same number and VAT ID), the API responds with 422 duplicate_undecided until the call passes confirm_not_duplicate with duplicate_reason; without confirmation /book doesn't book such an expense either (422 duplicate_undecided). Expenses already booked: 422 expense_booked.",
                "tags": [
                    "expenses"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "status": "pending",
                                        "intake_status": "reviewed",
                                        "reviewed_at": "2026-11-26T10:00:00+01:00",
                                        "duplicate_decision": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "confirm_not_duplicate": {
                                        "type": "boolean",
                                        "description": "Confirms that a receipt with the same invoice number is not a duplicate"
                                    },
                                    "duplicate_reason": {
                                        "type": "string",
                                        "description": "Reason for confirm_not_duplicate, 10 to 500 characters"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/suppliers": {
            "get": {
                "operationId": "suppliers-list",
                "summary": "List suppliers",
                "description": "Retrieves a paginated list of all suppliers of the team, sorted alphabetically.",
                "tags": [
                    "suppliers"
                ],
                "parameters": [
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Filter: only active or only inactive suppliers",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search term in the name",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1-200, default: 25)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "suppliers-create",
                "summary": "Create supplier",
                "description": "Creates a supplier.",
                "tags": [
                    "suppliers"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the supplier"
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Address"
                                    },
                                    "vat_id": {
                                        "type": "string",
                                        "description": "VAT identification number"
                                    },
                                    "tax_id": {
                                        "type": "string",
                                        "description": "Tax number"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email address"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Phone number"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active (default: true)"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/suppliers/{uuid}": {
            "get": {
                "operationId": "suppliers-show",
                "summary": "Get supplier details",
                "description": "Get supplier details.",
                "tags": [
                    "suppliers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "suppliers-update",
                "summary": "Update supplier",
                "description": "Changes a supplier. Only the fields sent are changed.",
                "tags": [
                    "suppliers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the supplier"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "suppliers-delete",
                "summary": "Delete supplier",
                "description": "Deletes a supplier that has no expense booked against it yet. Otherwise the API responds with 422 and the hint to deactivate the supplier.",
                "tags": [
                    "suppliers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/expense-categories": {
            "get": {
                "operationId": "expense-categories-list",
                "summary": "List expense categories",
                "description": "Retrieves a paginated list of all expense categories of the team, sorted alphabetically.",
                "tags": [
                    "expense-categories"
                ],
                "parameters": [
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Filter: only active or only inactive categories",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search term in the name",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1-200, default: 25)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "expense-categories-create",
                "summary": "Create expense category",
                "description": "Creates an expense category. With parent_uuid it is placed below a parent category; a circular chain is rejected with 422.",
                "tags": [
                    "expense-categories"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the category"
                                    },
                                    "number": {
                                        "type": "string",
                                        "description": "Account number"
                                    },
                                    "parent_uuid": {
                                        "type": "string",
                                        "description": "UUID of the parent category"
                                    },
                                    "euer_group": {
                                        "type": "string",
                                        "description": "Assignment in the EÜR, the German cash-basis profit statement"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active (default: true)"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/expense-categories/{uuid}": {
            "get": {
                "operationId": "expense-categories-show",
                "summary": "Get expense category",
                "description": "Details of an expense category including parent_uuid.",
                "tags": [
                    "expense-categories"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "expense-categories-update",
                "summary": "Update expense category",
                "description": "Changes an expense category. Only the fields sent are changed.",
                "tags": [
                    "expense-categories"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the category"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "expense-categories-delete",
                "summary": "Delete expense category",
                "description": "Responds with 422: categories are deactivated, not deleted. The endpoint exists so that the reason is named instead of the call silently doing nothing.",
                "tags": [
                    "expense-categories"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/income-categories": {
            "get": {
                "operationId": "income-categories-list",
                "summary": "List income categories",
                "description": "Retrieves a paginated list of all income categories of the team, sorted alphabetically.",
                "tags": [
                    "income-categories"
                ],
                "parameters": [
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Filter: only active or only inactive categories",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "income_group",
                        "in": "query",
                        "required": false,
                        "description": "Filter: umsatz (revenue), kapital (capital), privat (private) or sonstige (other)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search term in the name",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1-200, default: 25)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "income-categories-create",
                "summary": "Create income category",
                "description": "Creates an income category.",
                "tags": [
                    "income-categories"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the category"
                                    },
                                    "number": {
                                        "type": "string",
                                        "description": "Account number"
                                    },
                                    "income_group": {
                                        "type": "string",
                                        "description": "umsatz (revenue), kapital (capital), privat (private) or sonstige (other)"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active (default: true)"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/income-categories/{uuid}": {
            "get": {
                "operationId": "income-categories-show",
                "summary": "Get income category",
                "description": "Details of an income category.",
                "tags": [
                    "income-categories"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "income-categories-update",
                "summary": "Update income category",
                "description": "Changes an income category. Only the fields sent are changed.",
                "tags": [
                    "income-categories"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the category"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Active"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "income-categories-delete",
                "summary": "Delete income category",
                "description": "Responds with 422: categories are deactivated, not deleted.",
                "tags": [
                    "income-categories"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/reports/{kind}": {
            "get": {
                "operationId": "reports-show",
                "summary": "Get report",
                "description": "Returns a report for the given period. Possible values for kind: open_items (open items), revenue (invoiced revenue), revenue_per_client (revenue per customer), cash_flow (income and spending by payment date), euer (EÜR, the German cash-basis profit statement) and profit_loss (profit and loss). client_uuid is only allowed with open_items, revenue and revenue_per_client, otherwise 422. Drafts and cancelled invoices are left out of every report.",
                "tags": [
                    "reports"
                ],
                "parameters": [
                    {
                        "name": "kind",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "Start of the period (YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": true,
                        "description": "End of the period (YYYY-MM-DD, not before from)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one customer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page of the result list, 50 rows per page",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "report": "revenue",
                                        "from": "2026-01-01",
                                        "to": "2026-12-31",
                                        "basis": "invoice_date_excluding_drafts_and_cancellations",
                                        "totals": [
                                            {
                                                "currency_code": "EUR",
                                                "net_amount": 48250,
                                                "gross_amount": 57417.5,
                                                "invoice_count": 37
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/context": {
            "get": {
                "operationId": "context-show",
                "summary": "Get writing context",
                "description": "Returns the team's document defaults, the tax rates, the short form of the tax profile valid today (tax_profile), the features with allowed and reason (features) and, per record type, the complete list of writable fields. With it you can build a valid body for quotes, invoices, credit notes, expenses, suppliers and categories without guessing field names. Links appear under their public names, such as client_uuid instead of an internal number. In tax_profile, vat_regime and tax_residence_country are only filled with a confirmed profile, otherwise null; default_tax_rate is the default rate of new line items.",
                "tags": [
                    "reports"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "defaults": {
                                            "default_currency": "EUR",
                                            "default_payment_days": 14
                                        },
                                        "tax_rates": [
                                            {
                                                "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                                "name": "Regelsatz",
                                                "rate": 19
                                            }
                                        ],
                                        "tax_profile": {
                                            "exists": true,
                                            "confirmed": true,
                                            "valid_from": "0001-01-01",
                                            "tax_residence_country": "DE",
                                            "vat_regime": "standard",
                                            "charges_german_vat": true,
                                            "is_small_business": false,
                                            "vat_return_required": true,
                                            "default_tax_rate": 19,
                                            "functional_currency": "EUR",
                                            "open_questions": []
                                        },
                                        "features": [
                                            {
                                                "key": "ai_receipt_extraction",
                                                "allowed": false,
                                                "reason": "disabled"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/tax-profile": {
            "get": {
                "operationId": "tax-profile-show",
                "summary": "Get tax profile",
                "description": "Returns the version of the tax profile valid today or on the day given in date, with its derived values: charges_german_vat (documents may show German VAT), is_small_business (confirmed small business under Section 19 UStG), is_registered_in_germany, allows_reverse_charge_output, input_vat_deductible, vat_return_required (German advance VAT return for the period starting on that day), default_tax_rate (default rate of new line items in percent) and functional_currency (accounting currency). If the team has no version yet, exists is false and all derived values describe today's behaviour. Possible values: vat_regime standard, small_business or not_registered_de; vat_basis accrual (VAT on invoiced amounts) or cash (VAT on payments received); vat_filing_frequency monthly, quarterly or exempt.",
                "tags": [
                    "tax-profile"
                ],
                "parameters": [
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "description": "Reference date (YYYY-MM-DD), default: today",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                        "exists": true,
                                        "date": "2026-11-22",
                                        "valid_from": "0001-01-01",
                                        "valid_until": null,
                                        "confirmed": true,
                                        "source": "wizard",
                                        "tax_residence_country": "DE",
                                        "vat_regime": "small_business",
                                        "vat_basis": null,
                                        "vat_filing_frequency": null,
                                        "legal_form": "freelancer",
                                        "fiscal_year_start_month": 1,
                                        "open_questions": [],
                                        "charges_german_vat": false,
                                        "is_small_business": true,
                                        "is_registered_in_germany": true,
                                        "allows_reverse_charge_output": false,
                                        "input_vat_deductible": false,
                                        "vat_return_required": false,
                                        "default_tax_rate": 0,
                                        "functional_currency": "EUR",
                                        "revision": 3,
                                        "labels": {
                                            "vat_regime": "Kleinunternehmer (§ 19 UStG)"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/tax-profile/history": {
            "get": {
                "operationId": "tax-profile-history",
                "summary": "Tax profile history",
                "description": "Returns all versions of the tax profile, oldest first, in the same form as GET /flowaccounting/tax-profile. valid_until is the last day of a version, null for the newest. Period-related derived values apply to the first day of each version.",
                "tags": [
                    "tax-profile"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "550e8400-e29b-41d4-a716-446655440000",
                                            "valid_from": "0001-01-01",
                                            "valid_until": "2026-12-31",
                                            "vat_regime": "small_business"
                                        },
                                        {
                                            "uuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
                                            "valid_from": "2027-01-01",
                                            "valid_until": null,
                                            "vat_regime": "standard"
                                        }
                                    ],
                                    "meta": {
                                        "total": 2
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowaccounting/features": {
            "get": {
                "operationId": "features-index",
                "summary": "Get features",
                "description": "Returns for every FlowAccounting feature whether it is in effect (allowed) and the individual levels: module_active (FlowAccounting active), applicable (fits the tax profile), entitled (included in the plan) and enabled (switched on by the team). reason names the first level that is not met: module_inactive, not_applicable, not_entitled, disabled, otherwise allowed.",
                "tags": [
                    "tax-profile"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "key": "ai_receipt_extraction",
                                            "label": "KI-Belegauslesung",
                                            "module_active": true,
                                            "entitled": true,
                                            "applicable": true,
                                            "enabled": false,
                                            "allowed": false,
                                            "reason": "disabled"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "API key (pk_… or at_…) as Authorization: Bearer <key>. Any other way of sending it is rejected with 401."
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "success": {
                        "type": "boolean"
                    },
                    "error": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object"
                    }
                }
            }
        }
    }
}