{
    "openapi": "3.0.3",
    "info": {
        "title": "CRM REST-API",
        "version": "2.0.0",
        "description": "REST-API für die Anbindung von Fremdsoftware: Kunden, Belege (Offerten bis Gutschriften), Zahlungen, Artikel, Abo-Rechnungen, Projekte & Zeiten, Buchhaltung, Lieferantenrechnungen, Kundenanfragen, Mobile, Hosting, Web-Dienste, Cloud-Server, Online-Shop und Webhooks. Beträge in CHF mit Dezimalpunkt, Datumsangaben JJJJ-MM-TT, Zeitpunkte ISO 8601. Ausführliche Anleitung: https://crm.serv24-it.ch/api/v2/docs"
    },
    "servers": [
        {
            "url": "https://crm.serv24-it.ch/api/v2",
            "description": "Produktiv"
        },
        {
            "url": "https://crm.serv24-it.ch/api.php/v2",
            "description": "Alternative ohne URL-Umschreibung"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        },
        {
            "apiKeyHeader": []
        }
    ],
    "tags": [
        {
            "name": "Allgemein",
            "description": "Verbindung, Rechte und Auswahllisten"
        },
        {
            "name": "Kunden",
            "description": "Kunden, Kontaktpersonen, Notizen und Kundendokumente"
        },
        {
            "name": "Belege",
            "description": "Offerten, Aufträge, Lieferscheine, Rechnungen, Gutschriften inkl. PDF, Versand, Storno"
        },
        {
            "name": "Zahlungen",
            "description": "Zahlungseingänge zu Rechnungen und Gutschriften"
        },
        {
            "name": "Artikel",
            "description": "Artikel- und Leistungsstamm"
        },
        {
            "name": "Abo-Rechnungen",
            "description": "Wiederkehrende Rechnungen"
        },
        {
            "name": "Projekte & Zeiten",
            "description": "Projekte und Zeiteinträge"
        },
        {
            "name": "Einnahmen & Ausgaben",
            "description": "Buchungen, Kategorien und Belege"
        },
        {
            "name": "Lieferantenrechnungen",
            "description": "Kreditoren erfassen und als bezahlt verbuchen"
        },
        {
            "name": "Kundenanfragen",
            "description": "Anfragen aus dem Kundenportal beantworten"
        },
        {
            "name": "Mahnwesen",
            "description": "Versendete Mahnungen"
        },
        {
            "name": "Mobile",
            "description": "SIM-Karten, Mobile-Abos und Produkte (nur lesen)"
        },
        {
            "name": "Webhosting",
            "description": "Hosting-Konten und Pakete (nur lesen)"
        },
        {
            "name": "Web-Dienste",
            "description": "Domains, E-Mail und weitere Web-Dienste (nur lesen)"
        },
        {
            "name": "Cloud-Server",
            "description": "Cloud-Server der Kunden (nur lesen)"
        },
        {
            "name": "Online-Shop",
            "description": "Bestellungen aus dem Online-Shop (nur lesen)"
        },
        {
            "name": "Webhooks",
            "description": "Webhooks einrichten, testen und Zustellungen einsehen"
        }
    ],
    "paths": {
        "/me": {
            "get": {
                "tags": [
                    "Allgemein"
                ],
                "summary": "Schlüssel, Betrieb, Rechte und verfügbare Bereiche",
                "operationId": "get_me",
                "description": "Praktisch zum Testen der Verbindung.",
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/meta": {
            "get": {
                "tags": [
                    "Allgemein"
                ],
                "summary": "Auswahllisten (Belegarten, Status, Länder, Regionen, MWST-Sätze, Ereignisse …)",
                "operationId": "get_meta",
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/customers": {
            "get": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kunden auflisten",
                "operationId": "get_customers",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Freitext (Firma, Name, E-Mail, Kundennummer, Ort)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "customer_no",
                        "in": "query",
                        "description": "Kundennummer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "E-Mail (genau)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ext_ref",
                        "in": "query",
                        "description": "Ihre Referenz",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Art",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "person",
                                "company"
                            ]
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "description": "Schlagwort",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "description": "Land",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "archived",
                        "in": "query",
                        "description": "false = aktive (Standard), true = archivierte, all = alle",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "false",
                                "true",
                                "all"
                            ]
                        }
                    },
                    {
                        "name": "created_since",
                        "in": "query",
                        "description": "Nur Einträge, die ab diesem Zeitpunkt erfasst wurden (ISO 8601)",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, customer_no, company, last_name, city, created_at",
                        "schema": {
                            "type": "string",
                            "default": "id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Customer"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kunde anlegen",
                "operationId": "post_customers",
                "description": "Ort und Kanton/Bundesland werden anhand der PLZ geprüft und ergänzt. Bei fehlender Kundennummer wird die nächste freie vergeben.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Customer"
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "contacts": {
                                                "type": "array",
                                                "items": {
                                                    "$ref": "#/components/schemas/Contact"
                                                },
                                                "description": "Kontaktpersonen gleich mitanlegen (Schema Contact)",
                                                "nullable": true
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Customer"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/customers/{id}": {
            "get": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kunde abrufen (inkl. Kontaktpersonen und offenem Betrag)",
                "operationId": "get_customers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Customer"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kunde ändern (nur übergebene Felder)",
                "operationId": "patch_customers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Customer"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Customer"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kunde löschen (nur ohne Belege – sonst archivieren)",
                "operationId": "delete_customers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/customers/{id}/contacts": {
            "get": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kontaktpersonen eines Kunden",
                "operationId": "get_customers_id_contacts",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Contact"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kontaktperson anlegen",
                "operationId": "post_customers_id_contacts",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Contact"
                                    },
                                    {
                                        "required": [
                                            "name"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Contact"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/contacts/{id}": {
            "patch": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kontaktperson ändern",
                "operationId": "patch_contacts_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Contact"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Contact"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kontaktperson löschen",
                "operationId": "delete_contacts_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/customers/{id}/notes": {
            "get": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Notizen eines Kunden",
                "operationId": "get_customers_id_notes",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Note"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Notiz erfassen",
                "operationId": "post_customers_id_notes",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Note"
                                    },
                                    {
                                        "required": [
                                            "note"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Note"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/customers/{id}/files": {
            "get": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kundendokumente auflisten (Modul Dokumentablage)",
                "operationId": "get_customers_id_files",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/File"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kundendokument ablegen (Base64)",
                "operationId": "post_customers_id_files",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Dateiname inkl. Endung (pdf, jpg, png, docx, xlsx, zip …)"
                                    },
                                    "content_base64": {
                                        "type": "string",
                                        "description": "Dateiinhalt Base64-kodiert (max. 25 MB)"
                                    },
                                    "category": {
                                        "type": "string",
                                        "description": "Kategorie: Vertrag, Offerte, Korrespondenz, Plan, Foto, Rechnung, Sonstiges",
                                        "nullable": true
                                    },
                                    "note": {
                                        "type": "string",
                                        "description": "Bemerkung",
                                        "nullable": true
                                    },
                                    "shared": {
                                        "type": "boolean",
                                        "description": "Im Kundenportal sichtbar",
                                        "nullable": true
                                    }
                                },
                                "required": [
                                    "name",
                                    "content_base64"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/File"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/customers/{id}/files/{file_id}": {
            "get": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kundendokument herunterladen",
                "operationId": "get_customers_id_files_file_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "file_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Datei",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Kunden"
                ],
                "summary": "Kundendokument löschen",
                "operationId": "delete_customers_id_files_file_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "file_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/documents": {
            "get": {
                "tags": [
                    "Belege"
                ],
                "summary": "Belege auflisten",
                "operationId": "get_documents",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Belegart(en), kommagetrennt: quote, order, delivery, invoice, credit",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status, kommagetrennt (z.B. open,partial)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "number",
                        "in": "query",
                        "description": "Belegnummer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ext_ref",
                        "in": "query",
                        "description": "Ihre Referenz",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "recurring_id",
                        "in": "query",
                        "description": "Aus Abo-Rechnung",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "overdue",
                        "in": "query",
                        "description": "true = nur überfällige offene Rechnungen",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Belegdatum ab (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Belegdatum bis (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "created_since",
                        "in": "query",
                        "description": "Nur Einträge, die ab diesem Zeitpunkt erfasst wurden (ISO 8601)",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, date, due_date, number, total, created_at",
                        "schema": {
                            "type": "string",
                            "default": "-id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Document"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Belege"
                ],
                "summary": "Beleg anlegen (z.B. Rechnung)",
                "operationId": "post_documents",
                "description": "Ohne finalize/send entsteht ein Entwurf, der noch geändert werden kann. Positionen mit product_id übernehmen Text, Preis, Einheit und MWST vom Artikel, soweit nicht angegeben.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "allOf": [
                                            {
                                                "$ref": "#/components/schemas/Document"
                                            },
                                            {
                                                "required": [
                                                    "customer_id",
                                                    "items"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "finalize": {
                                                "type": "boolean",
                                                "description": "Gleich abschliessen (Nummer vergeben, Status offen)",
                                                "nullable": true
                                            },
                                            "send": {
                                                "type": "boolean",
                                                "description": "Gleich abschliessen und an den Kunden senden (E-Mail bzw. Post gemäss Kunde)",
                                                "nullable": true
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Document"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/documents/{id}": {
            "get": {
                "tags": [
                    "Belege"
                ],
                "summary": "Beleg abrufen (inkl. Positionen und Zahlungen)",
                "operationId": "get_documents_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Document"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Belege"
                ],
                "summary": "Entwurf ändern (abgeschlossene Belege: nur ext_ref und Mahnstopp)",
                "operationId": "patch_documents_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Document"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Document"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Belege"
                ],
                "summary": "Entwurf löschen (abgeschlossene Belege stornieren)",
                "operationId": "delete_documents_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/documents/{id}/finalize": {
            "post": {
                "tags": [
                    "Belege"
                ],
                "summary": "Beleg abschliessen (Nummer, QR-Referenz, Status offen)",
                "operationId": "post_documents_id_finalize",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Document"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/documents/{id}/send": {
            "post": {
                "tags": [
                    "Belege"
                ],
                "summary": "Beleg an den Kunden senden (schliesst Entwürfe vorher ab)",
                "operationId": "post_documents_id_send",
                "description": "Versandweg gemäss Kunde (E-Mail oder Post). Antwort enthält zusätzlich «delivery» mit channel und message.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Document"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/documents/{id}/cancel": {
            "post": {
                "tags": [
                    "Belege"
                ],
                "summary": "Beleg stornieren",
                "operationId": "post_documents_id_cancel",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "notify": {
                                        "type": "boolean",
                                        "description": "Kunde per E-Mail informieren (Standard true)",
                                        "nullable": true
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Document"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/documents/{id}/convert": {
            "post": {
                "tags": [
                    "Belege"
                ],
                "summary": "In andere Belegart umwandeln (Offerte → Auftrag → Lieferschein → Rechnung → Gutschrift)",
                "operationId": "post_documents_id_convert",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "order",
                                            "delivery",
                                            "invoice",
                                            "credit"
                                        ],
                                        "description": "Ziel-Belegart"
                                    }
                                },
                                "required": [
                                    "type"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Document"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/documents/{id}/pdf": {
            "get": {
                "tags": [
                    "Belege"
                ],
                "summary": "Beleg als PDF",
                "operationId": "get_documents_id_pdf",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Datei",
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/documents/{id}/payments": {
            "get": {
                "tags": [
                    "Belege"
                ],
                "summary": "Zahlungen zu einem Beleg",
                "operationId": "get_documents_id_payments",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Payment"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/payments": {
            "get": {
                "tags": [
                    "Zahlungen"
                ],
                "summary": "Zahlungen auflisten",
                "operationId": "get_payments",
                "parameters": [
                    {
                        "name": "document_id",
                        "in": "query",
                        "description": "Beleg",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "method",
                        "in": "query",
                        "description": "Zahlungsart",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Zahlungsdatum ab (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Zahlungsdatum bis (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, date, amount",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Payment"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Zahlungen"
                ],
                "summary": "Zahlung erfassen",
                "operationId": "post_payments",
                "description": "Setzt den Status der Rechnung (teilweise bezahlt / bezahlt) und verbucht die Einnahme. Die Antwort enthält zusätzlich «document» (aktualisierter Beleg).",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Payment"
                                    },
                                    {
                                        "required": [
                                            "document_id"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Payment"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/payments/{id}": {
            "get": {
                "tags": [
                    "Zahlungen"
                ],
                "summary": "Zahlung abrufen",
                "operationId": "get_payments_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Payment"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Zahlungen"
                ],
                "summary": "Zahlung löschen (inkl. Buchung)",
                "operationId": "delete_payments_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/products": {
            "get": {
                "tags": [
                    "Artikel"
                ],
                "summary": "Artikel auflisten",
                "operationId": "get_products",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Freitext",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "number",
                        "in": "query",
                        "description": "Artikelnummer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ext_ref",
                        "in": "query",
                        "description": "Ihre Referenz",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "active",
                        "in": "query",
                        "description": "Nur aktive bzw. inaktive",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "shop",
                        "in": "query",
                        "description": "Im Online-Shop",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, name, number, price",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Product"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Artikel"
                ],
                "summary": "Artikel anlegen",
                "operationId": "post_products",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Product"
                                    },
                                    {
                                        "required": [
                                            "name"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Product"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/products/{id}": {
            "get": {
                "tags": [
                    "Artikel"
                ],
                "summary": "Artikel abrufen",
                "operationId": "get_products_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Product"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Artikel"
                ],
                "summary": "Artikel ändern",
                "operationId": "patch_products_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Product"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Product"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Artikel"
                ],
                "summary": "Artikel löschen (in Belegen verwendet → wird deaktiviert, Antwort 200)",
                "operationId": "delete_products_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/recurring": {
            "get": {
                "tags": [
                    "Abo-Rechnungen"
                ],
                "summary": "Abo-Rechnungen auflisten",
                "operationId": "get_recurring",
                "parameters": [
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "active",
                        "in": "query",
                        "description": "Aktiv",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, next_date, title",
                        "schema": {
                            "type": "string",
                            "default": "next_date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Recurring"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Abo-Rechnungen"
                ],
                "summary": "Abo-Rechnung anlegen",
                "operationId": "post_recurring",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Recurring"
                                    },
                                    {
                                        "required": [
                                            "customer_id",
                                            "items"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Recurring"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/recurring/{id}": {
            "get": {
                "tags": [
                    "Abo-Rechnungen"
                ],
                "summary": "Abo-Rechnung abrufen",
                "operationId": "get_recurring_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Recurring"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Abo-Rechnungen"
                ],
                "summary": "Abo-Rechnung ändern",
                "operationId": "patch_recurring_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Recurring"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Recurring"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Abo-Rechnungen"
                ],
                "summary": "Abo-Rechnung löschen (bereits erstellte Rechnungen bleiben)",
                "operationId": "delete_recurring_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/recurring/{id}/run": {
            "post": {
                "tags": [
                    "Abo-Rechnungen"
                ],
                "summary": "Fällige Rechnungen dieser Abo-Rechnung jetzt erstellen",
                "operationId": "post_recurring_id_run",
                "description": "Erstellt alle Rechnungen bis heute (wie der tägliche Lauf). Antwort: die neu erstellten Rechnungen.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Document"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/projects": {
            "get": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Projekte auflisten",
                "operationId": "get_projects",
                "parameters": [
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status, kommagetrennt",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Projektname",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, name, created_at",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Project"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Projekt anlegen",
                "operationId": "post_projects",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Project"
                                    },
                                    {
                                        "required": [
                                            "name"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Project"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/projects/{id}": {
            "get": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Projekt abrufen",
                "operationId": "get_projects_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Project"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Projekt ändern",
                "operationId": "patch_projects_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Project"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Project"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Projekt löschen (nur ohne verrechnete Zeiten)",
                "operationId": "delete_projects_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/time-entries": {
            "get": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Zeiteinträge auflisten",
                "operationId": "get_time_entries",
                "parameters": [
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "Projekt",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Benutzer",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "billable",
                        "in": "query",
                        "description": "Verrechenbar",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "invoiced",
                        "in": "query",
                        "description": "true = verrechnet, false = noch nicht verrechnet",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Datum ab (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Datum bis (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, date, hours",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/TimeEntry"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Zeit erfassen",
                "operationId": "post_time_entries",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/TimeEntry"
                                    },
                                    {
                                        "required": [
                                            "project_id",
                                            "hours"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/TimeEntry"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/time-entries/{id}": {
            "get": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Zeiteintrag abrufen",
                "operationId": "get_time_entries_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/TimeEntry"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Zeiteintrag ändern (nicht verrechnete)",
                "operationId": "patch_time_entries_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TimeEntry"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/TimeEntry"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Projekte & Zeiten"
                ],
                "summary": "Zeiteintrag löschen (nicht verrechnete)",
                "operationId": "delete_time_entries_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/transactions": {
            "get": {
                "tags": [
                    "Einnahmen & Ausgaben"
                ],
                "summary": "Buchungen auflisten",
                "operationId": "get_transactions",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Einnahmen oder Ausgaben",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "income",
                                "expense"
                            ]
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "description": "Kategorie",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "booked (Standard), open, all",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "document_id",
                        "in": "query",
                        "description": "Beleg",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Freitext",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Datum ab (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Datum bis (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, date, amount",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Transaction"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Einnahmen & Ausgaben"
                ],
                "summary": "Buchung erfassen",
                "operationId": "post_transactions",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "allOf": [
                                            {
                                                "$ref": "#/components/schemas/Transaction"
                                            },
                                            {
                                                "required": [
                                                    "type",
                                                    "amount"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "receipt": {
                                                "type": "object",
                                                "properties": {
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "content_base64": {
                                                        "type": "string",
                                                        "format": "byte"
                                                    }
                                                },
                                                "description": "Beleg: {\"name\": \"quittung.pdf\", \"content_base64\": \"…\"} (pdf, jpg, png; max. 20 MB)",
                                                "nullable": true
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Transaction"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/transactions/{id}": {
            "get": {
                "tags": [
                    "Einnahmen & Ausgaben"
                ],
                "summary": "Buchung abrufen",
                "operationId": "get_transactions_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Transaction"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Einnahmen & Ausgaben"
                ],
                "summary": "Buchung ändern (nur manuelle)",
                "operationId": "patch_transactions_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Transaction"
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "receipt": {
                                                "type": "object",
                                                "properties": {
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "content_base64": {
                                                        "type": "string",
                                                        "format": "byte"
                                                    }
                                                },
                                                "description": "Beleg ersetzen",
                                                "nullable": true
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Transaction"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Einnahmen & Ausgaben"
                ],
                "summary": "Buchung löschen (nur manuelle)",
                "operationId": "delete_transactions_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/transactions/{id}/receipt": {
            "get": {
                "tags": [
                    "Einnahmen & Ausgaben"
                ],
                "summary": "Beleg (PDF/Bild) herunterladen",
                "operationId": "get_transactions_id_receipt",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Datei",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/categories": {
            "get": {
                "tags": [
                    "Einnahmen & Ausgaben"
                ],
                "summary": "Kategorien",
                "operationId": "get_categories",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Art",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "income",
                                "expense"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: name, id",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Category"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Einnahmen & Ausgaben"
                ],
                "summary": "Kategorie anlegen",
                "operationId": "post_categories",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Category"
                                    },
                                    {
                                        "required": [
                                            "type",
                                            "name"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Category"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/bills": {
            "get": {
                "tags": [
                    "Lieferantenrechnungen"
                ],
                "summary": "Lieferantenrechnungen auflisten",
                "operationId": "get_bills",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "open, booked",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Freitext (Lieferant, Nummer, Text)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "due_to",
                        "in": "query",
                        "description": "Fällig bis",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Rechnungsdatum ab (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Rechnungsdatum bis (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, bill_date, due_date, amount",
                        "schema": {
                            "type": "string",
                            "default": "due_date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Bill"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Lieferantenrechnungen"
                ],
                "summary": "Lieferantenrechnung erfassen",
                "operationId": "post_bills",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "allOf": [
                                            {
                                                "$ref": "#/components/schemas/Bill"
                                            },
                                            {
                                                "required": [
                                                    "supplier",
                                                    "amount"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "receipt": {
                                                "type": "object",
                                                "properties": {
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "content_base64": {
                                                        "type": "string",
                                                        "format": "byte"
                                                    }
                                                },
                                                "description": "Rechnung als Datei: {\"name\": \"rechnung.pdf\", \"content_base64\": \"…\"}",
                                                "nullable": true
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Bill"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/bills/{id}": {
            "get": {
                "tags": [
                    "Lieferantenrechnungen"
                ],
                "summary": "Lieferantenrechnung abrufen",
                "operationId": "get_bills_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Bill"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Lieferantenrechnungen"
                ],
                "summary": "Offene Lieferantenrechnung ändern",
                "operationId": "patch_bills_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Bill"
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "receipt": {
                                                "type": "object",
                                                "properties": {
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "content_base64": {
                                                        "type": "string",
                                                        "format": "byte"
                                                    }
                                                },
                                                "description": "Datei ersetzen",
                                                "nullable": true
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Bill"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Lieferantenrechnungen"
                ],
                "summary": "Lieferantenrechnung löschen",
                "operationId": "delete_bills_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/bills/{id}/pay": {
            "post": {
                "tags": [
                    "Lieferantenrechnungen"
                ],
                "summary": "Als bezahlt verbuchen",
                "operationId": "post_bills_id_pay",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "date": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Zahlungsdatum (Standard heute)",
                                        "nullable": true
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Bill"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/bills/{id}/receipt": {
            "get": {
                "tags": [
                    "Lieferantenrechnungen"
                ],
                "summary": "Rechnungsdatei herunterladen",
                "operationId": "get_bills_id_receipt",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Datei",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/requests": {
            "get": {
                "tags": [
                    "Kundenanfragen"
                ],
                "summary": "Kundenanfragen auflisten",
                "operationId": "get_requests",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status, kommagetrennt",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "kind",
                        "in": "query",
                        "description": "Art",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_since",
                        "in": "query",
                        "description": "Nur Einträge, die ab diesem Zeitpunkt erfasst wurden (ISO 8601)",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, updated_at, created_at",
                        "schema": {
                            "type": "string",
                            "default": "-updated_at"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Request"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Kundenanfragen"
                ],
                "summary": "Anfrage im Namen eines Kunden eröffnen",
                "operationId": "post_requests",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "allOf": [
                                            {
                                                "$ref": "#/components/schemas/Request"
                                            },
                                            {
                                                "required": [
                                                    "customer_id"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "object",
                                        "properties": {
                                            "text": {
                                                "type": "string",
                                                "description": "Erste Nachricht des Kunden"
                                            }
                                        },
                                        "required": [
                                            "text"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Request"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/requests/{id}": {
            "get": {
                "tags": [
                    "Kundenanfragen"
                ],
                "summary": "Anfrage abrufen (inkl. Nachrichten)",
                "operationId": "get_requests_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Request"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Kundenanfragen"
                ],
                "summary": "Status ändern (Kunde wird informiert)",
                "operationId": "patch_requests_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "open",
                                            "progress",
                                            "answered",
                                            "done",
                                            "rejected"
                                        ],
                                        "description": "Neuer Status"
                                    }
                                },
                                "required": [
                                    "status"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Request"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/requests/{id}/messages": {
            "post": {
                "tags": [
                    "Kundenanfragen"
                ],
                "summary": "Antworten (Kunde wird per E-Mail/WhatsApp informiert)",
                "operationId": "post_requests_id_messages",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "text": {
                                        "type": "string",
                                        "description": "Antwort"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "Neuer Status (Standard answered)",
                                        "nullable": true
                                    },
                                    "author": {
                                        "type": "string",
                                        "description": "Absendername (Standard: Name des API-Schlüssels)",
                                        "nullable": true
                                    }
                                },
                                "required": [
                                    "text"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Request"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/dunning": {
            "get": {
                "tags": [
                    "Mahnwesen"
                ],
                "summary": "Versendete Mahnungen",
                "operationId": "get_dunning",
                "parameters": [
                    {
                        "name": "document_id",
                        "in": "query",
                        "description": "Rechnung",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "level",
                        "in": "query",
                        "description": "Mahnstufe",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Versanddatum ab (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Versanddatum bis (JJJJ-MM-TT)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, sent_at",
                        "schema": {
                            "type": "string",
                            "default": "-sent_at"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Dunning"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/mobile/sims": {
            "get": {
                "tags": [
                    "Mobile"
                ],
                "summary": "SIM-Karten",
                "operationId": "get_mobile_sims",
                "parameters": [
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "msisdn",
                        "in": "query",
                        "description": "Rufnummer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "iccid",
                        "in": "query",
                        "description": "ICCID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gone",
                        "in": "query",
                        "description": "Auch nicht mehr vorhandene (Standard false)",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, msisdn, created_at",
                        "schema": {
                            "type": "string",
                            "default": "id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Sim"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/mobile/sims/{id}": {
            "get": {
                "tags": [
                    "Mobile"
                ],
                "summary": "SIM-Karte abrufen",
                "operationId": "get_mobile_sims_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Sim"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/mobile/subscriptions": {
            "get": {
                "tags": [
                    "Mobile"
                ],
                "summary": "Mobile-Abos",
                "operationId": "get_mobile_subscriptions",
                "parameters": [
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status, kommagetrennt",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sim_id",
                        "in": "query",
                        "description": "SIM-Karte",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, paid_until, created_at",
                        "schema": {
                            "type": "string",
                            "default": "id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/MobileSub"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/mobile/subscriptions/{id}": {
            "get": {
                "tags": [
                    "Mobile"
                ],
                "summary": "Mobile-Abo abrufen",
                "operationId": "get_mobile_subscriptions_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/MobileSub"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/mobile/products": {
            "get": {
                "tags": [
                    "Mobile"
                ],
                "summary": "Mobile-Produkte",
                "operationId": "get_mobile_products",
                "parameters": [
                    {
                        "name": "active",
                        "in": "query",
                        "description": "Aktiv",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: sort, name, id",
                        "schema": {
                            "type": "string",
                            "default": "sort"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/MobileProduct"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/hosting/accounts": {
            "get": {
                "tags": [
                    "Webhosting"
                ],
                "summary": "Hosting-Konten",
                "operationId": "get_hosting_accounts",
                "parameters": [
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "description": "Domain",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, domain, created_at",
                        "schema": {
                            "type": "string",
                            "default": "id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/HostingAccount"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/hosting/accounts/{id}": {
            "get": {
                "tags": [
                    "Webhosting"
                ],
                "summary": "Hosting-Konto abrufen",
                "operationId": "get_hosting_accounts_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/HostingAccount"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/hosting/products": {
            "get": {
                "tags": [
                    "Webhosting"
                ],
                "summary": "Hosting-Pakete",
                "operationId": "get_hosting_products",
                "parameters": [
                    {
                        "name": "active",
                        "in": "query",
                        "description": "Aktiv",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: sort, name",
                        "schema": {
                            "type": "string",
                            "default": "sort"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/HostingProduct"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/web-services": {
            "get": {
                "tags": [
                    "Web-Dienste"
                ],
                "summary": "Web-Dienste (Domains, E-Mail …)",
                "operationId": "get_web_services",
                "parameters": [
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "service_name",
                        "in": "query",
                        "description": "Art",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "fqdn",
                        "in": "query",
                        "description": "Domain",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gone",
                        "in": "query",
                        "description": "Auch nicht mehr vorhandene (Standard false)",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "expires_to",
                        "in": "query",
                        "description": "Läuft ab bis",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, fqdn, expired_at",
                        "schema": {
                            "type": "string",
                            "default": "id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WebService"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/web-services/{id}": {
            "get": {
                "tags": [
                    "Web-Dienste"
                ],
                "summary": "Web-Dienst abrufen",
                "operationId": "get_web_services_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/WebService"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/cloud-servers": {
            "get": {
                "tags": [
                    "Cloud-Server"
                ],
                "summary": "Cloud-Server",
                "operationId": "get_cloud_servers",
                "parameters": [
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gone",
                        "in": "query",
                        "description": "Auch gelöschte (Standard false)",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, name, paid_until",
                        "schema": {
                            "type": "string",
                            "default": "id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CloudServer"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/cloud-servers/{id}": {
            "get": {
                "tags": [
                    "Cloud-Server"
                ],
                "summary": "Cloud-Server abrufen",
                "operationId": "get_cloud_servers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CloudServer"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/shop/orders": {
            "get": {
                "tags": [
                    "Online-Shop"
                ],
                "summary": "Shop-Bestellungen",
                "operationId": "get_shop_orders",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status, kommagetrennt",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Kunde",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "number",
                        "in": "query",
                        "description": "Bestellnummer",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_since",
                        "in": "query",
                        "description": "Nur Einträge, die ab diesem Zeitpunkt erfasst wurden (ISO 8601)",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id, created_at",
                        "schema": {
                            "type": "string",
                            "default": "-id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ShopOrder"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/shop/orders/{id}": {
            "get": {
                "tags": [
                    "Online-Shop"
                ],
                "summary": "Shop-Bestellung abrufen (inkl. Positionen)",
                "operationId": "get_shop_orders_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ShopOrder"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/webhooks": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Webhooks auflisten",
                "operationId": "get_webhooks",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id",
                        "schema": {
                            "type": "string",
                            "default": "id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Webhook"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Webhook anlegen (Antwort enthält einmalig das Signatur-Geheimnis)",
                "operationId": "post_webhooks",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Webhook"
                                    },
                                    {
                                        "required": [
                                            "url"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Webhook"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/webhooks/{id}": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Webhook abrufen",
                "operationId": "get_webhooks_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Webhook"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Webhook ändern (active=true setzt Fehlerzähler zurück)",
                "operationId": "patch_webhooks_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Webhook"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Webhook"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Webhook löschen",
                "operationId": "delete_webhooks_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Erledigt (keine Daten)"
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/webhooks/{id}/test": {
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Testereignis sofort zustellen",
                "operationId": "post_webhooks_id_test",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Delivery"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/webhooks/{id}/deliveries": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Letzte Zustellungen (30 Tage)",
                "operationId": "get_webhooks_id_deliveries",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "pending, done, failed",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "event",
                        "in": "query",
                        "description": "Ereignis",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Anzahl (1–200, Standard 50)",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 50
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Überspringen",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "default": 0
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sortierung, kommagetrennt, «-» = absteigend. Erlaubt: id",
                        "schema": {
                            "type": "string",
                            "default": "-id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Delivery"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/ListMeta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        },
        "/webhooks/{id}/deliveries/{delivery_id}/retry": {
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Zustellung erneut versuchen",
                "operationId": "post_webhooks_id_deliveries_delivery_id_retry",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "delivery_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Eindeutiger Schlüssel – dieselbe Anfrage wird innert 24 Std. nur einmal ausgeführt",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolg",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Delivery"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "409": {
                        "$ref": "#/components/responses/Conflict"
                    },
                    "422": {
                        "$ref": "#/components/responses/Unprocessable"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooMany"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "crm_…",
                "description": "API-Schlüssel aus Einstellungen → REST-API"
            },
            "apiKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key"
            }
        },
        "schemas": {
            "Customer": {
                "type": "object",
                "description": "Kunde",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_no": {
                        "type": "string",
                        "description": "Kundennummer – leer lassen für die nächste freie Nummer"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "person",
                            "company"
                        ],
                        "description": "Privatperson oder Firma (Standard: company, wenn «company» gesetzt ist, sonst person)"
                    },
                    "name": {
                        "type": "string",
                        "description": "Anzeigename (Firma bzw. Vor- und Nachname)",
                        "readOnly": true
                    },
                    "company": {
                        "type": "string",
                        "description": "Firmenname (Firma: Pflicht, sonst last_name)"
                    },
                    "salutation": {
                        "type": "string",
                        "description": "Anrede, z.B. Herr, Frau"
                    },
                    "first_name": {
                        "type": "string",
                        "description": "Vorname"
                    },
                    "last_name": {
                        "type": "string",
                        "description": "Nachname (Privatperson: Pflicht)"
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "description": "E-Mail-Adresse (Rechnungsversand)"
                    },
                    "phone": {
                        "type": "string",
                        "description": "Telefon"
                    },
                    "mobile": {
                        "type": "string",
                        "description": "Mobile"
                    },
                    "website": {
                        "type": "string",
                        "description": "Webseite"
                    },
                    "street": {
                        "type": "string",
                        "description": "Strasse und Hausnummer"
                    },
                    "address2": {
                        "type": "string",
                        "description": "Adresszusatz, Postfach"
                    },
                    "zip": {
                        "type": "string",
                        "description": "PLZ"
                    },
                    "city": {
                        "type": "string",
                        "description": "Ort – Schreibweise wird anhand der PLZ korrigiert"
                    },
                    "region": {
                        "type": "string",
                        "description": "Kanton / Bundesland / Region – leer = automatisch aus PLZ und Ort",
                        "nullable": true
                    },
                    "country": {
                        "type": "string",
                        "description": "Land, ISO-3166-Code (CH, LI und EU-Staaten), Standard CH"
                    },
                    "birth_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Geburtsdatum (JJJJ-MM-TT)",
                        "nullable": true
                    },
                    "language": {
                        "type": "string",
                        "enum": [
                            "de",
                            "fr",
                            "it",
                            "en"
                        ],
                        "description": "Sprache der Belege"
                    },
                    "uid_no": {
                        "type": "string",
                        "description": "UID (CHE-…)"
                    },
                    "vat_no": {
                        "type": "string",
                        "description": "MWST-Nummer"
                    },
                    "payment_days": {
                        "type": "integer",
                        "description": "Zahlungsfrist in Tagen (leer = Standard des Betriebs)",
                        "nullable": true
                    },
                    "delivery_channel": {
                        "type": "string",
                        "enum": [
                            "email",
                            "post"
                        ],
                        "description": "Rechnungsversand per E-Mail oder Post"
                    },
                    "tags": {
                        "type": "string",
                        "description": "Schlagwörter, durch Komma getrennt"
                    },
                    "notes": {
                        "type": "string",
                        "description": "Interne Bemerkungen"
                    },
                    "ext_ref": {
                        "type": "string",
                        "description": "Ihre Referenz im Fremdsystem (frei verwendbar, filterbar)",
                        "nullable": true
                    },
                    "archived": {
                        "type": "boolean",
                        "description": "Archiviert"
                    },
                    "dunning_stop": {
                        "type": "boolean",
                        "description": "Mahnstopp für alle Rechnungen des Kunden"
                    },
                    "dunning_stop_until": {
                        "type": "string",
                        "format": "date",
                        "description": "Mahnstopp bis (leer = unbefristet)",
                        "nullable": true
                    },
                    "dunning_stop_reason": {
                        "type": "string",
                        "description": "Grund des Mahnstopps (intern)",
                        "nullable": true
                    },
                    "addr_status": {
                        "type": "string",
                        "description": "Ergebnis der Adressprüfung (ok, suggest, invalid …) – leer = nicht geprüft",
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    },
                    "open_total": {
                        "type": "number",
                        "description": "Offener Betrag aller Rechnungen (nur in der Einzelabfrage)",
                        "nullable": true,
                        "readOnly": true
                    },
                    "contacts": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Contact"
                        },
                        "description": "Kontaktpersonen (Contact) – nur in der Einzelabfrage; beim Anlegen direkt mitgeben möglich",
                        "readOnly": true
                    }
                }
            },
            "Contact": {
                "type": "object",
                "description": "Kontaktperson",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "readOnly": true
                    },
                    "salutation": {
                        "type": "string",
                        "description": "Anrede"
                    },
                    "name": {
                        "type": "string",
                        "description": "Name"
                    },
                    "position": {
                        "type": "string",
                        "description": "Funktion"
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "description": "E-Mail"
                    },
                    "phone": {
                        "type": "string",
                        "description": "Telefon"
                    },
                    "mobile": {
                        "type": "string",
                        "description": "Mobile"
                    }
                }
            },
            "Note": {
                "type": "object",
                "description": "Notiz",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "readOnly": true
                    },
                    "note": {
                        "type": "string",
                        "description": "Text"
                    },
                    "user_id": {
                        "type": "integer",
                        "description": "Erfasst von (Benutzer)",
                        "nullable": true,
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    }
                }
            },
            "File": {
                "type": "object",
                "description": "Kundendokument",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "readOnly": true
                    },
                    "name": {
                        "type": "string",
                        "description": "Dateiname"
                    },
                    "size": {
                        "type": "integer",
                        "description": "Grösse in Bytes",
                        "readOnly": true
                    },
                    "mime": {
                        "type": "string",
                        "description": "Dateityp",
                        "readOnly": true
                    },
                    "category": {
                        "type": "string",
                        "description": "Kategorie"
                    },
                    "note": {
                        "type": "string",
                        "description": "Bemerkung",
                        "nullable": true
                    },
                    "shared": {
                        "type": "boolean",
                        "description": "Im Kundenportal sichtbar"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Abgelegt am",
                        "readOnly": true
                    }
                }
            },
            "Document": {
                "type": "object",
                "description": "Beleg",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "quote",
                            "order",
                            "delivery",
                            "invoice",
                            "credit"
                        ],
                        "description": "Belegart: Offerte, Auftragsbestätigung, Lieferschein, Rechnung, Gutschrift (Standard invoice)"
                    },
                    "number": {
                        "type": "string",
                        "description": "Belegnummer – wird beim Abschliessen vergeben",
                        "nullable": true,
                        "readOnly": true
                    },
                    "status": {
                        "type": "string",
                        "description": "draft, open, partial, paid, sent, accepted, declined, expired, installment, cancelled",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde"
                    },
                    "title": {
                        "type": "string",
                        "description": "Titel / Betreff"
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "Belegdatum (Standard heute)"
                    },
                    "due_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Fällig am bzw. gültig bis (Standard: Datum + Zahlungsfrist)"
                    },
                    "delivery_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Liefer-/Leistungsdatum",
                        "nullable": true
                    },
                    "language": {
                        "type": "string",
                        "enum": [
                            "de",
                            "fr",
                            "it",
                            "en"
                        ],
                        "description": "Sprache (Standard: Sprache des Kunden)"
                    },
                    "intro": {
                        "type": "string",
                        "description": "Einleitungstext"
                    },
                    "footer": {
                        "type": "string",
                        "description": "Schlusstext (Standard: Fusstext des Betriebs)"
                    },
                    "terms": {
                        "type": "string",
                        "description": "Konditionen",
                        "nullable": true
                    },
                    "reference": {
                        "type": "string",
                        "description": "QR-/SCOR-Referenz (Rechnungen)",
                        "nullable": true,
                        "readOnly": true
                    },
                    "currency": {
                        "type": "string",
                        "description": "Währung (CHF)",
                        "readOnly": true
                    },
                    "subtotal": {
                        "type": "number",
                        "description": "Zwischensumme",
                        "readOnly": true
                    },
                    "vat_total": {
                        "type": "number",
                        "description": "MWST",
                        "readOnly": true
                    },
                    "total": {
                        "type": "number",
                        "description": "Total",
                        "readOnly": true
                    },
                    "fees_total": {
                        "type": "number",
                        "description": "Mahngebühren",
                        "readOnly": true
                    },
                    "paid_total": {
                        "type": "number",
                        "description": "Bezahlt",
                        "readOnly": true
                    },
                    "balance": {
                        "type": "number",
                        "description": "Offener Betrag",
                        "readOnly": true
                    },
                    "dunning_level": {
                        "type": "integer",
                        "description": "Mahnstufe",
                        "readOnly": true
                    },
                    "last_dunning": {
                        "type": "string",
                        "format": "date",
                        "description": "Letzte Mahnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "dunning_stop": {
                        "type": "boolean",
                        "description": "Mahnstopp (nur Rechnungen): keine Mahnungen, keine Gebühren, keine Inkasso-Übergabe – auch bei abgeschlossenen Rechnungen änderbar"
                    },
                    "dunning_stop_until": {
                        "type": "string",
                        "format": "date",
                        "description": "Mahnstopp bis (leer = bis zur Aufhebung)",
                        "nullable": true
                    },
                    "dunning_stop_reason": {
                        "type": "string",
                        "description": "Grund des Mahnstopps (intern)",
                        "nullable": true
                    },
                    "dunning_stop_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Mahnstopp gesetzt am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "parent_id": {
                        "type": "integer",
                        "description": "Ratenplan: Hauptrechnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "origin_id": {
                        "type": "integer",
                        "description": "Erstellt aus Beleg",
                        "nullable": true,
                        "readOnly": true
                    },
                    "quote_id": {
                        "type": "integer",
                        "description": "Ursprüngliche Offerte",
                        "nullable": true,
                        "readOnly": true
                    },
                    "recurring_id": {
                        "type": "integer",
                        "description": "Aus Abo-Rechnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "sent_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Versendet am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "cancelled_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Storniert am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "signed_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Offerte online unterschrieben am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "views": {
                        "type": "integer",
                        "description": "Wie oft der Kunde den Beleg abgerufen hat (Online-Link, PDF, Kundenportal)",
                        "readOnly": true
                    },
                    "first_view_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erster Abruf durch den Kunden",
                        "nullable": true,
                        "readOnly": true
                    },
                    "last_view_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Letzter Abruf durch den Kunden",
                        "nullable": true,
                        "readOnly": true
                    },
                    "ext_ref": {
                        "type": "string",
                        "description": "Ihre Referenz im Fremdsystem",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    },
                    "url": {
                        "type": "string",
                        "description": "Online-Ansicht für den Kunden (nach dem Abschliessen)",
                        "nullable": true,
                        "readOnly": true
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Item"
                        },
                        "description": "Positionen (Item) – beim Ändern werden alle Positionen ersetzt (in Listen nicht enthalten)"
                    },
                    "payments": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Payment"
                        },
                        "description": "Zahlungen (Payment) – nur in der Einzelabfrage",
                        "readOnly": true
                    }
                }
            },
            "Item": {
                "type": "object",
                "description": "Position",
                "properties": {
                    "pos": {
                        "type": "integer",
                        "description": "Reihenfolge",
                        "readOnly": true
                    },
                    "product_id": {
                        "type": "integer",
                        "description": "Artikel – fehlende Angaben (Text, Preis, Einheit, MWST) werden vom Artikel übernommen",
                        "nullable": true
                    },
                    "description": {
                        "type": "string",
                        "description": "Text (Pflicht, ausser bei product_id)"
                    },
                    "qty": {
                        "type": "number",
                        "description": "Menge (Standard 1)"
                    },
                    "unit": {
                        "type": "string",
                        "description": "Einheit, z.B. Std., Min., Stk., Pauschal – bei «Min.» ist qty in Minuten und price der Stundensatz"
                    },
                    "price": {
                        "type": "number",
                        "description": "Einzelpreis"
                    },
                    "discount": {
                        "type": "number",
                        "description": "Rabatt in Prozent"
                    },
                    "vat_rate": {
                        "type": "number",
                        "description": "MWST-Satz in Prozent (Standard: Satz des Betriebs; 0 bei nicht MWST-pflichtigen Betrieben)"
                    },
                    "total": {
                        "type": "number",
                        "description": "Positionstotal",
                        "readOnly": true
                    }
                }
            },
            "Payment": {
                "type": "object",
                "description": "Zahlung",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "document_id": {
                        "type": "integer",
                        "description": "Rechnung oder Gutschrift"
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "Zahlungsdatum (Standard heute)"
                    },
                    "amount": {
                        "type": "number",
                        "description": "Betrag (Standard: offener Betrag)"
                    },
                    "method": {
                        "type": "string",
                        "description": "Zahlungsart, z.B. Bank, Bar, TWINT (Standard API)"
                    },
                    "note": {
                        "type": "string",
                        "description": "Bemerkung"
                    },
                    "book": {
                        "type": "boolean",
                        "description": "Als Einnahme verbuchen (Standard true)"
                    }
                }
            },
            "Product": {
                "type": "object",
                "description": "Artikel",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "number": {
                        "type": "string",
                        "description": "Artikelnummer"
                    },
                    "name": {
                        "type": "string",
                        "description": "Bezeichnung"
                    },
                    "description": {
                        "type": "string",
                        "description": "Beschreibung"
                    },
                    "unit": {
                        "type": "string",
                        "description": "Einheit"
                    },
                    "price": {
                        "type": "number",
                        "description": "Preis"
                    },
                    "vat_rate": {
                        "type": "number",
                        "description": "MWST-Satz in Prozent"
                    },
                    "type": {
                        "type": "string",
                        "description": "product (Ware) oder service (Dienstleistung)"
                    },
                    "account_no": {
                        "type": "string",
                        "description": "Erlöskonto",
                        "nullable": true
                    },
                    "active": {
                        "type": "boolean",
                        "description": "In Belegen auswählbar"
                    },
                    "shop": {
                        "type": "boolean",
                        "description": "Im Online-Shop angeboten"
                    },
                    "shop_text": {
                        "type": "string",
                        "description": "Text im Online-Shop",
                        "nullable": true
                    },
                    "ext_ref": {
                        "type": "string",
                        "description": "Ihre Referenz im Fremdsystem",
                        "nullable": true
                    }
                }
            },
            "Recurring": {
                "type": "object",
                "description": "Abo-Rechnung",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde"
                    },
                    "title": {
                        "type": "string",
                        "description": "Titel"
                    },
                    "intv": {
                        "type": "string",
                        "enum": [
                            "month",
                            "quarter",
                            "halfyear",
                            "year"
                        ],
                        "description": "Intervall (Standard month)"
                    },
                    "next_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Nächste Rechnung am (Standard heute)"
                    },
                    "end_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Endet am",
                        "nullable": true
                    },
                    "auto_send": {
                        "type": "boolean",
                        "description": "Automatisch versenden (Standard true)"
                    },
                    "auto_charge": {
                        "type": "integer",
                        "description": "Automatische Abbuchung vom hinterlegten Zahlungsmittel: 0 = nein, 1 = am Rechnungsdatum, 2 = am Fälligkeitsdatum"
                    },
                    "active": {
                        "type": "boolean",
                        "description": "Aktiv"
                    },
                    "intro": {
                        "type": "string",
                        "description": "Einleitungstext (Platzhalter {periode})"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Item"
                        },
                        "description": "Positionen (Item)"
                    },
                    "last_run_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Letzte Rechnung erstellt am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    }
                }
            },
            "Project": {
                "type": "object",
                "description": "Projekt",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "nullable": true
                    },
                    "name": {
                        "type": "string",
                        "description": "Projektname"
                    },
                    "rate": {
                        "type": "number",
                        "description": "Stundensatz"
                    },
                    "budget_hours": {
                        "type": "number",
                        "description": "Budget in Stunden"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "done",
                            "archived"
                        ],
                        "description": "Status"
                    },
                    "hours_total": {
                        "type": "number",
                        "description": "Erfasste Stunden",
                        "readOnly": true
                    },
                    "hours_open": {
                        "type": "number",
                        "description": "Verrechenbare, noch nicht verrechnete Stunden",
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    }
                }
            },
            "TimeEntry": {
                "type": "object",
                "description": "Zeiteintrag",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "project_id": {
                        "type": "integer",
                        "description": "Projekt"
                    },
                    "user_id": {
                        "type": "integer",
                        "description": "Benutzer (Standard: Ersteller des API-Schlüssels)",
                        "nullable": true
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "Datum (Standard heute)"
                    },
                    "hours": {
                        "type": "number",
                        "description": "Stunden"
                    },
                    "description": {
                        "type": "string",
                        "description": "Tätigkeit"
                    },
                    "billable": {
                        "type": "boolean",
                        "description": "Verrechenbar (Standard true)"
                    },
                    "invoice_id": {
                        "type": "integer",
                        "description": "Verrechnet mit Rechnung",
                        "nullable": true,
                        "readOnly": true
                    }
                }
            },
            "Transaction": {
                "type": "object",
                "description": "Buchung",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "income",
                            "expense"
                        ],
                        "description": "Einnahme oder Ausgabe"
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "description": "Datum (Standard heute)"
                    },
                    "description": {
                        "type": "string",
                        "description": "Text"
                    },
                    "category": {
                        "type": "string",
                        "description": "Kategorie (siehe /categories)"
                    },
                    "amount": {
                        "type": "number",
                        "description": "Betrag inkl. MWST"
                    },
                    "vat_rate": {
                        "type": "number",
                        "description": "MWST-Satz in Prozent"
                    },
                    "vat_amount": {
                        "type": "number",
                        "description": "Darin enthaltene MWST",
                        "readOnly": true
                    },
                    "document_id": {
                        "type": "integer",
                        "description": "Zu Beleg (automatische Buchung einer Zahlung)",
                        "nullable": true,
                        "readOnly": true
                    },
                    "payment_id": {
                        "type": "integer",
                        "description": "Zu Zahlung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "status": {
                        "type": "string",
                        "description": "booked = verbucht, open = offene Lieferantenrechnung",
                        "readOnly": true
                    },
                    "tags": {
                        "type": "string",
                        "description": "Schlagwörter",
                        "nullable": true
                    },
                    "account_no": {
                        "type": "string",
                        "description": "Konto",
                        "nullable": true
                    },
                    "currency": {
                        "type": "string",
                        "description": "Währung",
                        "readOnly": true
                    },
                    "has_receipt": {
                        "type": "boolean",
                        "description": "Beleg (PDF/Bild) vorhanden",
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    }
                }
            },
            "Bill": {
                "type": "object",
                "description": "Lieferantenrechnung",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "supplier": {
                        "type": "string",
                        "description": "Lieferant"
                    },
                    "supplier_address": {
                        "type": "string",
                        "description": "Adresse des Lieferanten"
                    },
                    "supplier_iban": {
                        "type": "string",
                        "description": "IBAN des Lieferanten (für den Zahlungsauftrag)"
                    },
                    "pay_reference": {
                        "type": "string",
                        "description": "QR-/SCOR-Referenz"
                    },
                    "pay_message": {
                        "type": "string",
                        "description": "Mitteilung"
                    },
                    "bill_no": {
                        "type": "string",
                        "description": "Rechnungsnummer des Lieferanten"
                    },
                    "bill_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Rechnungsdatum (Standard heute)"
                    },
                    "due_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Fällig am (Standard +30 Tage)"
                    },
                    "currency": {
                        "type": "string",
                        "enum": [
                            "CHF",
                            "EUR"
                        ],
                        "description": "Währung"
                    },
                    "amount": {
                        "type": "number",
                        "description": "Betrag inkl. MWST"
                    },
                    "vat_rate": {
                        "type": "number",
                        "description": "MWST-Satz (Vorsteuer)"
                    },
                    "vat_amount": {
                        "type": "number",
                        "description": "Darin enthaltene MWST",
                        "readOnly": true
                    },
                    "category": {
                        "type": "string",
                        "description": "Kategorie (Standard Fremdleistungen)"
                    },
                    "description": {
                        "type": "string",
                        "description": "Text"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "booked"
                        ],
                        "description": "open = offen, booked = bezahlt/verbucht",
                        "readOnly": true
                    },
                    "paid_at": {
                        "type": "string",
                        "format": "date",
                        "description": "Bezahlt am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "has_receipt": {
                        "type": "boolean",
                        "description": "Beleg (PDF/Bild) vorhanden",
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    }
                }
            },
            "Category": {
                "type": "object",
                "description": "Kategorie",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "income",
                            "expense"
                        ],
                        "description": "Einnahmen oder Ausgaben"
                    },
                    "name": {
                        "type": "string",
                        "description": "Bezeichnung"
                    },
                    "account_no": {
                        "type": "string",
                        "description": "Konto",
                        "nullable": true
                    },
                    "vat_rate": {
                        "type": "number",
                        "description": "Standard-MWST-Satz",
                        "nullable": true
                    }
                }
            },
            "Request": {
                "type": "object",
                "description": "Kundenanfrage",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "number": {
                        "type": "string",
                        "description": "Anfrage-Nummer (A-00001)",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde"
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "question",
                            "invoice",
                            "change",
                            "service",
                            "installment",
                            "cancel",
                            "sim_lost",
                            "hosting_change"
                        ],
                        "description": "Art der Anfrage (Standard question)"
                    },
                    "subject": {
                        "type": "string",
                        "description": "Betreff"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "progress",
                            "answered",
                            "done",
                            "rejected"
                        ],
                        "description": "Status"
                    },
                    "ref": {
                        "type": "string",
                        "description": "Bezug (z.B. Beleg)",
                        "nullable": true,
                        "readOnly": true
                    },
                    "last_from": {
                        "type": "string",
                        "description": "Letzte Nachricht von customer oder staff",
                        "nullable": true,
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Eröffnet am",
                        "readOnly": true
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Zuletzt geändert",
                        "nullable": true,
                        "readOnly": true
                    },
                    "closed_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Abgeschlossen am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "messages": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Message"
                        },
                        "description": "Nachrichten (Message) – nur in der Einzelabfrage",
                        "readOnly": true
                    }
                }
            },
            "Message": {
                "type": "object",
                "description": "Nachricht",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "sender": {
                        "type": "string",
                        "description": "customer oder staff",
                        "readOnly": true
                    },
                    "author": {
                        "type": "string",
                        "description": "Name",
                        "readOnly": true
                    },
                    "text": {
                        "type": "string",
                        "description": "Nachricht"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Zeitpunkt",
                        "readOnly": true
                    }
                }
            },
            "Dunning": {
                "type": "object",
                "description": "Mahnung",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "document_id": {
                        "type": "integer",
                        "description": "Rechnung",
                        "readOnly": true
                    },
                    "level": {
                        "type": "integer",
                        "description": "Mahnstufe",
                        "readOnly": true
                    },
                    "fee": {
                        "type": "number",
                        "description": "Gebühr",
                        "readOnly": true
                    },
                    "sent_to": {
                        "type": "string",
                        "description": "Versendet an",
                        "nullable": true,
                        "readOnly": true
                    },
                    "sent_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Versendet am",
                        "readOnly": true
                    }
                }
            },
            "Sim": {
                "type": "object",
                "description": "SIM-Karte",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "iccid": {
                        "type": "string",
                        "description": "ICCID",
                        "readOnly": true
                    },
                    "msisdn": {
                        "type": "string",
                        "description": "Rufnummer",
                        "nullable": true,
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "nullable": true,
                        "readOnly": true
                    },
                    "sim_type": {
                        "type": "string",
                        "description": "SIM oder eSIM",
                        "nullable": true,
                        "readOnly": true
                    },
                    "sim_alias": {
                        "type": "string",
                        "description": "Bezeichnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "state": {
                        "type": "string",
                        "description": "Zustand",
                        "nullable": true,
                        "readOnly": true
                    },
                    "subscription_status": {
                        "type": "string",
                        "description": "Status beim Anbieter",
                        "nullable": true,
                        "readOnly": true
                    },
                    "assigned_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Zugewiesen am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "shipped_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Versendet am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "gone": {
                        "type": "boolean",
                        "description": "Nicht mehr vorhanden",
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    }
                }
            },
            "MobileSub": {
                "type": "object",
                "description": "Mobile-Abo",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "readOnly": true
                    },
                    "sim_id": {
                        "type": "integer",
                        "description": "SIM-Karte",
                        "nullable": true,
                        "readOnly": true
                    },
                    "product_id": {
                        "type": "integer",
                        "description": "Abo-Produkt",
                        "nullable": true,
                        "readOnly": true
                    },
                    "kind": {
                        "type": "string",
                        "description": "Art",
                        "readOnly": true
                    },
                    "price": {
                        "type": "number",
                        "description": "Preis",
                        "readOnly": true
                    },
                    "cycle": {
                        "type": "string",
                        "description": "Abrechnung",
                        "readOnly": true
                    },
                    "start_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Beginn",
                        "nullable": true,
                        "readOnly": true
                    },
                    "paid_until": {
                        "type": "string",
                        "format": "date",
                        "description": "Bezahlt bis",
                        "nullable": true,
                        "readOnly": true
                    },
                    "autorenew": {
                        "type": "boolean",
                        "description": "Automatische Verlängerung",
                        "readOnly": true
                    },
                    "status": {
                        "type": "string",
                        "description": "Status",
                        "readOnly": true
                    },
                    "cancel_effective": {
                        "type": "string",
                        "format": "date",
                        "description": "Gekündigt auf",
                        "nullable": true,
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    }
                }
            },
            "MobileProduct": {
                "type": "object",
                "description": "Mobile-Produkt",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "name": {
                        "type": "string",
                        "description": "Bezeichnung",
                        "readOnly": true
                    },
                    "description": {
                        "type": "string",
                        "description": "Beschreibung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "kind": {
                        "type": "string",
                        "description": "Art",
                        "readOnly": true
                    },
                    "price": {
                        "type": "number",
                        "description": "Preis",
                        "readOnly": true
                    },
                    "cycle": {
                        "type": "string",
                        "description": "Abrechnung",
                        "readOnly": true
                    },
                    "setup_fee": {
                        "type": "number",
                        "description": "Einrichtung",
                        "readOnly": true
                    },
                    "vat_rate": {
                        "type": "number",
                        "description": "MWST-Satz",
                        "readOnly": true
                    },
                    "portal": {
                        "type": "boolean",
                        "description": "Im Kundenportal bestellbar",
                        "readOnly": true
                    },
                    "esim": {
                        "type": "boolean",
                        "description": "eSIM möglich",
                        "readOnly": true
                    },
                    "active": {
                        "type": "boolean",
                        "description": "Aktiv",
                        "readOnly": true
                    }
                }
            },
            "HostingAccount": {
                "type": "object",
                "description": "Hosting-Konto",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "readOnly": true
                    },
                    "product_id": {
                        "type": "integer",
                        "description": "Hosting-Paket",
                        "nullable": true,
                        "readOnly": true
                    },
                    "username": {
                        "type": "string",
                        "description": "Benutzername",
                        "nullable": true,
                        "readOnly": true
                    },
                    "domain": {
                        "type": "string",
                        "description": "Hauptdomain",
                        "nullable": true,
                        "readOnly": true
                    },
                    "status": {
                        "type": "string",
                        "description": "Status",
                        "readOnly": true
                    },
                    "cycle": {
                        "type": "string",
                        "description": "Abrechnung",
                        "readOnly": true
                    },
                    "price": {
                        "type": "number",
                        "description": "Preis",
                        "readOnly": true
                    },
                    "start_date": {
                        "type": "string",
                        "format": "date",
                        "description": "Beginn",
                        "nullable": true,
                        "readOnly": true
                    },
                    "cancel_effective": {
                        "type": "string",
                        "format": "date",
                        "description": "Gekündigt auf",
                        "nullable": true,
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    },
                    "activated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Aktiviert am",
                        "nullable": true,
                        "readOnly": true
                    }
                }
            },
            "HostingProduct": {
                "type": "object",
                "description": "Hosting-Paket",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "name": {
                        "type": "string",
                        "description": "Bezeichnung",
                        "readOnly": true
                    },
                    "description": {
                        "type": "string",
                        "description": "Beschreibung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "price_month": {
                        "type": "number",
                        "description": "Preis pro Monat",
                        "readOnly": true
                    },
                    "price_year": {
                        "type": "number",
                        "description": "Preis pro Jahr",
                        "readOnly": true
                    },
                    "setup_fee": {
                        "type": "number",
                        "description": "Einrichtung",
                        "readOnly": true
                    },
                    "vat_rate": {
                        "type": "number",
                        "description": "MWST-Satz",
                        "readOnly": true
                    },
                    "orderable": {
                        "type": "boolean",
                        "description": "Bestellbar",
                        "readOnly": true
                    },
                    "active": {
                        "type": "boolean",
                        "description": "Aktiv",
                        "readOnly": true
                    }
                }
            },
            "WebService": {
                "type": "object",
                "description": "Web-Dienst",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "nullable": true,
                        "readOnly": true
                    },
                    "name": {
                        "type": "string",
                        "description": "Bezeichnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "fqdn": {
                        "type": "string",
                        "description": "Domain",
                        "nullable": true,
                        "readOnly": true
                    },
                    "service_name": {
                        "type": "string",
                        "description": "Art (domain, email, hosting …)",
                        "nullable": true,
                        "readOnly": true
                    },
                    "status": {
                        "type": "string",
                        "description": "Status",
                        "nullable": true,
                        "readOnly": true
                    },
                    "expired_at": {
                        "type": "string",
                        "format": "date",
                        "description": "Läuft ab am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "price": {
                        "type": "number",
                        "description": "Verkaufspreis",
                        "nullable": true,
                        "readOnly": true
                    },
                    "cycle": {
                        "type": "string",
                        "description": "Abrechnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "vat_rate": {
                        "type": "number",
                        "description": "MWST-Satz",
                        "nullable": true,
                        "readOnly": true
                    },
                    "recurring_id": {
                        "type": "integer",
                        "description": "Abo-Rechnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "gone": {
                        "type": "boolean",
                        "description": "Nicht mehr vorhanden",
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    }
                }
            },
            "CloudServer": {
                "type": "object",
                "description": "Cloud-Server",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "nullable": true,
                        "readOnly": true
                    },
                    "name": {
                        "type": "string",
                        "description": "Name",
                        "readOnly": true
                    },
                    "server_type": {
                        "type": "string",
                        "description": "Servertyp",
                        "nullable": true,
                        "readOnly": true
                    },
                    "location": {
                        "type": "string",
                        "description": "Standort",
                        "nullable": true,
                        "readOnly": true
                    },
                    "image": {
                        "type": "string",
                        "description": "Betriebssystem",
                        "nullable": true,
                        "readOnly": true
                    },
                    "ipv4": {
                        "type": "string",
                        "description": "IPv4",
                        "nullable": true,
                        "readOnly": true
                    },
                    "ipv6": {
                        "type": "string",
                        "description": "IPv6",
                        "nullable": true,
                        "readOnly": true
                    },
                    "status": {
                        "type": "string",
                        "description": "Status",
                        "nullable": true,
                        "readOnly": true
                    },
                    "backup": {
                        "type": "boolean",
                        "description": "Backups aktiv",
                        "readOnly": true
                    },
                    "price": {
                        "type": "number",
                        "description": "Verkaufspreis",
                        "nullable": true,
                        "readOnly": true
                    },
                    "billing": {
                        "type": "string",
                        "description": "Abrechnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "paid_until": {
                        "type": "string",
                        "format": "date",
                        "description": "Bezahlt bis",
                        "nullable": true,
                        "readOnly": true
                    },
                    "autorenew": {
                        "type": "boolean",
                        "description": "Automatische Verlängerung",
                        "readOnly": true
                    },
                    "suspended": {
                        "type": "boolean",
                        "description": "Gesperrt",
                        "readOnly": true
                    },
                    "cancel_at": {
                        "type": "string",
                        "format": "date",
                        "description": "Kündigung auf",
                        "nullable": true,
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    }
                }
            },
            "ShopOrder": {
                "type": "object",
                "description": "Shop-Bestellung",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "number": {
                        "type": "string",
                        "description": "Bestellnummer",
                        "nullable": true,
                        "readOnly": true
                    },
                    "customer_id": {
                        "type": "integer",
                        "description": "Kunde",
                        "readOnly": true
                    },
                    "status": {
                        "type": "string",
                        "description": "new, awaiting_payment, payment_failed, review, processing, done, error, rejected, cancelled",
                        "readOnly": true
                    },
                    "net": {
                        "type": "number",
                        "description": "Netto",
                        "readOnly": true
                    },
                    "total": {
                        "type": "number",
                        "description": "Total",
                        "readOnly": true
                    },
                    "document_id": {
                        "type": "integer",
                        "description": "Rechnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "paid_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Bezahlt am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "approved_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Freigegeben am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "rejected_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Abgelehnt am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "done_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Ausgeführt am",
                        "nullable": true,
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Bestellt am",
                        "readOnly": true
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ShopItem"
                        },
                        "description": "Positionen (ShopItem)",
                        "readOnly": true
                    }
                }
            },
            "ShopItem": {
                "type": "object",
                "description": "Bestellposition",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "source": {
                        "type": "string",
                        "description": "Herkunft (products, hosting, dienste, cloud, telecom …)",
                        "readOnly": true
                    },
                    "ref": {
                        "type": "string",
                        "description": "Referenz",
                        "nullable": true,
                        "readOnly": true
                    },
                    "title": {
                        "type": "string",
                        "description": "Bezeichnung",
                        "readOnly": true
                    },
                    "qty": {
                        "type": "number",
                        "description": "Menge",
                        "readOnly": true
                    },
                    "net": {
                        "type": "number",
                        "description": "Netto",
                        "readOnly": true
                    },
                    "cycle": {
                        "type": "string",
                        "description": "Abrechnung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "status": {
                        "type": "string",
                        "description": "pending, done, manual, waiting, error, cancelled",
                        "readOnly": true
                    },
                    "done_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erledigt am",
                        "nullable": true,
                        "readOnly": true
                    }
                }
            },
            "Webhook": {
                "type": "object",
                "description": "Webhook",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "url": {
                        "type": "string",
                        "description": "Empfänger-Adresse (https://…)"
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Ereignisse, z.B. [\"document.paid\"] – leer oder [\"*\"] = alle"
                    },
                    "description": {
                        "type": "string",
                        "description": "Bezeichnung",
                        "nullable": true
                    },
                    "active": {
                        "type": "boolean",
                        "description": "Aktiv"
                    },
                    "fails": {
                        "type": "integer",
                        "description": "Fehlversuche in Folge",
                        "readOnly": true
                    },
                    "last_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Letzte Zustellung",
                        "nullable": true,
                        "readOnly": true
                    },
                    "last_status": {
                        "type": "integer",
                        "description": "Letzter HTTP-Status",
                        "nullable": true,
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Erfasst am",
                        "readOnly": true
                    },
                    "secret": {
                        "type": "string",
                        "description": "Signatur-Geheimnis – nur in der Antwort beim Anlegen sichtbar",
                        "readOnly": true
                    }
                }
            },
            "Delivery": {
                "type": "object",
                "description": "Webhook-Zustellung",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Interne ID",
                        "readOnly": true
                    },
                    "event": {
                        "type": "string",
                        "description": "Ereignis",
                        "readOnly": true
                    },
                    "status": {
                        "type": "string",
                        "description": "pending, done, failed",
                        "readOnly": true
                    },
                    "attempts": {
                        "type": "integer",
                        "description": "Versuche",
                        "readOnly": true
                    },
                    "next_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Nächster Versuch",
                        "nullable": true,
                        "readOnly": true
                    },
                    "last_code": {
                        "type": "integer",
                        "description": "Letzter HTTP-Status",
                        "nullable": true,
                        "readOnly": true
                    },
                    "last_error": {
                        "type": "string",
                        "description": "Letzter Fehler",
                        "nullable": true,
                        "readOnly": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Ausgelöst am",
                        "readOnly": true
                    },
                    "done_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Zugestellt am",
                        "nullable": true,
                        "readOnly": true
                    }
                }
            },
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "string",
                                "example": "validation_failed"
                            },
                            "message": {
                                "type": "string"
                            },
                            "details": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "string"
                                }
                            },
                            "request_id": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "ListMeta": {
                "type": "object",
                "properties": {
                    "total": {
                        "type": "integer"
                    },
                    "limit": {
                        "type": "integer"
                    },
                    "offset": {
                        "type": "integer"
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            }
        },
        "responses": {
            "BadRequest": {
                "description": "Ungültige Anfrage (z.B. kein gültiges JSON)",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Unauthorized": {
                "description": "API-Schlüssel fehlt, ist ungültig oder abgelaufen",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "Keine Berechtigung (nur lesen, Bereich nicht freigegeben, Modul nicht im Abo, IP nicht freigegeben)",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "NotFound": {
                "description": "Nicht gefunden",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Conflict": {
                "description": "Konflikt mit dem aktuellen Zustand (z.B. Beleg bereits abgeschlossen, Nummer vergeben)",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Unprocessable": {
                "description": "Validierungsfehler – details nennt die Felder",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "TooMany": {
                "description": "Rate-Limit überschritten – Header Retry-After beachten",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        }
    }
}