{
  "openapi": "3.1.0",
  "info": {
    "title": "Summator REST-Referenz",
    "version": "2026-11-07",
    "description": "Vollständige REST-Referenz von Summator. Die API liegt auf der Domain deiner Firma unter /api/v1. Zugang und erste Schritte stehen auf der Seite API-Referenz von summator.de."
  },
  "servers": [
    {
      "url": "{tenantOrigin}",
      "variables": {
        "tenantOrigin": {
          "default": "https://integrator.summator.example",
          "description": "Adresse deiner Firma, nicht die zentrale Anmeldung."
        }
      }
    }
  ],
  "security": [
    {
      "sanctum": []
    }
  ],
  "paths": {
    "/api/v1/partners": {
      "post": {
        "operationId": "post_api_v1_partners",
        "summary": "Personenkonto und damit Kontakt anlegen",
        "tags": [
          "partners"
        ],
        "responses": {
          "201": {
            "description": "Personenkonto und damit Kontakt anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Partner"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben oder Kontonummer",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 200
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "debtor",
                      "creditor"
                    ]
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 10000,
                        "maximum": 99999
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "kind"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "x-idempotency": {
          "operation": "partner.create",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      },
      "get": {
        "operationId": "get_api_v1_partners",
        "summary": "Personenkonten suchen",
        "tags": [
          "partners"
        ],
        "responses": {
          "200": {
            "description": "Personenkonten suchen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "number": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "personal_kind": {
                            "type": "string",
                            "enum": [
                              "debtor",
                              "creditor"
                            ]
                          },
                          "type": {
                            "type": "string"
                          },
                          "is_active": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "number",
                          "name",
                          "personal_kind",
                          "type",
                          "is_active"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "debtor",
                "creditor"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ]
      }
    },
    "/api/v1/contacts": {
      "get": {
        "operationId": "get_api_v1_contacts",
        "summary": "Kontakte mit offenen Beträgen suchen",
        "tags": [
          "contacts"
        ],
        "responses": {
          "200": {
            "description": "Kontakte mit offenen Beträgen suchen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "number": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "debtor",
                              "creditor"
                            ]
                          },
                          "is_active": {
                            "type": "boolean"
                          },
                          "street": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "postal_code": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "city": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "email": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "vat_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "buyer_reference": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "note": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "country": {
                            "type": "string"
                          },
                          "intro_text_id": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "closing_text_id": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "open_cents": {
                            "type": "integer",
                            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                          },
                          "laut_rechnung_bezahlt_cents": {
                            "type": "integer",
                            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                          }
                        },
                        "required": [
                          "id",
                          "number",
                          "name",
                          "kind",
                          "is_active",
                          "street",
                          "postal_code",
                          "city",
                          "email",
                          "vat_id",
                          "buyer_reference",
                          "note",
                          "country",
                          "intro_text_id",
                          "closing_text_id",
                          "open_cents",
                          "laut_rechnung_bezahlt_cents"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "debtor",
                "creditor"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ]
      }
    },
    "/api/v1/contacts/{id}": {
      "patch": {
        "operationId": "patch_api_v1_contacts_id",
        "summary": "Angegebene Kontaktfelder ändern",
        "tags": [
          "contacts"
        ],
        "responses": {
          "200": {
            "description": "Angegebene Kontaktfelder ändern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Contact"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Kein Personenkonto",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder ungeeignete Textvorgabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 200
                  },
                  "street": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postal_code": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "email",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "buyer_reference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "note": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "intro_text_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "closing_text_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      },
      "get": {
        "operationId": "get_api_v1_contacts_id",
        "summary": "Kontakt einschließlich Rechnungen, Buchungen und Preisverlauf lesen",
        "tags": [
          "contacts"
        ],
        "responses": {
          "200": {
            "description": "Kontakt einschließlich Rechnungen, Buchungen und Preisverlauf lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "number": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "debtor",
                            "creditor"
                          ]
                        },
                        "is_active": {
                          "type": "boolean"
                        },
                        "street": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "postal_code": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "city": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "vat_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "buyer_reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "country": {
                          "type": "string"
                        },
                        "intro_text_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "closing_text_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "open_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "laut_rechnung_bezahlt_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "open_items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/OpenItem"
                          }
                        },
                        "invoices": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "number": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "status": {
                                "type": "string"
                              },
                              "invoice_date": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "gross_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              }
                            },
                            "required": [
                              "id",
                              "number",
                              "status",
                              "invoice_date",
                              "gross_cents"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "entries": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "journal_entry_id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "entry_number": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "status": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "booking_date": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "description": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "debit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              },
                              "credit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              }
                            },
                            "required": [
                              "journal_entry_id",
                              "entry_number",
                              "status",
                              "booking_date",
                              "description",
                              "debit_cents",
                              "credit_cents"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "prices": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "article_id": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "label": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "unit": {
                                "type": "string"
                              },
                              "current_cents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "history": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "valid_from": {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    "amount_cents": {
                                      "type": "integer",
                                      "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                    },
                                    "note": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "valid_from",
                                    "amount_cents",
                                    "note"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "article_id",
                              "label",
                              "unit",
                              "current_cents",
                              "history"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "number",
                        "name",
                        "kind",
                        "is_active",
                        "street",
                        "postal_code",
                        "city",
                        "email",
                        "vat_id",
                        "buyer_reference",
                        "note",
                        "country",
                        "intro_text_id",
                        "closing_text_id",
                        "open_cents",
                        "laut_rechnung_bezahlt_cents",
                        "open_items",
                        "invoices",
                        "entries",
                        "prices"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Kein Personenkonto",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/invoices": {
      "get": {
        "operationId": "get_api_v1_invoices",
        "summary": "Rechnungen seitenweise lesen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Rechnungen seitenweise lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InvoiceSummary"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 25
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_invoices",
        "summary": "Unnummerierten Rechnungsentwurf anlegen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "201": {
            "description": "Unnummerierten Rechnungsentwurf anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Keine Nummer, kein Original und keine Journalbuchung. Für Kontakte zuerst POST /partners und PATCH /contacts/{id}. Kreditkorrekturen entstehen ausschließlich über reverse. Ein Entwurf darf unvollständig sein; missing vor Ausstellung lesen. Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "x-idempotency": {
          "operation": "invoice.create",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/invoices/{id}": {
      "get": {
        "operationId": "get_api_v1_invoices_id",
        "summary": "Rechnung einschließlich Positionen und Hinweisen lesen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Rechnung einschließlich Positionen und Hinweisen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "put": {
        "operationId": "put_api_v1_invoices_id",
        "summary": "Angegebene Entwurfsfelder ändern; lines ersetzt alle Positionen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Angegebene Entwurfsfelder ändern; lines ersetzt alle Positionen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ausgestellt, ungültige Angaben oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceUpdate"
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      },
      "patch": {
        "operationId": "patch_api_v1_invoices_id",
        "summary": "Angegebene Entwurfsfelder ändern; lines ersetzt alle Positionen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Angegebene Entwurfsfelder ändern; lines ersetzt alle Positionen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ausgestellt, ungültige Angaben oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceUpdate"
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      },
      "delete": {
        "operationId": "delete_api_v1_invoices_id",
        "summary": "Nur Rechnungsentwurf bewusst verwerfen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Nur Rechnungsentwurf bewusst verwerfen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ausgestellte Rechnung bleibt erhalten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/invoices/{id}/issue": {
      "post": {
        "operationId": "post_api_v1_invoices_id_issue",
        "summary": "Bewusst endgültig ausstellen: Nummer, Original und Buchung",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Bewusst endgültig ausstellen: Nummer, Original und Buchung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Pflichtangaben, veralteter Entwurf, geschlossener Zeitraum oder period-Bestätigung erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Endgültige Wirkung. expected_draft_hash aus dem zuletzt geprüften GET senden. Abgelaufene Voranmeldungsperiode liefert 422 mit period; nur nach bewusster Zustimmung erneut confirm_past_period=true. Ein geschlossener Zeitraum wird dadurch nicht geöffnet.  Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirm_past_period": {
                    "type": "boolean"
                  },
                  "expected_draft_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "x-idempotency": {
          "operation": "invoice.issue",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/invoices/{id}/reverse": {
      "post": {
        "operationId": "post_api_v1_invoices_id_reverse",
        "summary": "Korrekturrechnung zur ausgestellten Rechnung erzeugen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "201": {
            "description": "Korrekturrechnung zur ausgestellten Rechnung erzeugen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Korrektur nicht zulässig",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden. Die Korrektur mindert die Voranmeldung sofort. Wurde die Leistung gar nicht ausgeführt, kann die Steuer geschuldet bleiben, bis das Finanzamt dem schriftlichen Antrag zugestimmt hat (§ 14c Abs. 2 UStG).",
        "x-idempotency": {
          "operation": "invoice.reverse",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/invoices/{id}/settle": {
      "post": {
        "operationId": "post_api_v1_invoices_id_settle",
        "summary": "Laut Rechnung bezahlte Forderung bewusst nachbuchen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "201": {
            "description": "Laut Rechnung bezahlte Forderung bewusst nachbuchen",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Invoice"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "settlement": {
                          "type": "object",
                          "properties": {
                            "journal_entry_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "entry_number": {
                              "type": "string"
                            },
                            "booking_date": {
                              "type": "string",
                              "format": "date"
                            },
                            "amount_cents": {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            "clearing_account_id": {
                              "type": "integer",
                              "minimum": 1
                            }
                          },
                          "required": [
                            "journal_entry_id",
                            "entry_number",
                            "booking_date",
                            "amount_cents",
                            "clearing_account_id"
                          ],
                          "additionalProperties": false
                        },
                        "setup": {
                          "type": "object",
                          "properties": {
                            "complete": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "missing": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "complete",
                            "message",
                            "missing"
                          ],
                          "additionalProperties": false
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "overdue",
                                "payment_failed"
                              ]
                            },
                            "can_write": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "due_by": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "amount_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reference": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "transfer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "status",
                            "can_write",
                            "message",
                            "due_by",
                            "amount_cents",
                            "reference",
                            "transfer"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "settlement"
                      ]
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Periodenbestätigung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clearing_account_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "booking_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "confirm_past_period": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "clearing_account_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "x-idempotency": {
          "operation": "invoice.settle",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/invoices/{id}/file": {
      "get": {
        "operationId": "get_api_v1_invoices_id_file",
        "summary": "Exakt gespeichertes Original oder eingebettetes CII herunterladen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Exakt gespeichertes Original oder eingebettetes CII herunterladen",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entwurf, Datei fehlt oder Prüfsumme falsch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "xml"
              ]
            },
            "description": "Ohne xml: gespeichertes PDF oder historisches XML; xml: exakter eingebetteter CII-Datensatz."
          }
        ]
      }
    },
    "/api/v1/accounts": {
      "get": {
        "operationId": "get_api_v1_accounts",
        "summary": "Aktive Konten suchen; vollständige Seitenzahl beachten",
        "tags": [
          "accounts"
        ],
        "responses": {
          "200": {
            "description": "Aktive Konten suchen; vollständige Seitenzahl beachten",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Account"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer"
                        },
                        "per_page": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "page",
                        "per_page",
                        "total",
                        "pages"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "chart",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "common",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "default": 100
            },
            "description": "Für eine gültige Seite 1 bis 500 senden."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_accounts",
        "summary": "Eigenes Sachkonto im Mandantenrahmen anlegen",
        "tags": [
          "accounts"
        ],
        "responses": {
          "201": {
            "description": "Eigenes Sachkonto im Mandantenrahmen anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "number": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "chart": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "number",
                        "name",
                        "type",
                        "chart"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "10000–99999 für Kontakte reserviert. Template-Art muss passen, BANK-Konten über Bankablauf. Kennziffer: revenue 21/41/43/45/48, asset 62; nur meldepflichtig. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "type": "string",
                    "pattern": "^[0-9]+$",
                    "maxLength": 16
                  },
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 200
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "asset",
                      "liability",
                      "equity",
                      "revenue",
                      "expense"
                    ]
                  },
                  "category": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_box": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[0-9]{2,3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_reportable": {
                    "type": "boolean"
                  },
                  "chart": {
                    "type": "string",
                    "enum": [
                      "SKR03",
                      "SKR04"
                    ]
                  }
                },
                "required": [
                  "number",
                  "name",
                  "type"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/tax-keys": {
      "get": {
        "operationId": "get_api_v1_tax_keys",
        "summary": "Aktive Steuerschlüssel lesen",
        "tags": [
          "tax-keys"
        ],
        "responses": {
          "200": {
            "description": "Aktive Steuerschlüssel lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TaxKey"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      }
    },
    "/api/v1/anmelden": {
      "post": {
        "operationId": "post_api_v1_anmelden",
        "summary": "Zentrale Passwortanmeldung und Mandantenwahl",
        "tags": [
          "anmelden"
        ],
        "responses": {
          "200": {
            "description": "Zentrale Passwortanmeldung und Mandantenwahl",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "mandanten": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "mandanten"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "mandant": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        "api": {
                          "type": "string",
                          "format": "uri"
                        },
                        "handoff": {
                          "type": "string"
                        },
                        "zwei_faktor": {
                          "type": "object",
                          "properties": {
                            "erforderlich": {
                              "const": true
                            },
                            "eingerichtet": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "erforderlich",
                            "eingerichtet"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "mandant",
                        "api",
                        "handoff",
                        "zwei_faktor"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Zugangsdaten falsch oder zu viele Versuche",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string",
                    "writeOnly": true
                  },
                  "mandant": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "email",
                  "password"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "servers": [
          {
            "url": "{centralOrigin}",
            "variables": {
              "centralOrigin": {
                "default": "https://summator.example",
                "description": "Konfigurierte zentrale Domain, keine Mandantenadresse"
              }
            }
          }
        ]
      }
    },
    "/api/v1/token": {
      "post": {
        "operationId": "post_api_v1_token",
        "summary": "Einmaligen 60-Sekunden-Handoff plus TOTP gegen App-Token tauschen",
        "tags": [
          "token"
        ],
        "responses": {
          "201": {
            "description": "Einmaligen 60-Sekunden-Handoff plus TOTP gegen App-Token tauschen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "token"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Handoff abgelaufen, Faktor fehlt oder Code falsch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "10 je Minute/IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "handoff": {
                    "type": "string",
                    "writeOnly": true
                  },
                  "geraet": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "code": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64,
                        "writeOnly": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "handoff",
                  "geraet"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_api_v1_token",
        "summary": "Aktuell benutztes Token widerrufen",
        "tags": [
          "token"
        ],
        "responses": {
          "204": {
            "description": "Aktuell benutztes Token widerrufen"
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      }
    },
    "/api/v1/api-keys": {
      "get": {
        "operationId": "get_api_v1_api_keys",
        "summary": "Sichtbare gültige eigene Schlüssel, mit admin als Inhaber alle lesen",
        "tags": [
          "api-keys"
        ],
        "responses": {
          "200": {
            "description": "Sichtbare gültige eigene Schlüssel, mit admin als Inhaber alle lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      }
    },
    "/api/v1/api-keys/{id}": {
      "delete": {
        "operationId": "delete_api_v1_api_keys_id",
        "summary": "Sichtbaren Schlüssel widerrufen; eigenen auch mit read",
        "tags": [
          "api-keys"
        ],
        "responses": {
          "204": {
            "description": "Sichtbaren Schlüssel widerrufen; eigenen auch mit read"
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schlüssel nicht sichtbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/rates": {
      "get": {
        "operationId": "get_api_v1_rates",
        "summary": "Preishistorie lesen",
        "tags": [
          "rates"
        ],
        "responses": {
          "200": {
            "description": "Preishistorie lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rate"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "article_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_rates",
        "summary": "Neue datierte Preisvereinbarung anhängen",
        "tags": [
          "rates"
        ],
        "responses": {
          "201": {
            "description": "Neue datierte Preisvereinbarung anhängen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rate"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "article_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "label": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  "amount_cents": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "valid_from": {
                    "type": "string",
                    "format": "date"
                  },
                  "note": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "amount_cents",
                  "valid_from"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/rates/current": {
      "get": {
        "operationId": "get_api_v1_rates_current",
        "summary": "Gültigen Preis an einem Tag lesen",
        "tags": [
          "rates"
        ],
        "responses": {
          "200": {
            "description": "Gültigen Preis an einem Tag lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "rate": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Rate"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "date",
                    "rate"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "article_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "label",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "unit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ]
      }
    },
    "/api/v1/rates/{id}": {
      "delete": {
        "operationId": "delete_api_v1_rates_id",
        "summary": "Noch nicht vergangene Preisvereinbarung entfernen",
        "tags": [
          "rates"
        ],
        "responses": {
          "200": {
            "description": "Noch nicht vergangene Preisvereinbarung entfernen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Bereits gültig gewesener Preis bleibt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/articles": {
      "get": {
        "operationId": "get_api_v1_articles",
        "summary": "Artikel mit aktuellem Standardpreis suchen",
        "tags": [
          "articles"
        ],
        "responses": {
          "200": {
            "description": "Artikel mit aktuellem Standardpreis suchen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "number": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "unit": {
                            "type": "string"
                          },
                          "tax_key_id": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "revenue_account_id": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "is_active": {
                            "type": "boolean"
                          },
                          "closing_text_id": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "current_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "number",
                          "name",
                          "description",
                          "unit",
                          "tax_key_id",
                          "revenue_account_id",
                          "is_active",
                          "closing_text_id",
                          "current_cents"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "true: aktive Artikel; ohne true auch deaktivierte."
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_articles",
        "summary": "Artikel anlegen",
        "tags": [
          "articles"
        ],
        "responses": {
          "201": {
            "description": "Artikel anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Article"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  "tax_key_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "revenue_account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "closing_text_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "x-idempotency": {
          "operation": "article.create",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/articles/{id}": {
      "patch": {
        "operationId": "patch_api_v1_articles_id",
        "summary": "Angegebene Artikelstammdaten ändern",
        "tags": [
          "articles"
        ],
        "responses": {
          "200": {
            "description": "Angegebene Artikelstammdaten ändern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Article"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  "tax_key_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "revenue_account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "closing_text_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      },
      "get": {
        "operationId": "get_api_v1_articles_id",
        "summary": "Artikel mit Preis- und Verwendungshistorie lesen",
        "tags": [
          "articles"
        ],
        "responses": {
          "200": {
            "description": "Artikel mit Preis- und Verwendungshistorie lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "number": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "unit": {
                          "type": "string"
                        },
                        "tax_key_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revenue_account_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "is_active": {
                          "type": "boolean"
                        },
                        "closing_text_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "current_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "prices": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "valid_from": {
                                "type": "string",
                                "format": "date"
                              },
                              "amount_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              },
                              "note": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "valid_from",
                              "amount_cents",
                              "note"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "customer_prices": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "account_id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "account": {
                                "type": "string"
                              },
                              "current_cents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "history": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "valid_from": {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    "amount_cents": {
                                      "type": "integer",
                                      "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                    },
                                    "note": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "valid_from",
                                    "amount_cents",
                                    "note"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "account_id",
                              "account",
                              "current_cents",
                              "history"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "invoice_lines": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "invoice_id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "invoice_number": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "status": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "description": {
                                "type": "string"
                              },
                              "quantity": {
                                "type": "number"
                              },
                              "unit_price_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              }
                            },
                            "required": [
                              "invoice_id",
                              "invoice_number",
                              "status",
                              "description",
                              "quantity",
                              "unit_price_cents"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "number",
                        "name",
                        "description",
                        "unit",
                        "tax_key_id",
                        "revenue_account_id",
                        "is_active",
                        "closing_text_id",
                        "current_cents",
                        "prices",
                        "customer_prices",
                        "invoice_lines"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/closing-texts": {
      "get": {
        "operationId": "get_api_v1_closing_texts",
        "summary": "Aktive closing-Textvorlagen lesen",
        "tags": [
          "closing-texts"
        ],
        "responses": {
          "200": {
            "description": "Aktive closing-Textvorlagen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ClosingText"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Nur active=all oder weglassen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all"
              ]
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_closing_texts",
        "summary": "closing-Textvorlage speichern",
        "tags": [
          "closing-texts"
        ],
        "responses": {
          "201": {
            "description": "closing-Textvorlage speichern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClosingText"
                    },
                    "hints": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "hints"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Vorlage nicht in dieser Art",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben oder Text-/Zahlungsvorgabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Kein DELETE; is_active=false deaktiviert. kind kommt aus der Route. Einleitung erlaubt keine Zahlungsangaben; Zahlungsvorlage braucht geeignetes Gegenkonto und darf kein Standard sein. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "paid_means": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "online"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paid_via": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clearing_account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "is_default": {
                    "type": "boolean"
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "text"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/closing-texts/{id}": {
      "patch": {
        "operationId": "patch_api_v1_closing_texts_id",
        "summary": "closing-Textvorlage speichern",
        "tags": [
          "closing-texts"
        ],
        "responses": {
          "200": {
            "description": "closing-Textvorlage speichern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ClosingText"
                    },
                    "hints": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "hints"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Vorlage nicht in dieser Art",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben oder Text-/Zahlungsvorgabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Kein DELETE; is_active=false deaktiviert. kind kommt aus der Route. Einleitung erlaubt keine Zahlungsangaben; Zahlungsvorlage braucht geeignetes Gegenkonto und darf kein Standard sein. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "paid_means": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "online"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paid_via": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clearing_account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "is_default": {
                    "type": "boolean"
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/intro-texts": {
      "get": {
        "operationId": "get_api_v1_intro_texts",
        "summary": "Aktive intro-Textvorlagen lesen",
        "tags": [
          "intro-texts"
        ],
        "responses": {
          "200": {
            "description": "Aktive intro-Textvorlagen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IntroText"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Nur active=all oder weglassen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all"
              ]
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_intro_texts",
        "summary": "intro-Textvorlage speichern",
        "tags": [
          "intro-texts"
        ],
        "responses": {
          "201": {
            "description": "intro-Textvorlage speichern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IntroText"
                    },
                    "hints": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "hints"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Vorlage nicht in dieser Art",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben oder Text-/Zahlungsvorgabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Kein DELETE; is_active=false deaktiviert. kind kommt aus der Route. Einleitung erlaubt keine Zahlungsangaben; Zahlungsvorlage braucht geeignetes Gegenkonto und darf kein Standard sein. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "paid_means": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "online"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paid_via": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clearing_account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "is_default": {
                    "type": "boolean"
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "text"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/intro-texts/{id}": {
      "patch": {
        "operationId": "patch_api_v1_intro_texts_id",
        "summary": "intro-Textvorlage speichern",
        "tags": [
          "intro-texts"
        ],
        "responses": {
          "200": {
            "description": "intro-Textvorlage speichern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IntroText"
                    },
                    "hints": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "hints"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Vorlage nicht in dieser Art",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben oder Text-/Zahlungsvorgabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Kein DELETE; is_active=false deaktiviert. kind kommt aus der Route. Einleitung erlaubt keine Zahlungsangaben; Zahlungsvorlage braucht geeignetes Gegenkonto und darf kein Standard sein. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "paid_means": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "online"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paid_via": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "clearing_account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "is_default": {
                    "type": "boolean"
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/entries": {
      "get": {
        "operationId": "get_api_v1_entries",
        "summary": "Buchungen seitenweise lesen",
        "tags": [
          "entries"
        ],
        "responses": {
          "200": {
            "description": "Buchungen seitenweise lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Entry"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_entries",
        "summary": "Buchung erfassen; post=true schreibt unmittelbar fest",
        "tags": [
          "entries"
        ],
        "responses": {
          "201": {
            "description": "Buchung erfassen; post=true schreibt unmittelbar fest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Ungültig, nicht eingerichtet oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 200
                  },
                  "document_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "booking_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "post": {
                    "type": "boolean"
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "account_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "tax_key_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "side": {
                          "type": "string",
                          "enum": [
                            "debit",
                            "credit"
                          ]
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "description": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cost_center_id": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1
                        },
                        "cost_splits": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "$ref": "#/components/schemas/CostSplit89"
                          }
                        }
                      },
                      "required": [
                        "account_id",
                        "side",
                        "amount_cents"
                      ],
                      "additionalProperties": false,
                      "description": "Optional cost_center_id OR cost_splits on net revenue/expense only. Splits total calculated net cents; tax and contra remain unassigned."
                    },
                    "minItems": 1
                  },
                  "document_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                },
                "required": [
                  "description",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "x-idempotency": {
          "operation": "entry.create",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/entries/{id}": {
      "get": {
        "operationId": "get_api_v1_entries_id",
        "summary": "Buchung mit Konten und Belegverweisen lesen",
        "tags": [
          "entries"
        ],
        "responses": {
          "200": {
            "description": "Buchung mit Konten und Belegverweisen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "put": {
        "operationId": "put_api_v1_entries_id",
        "summary": "Angegebene Buchungsentwurfsfelder ändern",
        "tags": [
          "entries"
        ],
        "responses": {
          "200": {
            "description": "Angegebene Buchungsentwurfsfelder ändern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Buchung ist festgeschrieben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung/Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 200
                  },
                  "document_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "booking_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "account_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "tax_key_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "side": {
                          "type": "string",
                          "enum": [
                            "debit",
                            "credit"
                          ]
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "description": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cost_center_id": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1
                        },
                        "cost_splits": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "$ref": "#/components/schemas/CostSplit89"
                          }
                        }
                      },
                      "required": [
                        "account_id",
                        "side",
                        "amount_cents"
                      ],
                      "additionalProperties": false,
                      "description": "Optional cost_center_id OR cost_splits on net revenue/expense only. Splits total calculated net cents; tax and contra remain unassigned."
                    },
                    "minItems": 1
                  },
                  "document_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      },
      "patch": {
        "operationId": "patch_api_v1_entries_id",
        "summary": "Angegebene Buchungsentwurfsfelder ändern",
        "tags": [
          "entries"
        ],
        "responses": {
          "200": {
            "description": "Angegebene Buchungsentwurfsfelder ändern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Buchung ist festgeschrieben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung/Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 200
                  },
                  "document_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "booking_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "account_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "tax_key_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "side": {
                          "type": "string",
                          "enum": [
                            "debit",
                            "credit"
                          ]
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "description": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cost_center_id": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1
                        },
                        "cost_splits": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "$ref": "#/components/schemas/CostSplit89"
                          }
                        }
                      },
                      "required": [
                        "account_id",
                        "side",
                        "amount_cents"
                      ],
                      "additionalProperties": false,
                      "description": "Optional cost_center_id OR cost_splits on net revenue/expense only. Splits total calculated net cents; tax and contra remain unassigned."
                    },
                    "minItems": 1
                  },
                  "document_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      },
      "delete": {
        "operationId": "delete_api_v1_entries_id",
        "summary": "Buchungsentwurf verwerfen; zugeordnete Belege bleiben",
        "tags": [
          "entries"
        ],
        "responses": {
          "200": {
            "description": "Buchungsentwurf verwerfen; zugeordnete Belege bleiben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "documents_released": {
                      "type": "integer"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "message",
                    "documents_released"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Festgeschrieben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/entries/{id}/post": {
      "post": {
        "operationId": "post_api_v1_entries_id_post",
        "summary": "Buchungsentwurf endgültig festschreiben",
        "tags": [
          "entries"
        ],
        "responses": {
          "200": {
            "description": "Buchungsentwurf endgültig festschreiben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Fachregel, auch eine fehlende ID ergibt 422",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "description": " Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "x-idempotency": {
          "operation": "entry.post",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/entries/{id}/reverse": {
      "post": {
        "operationId": "post_api_v1_entries_id_reverse",
        "summary": "Buchung durch neue Umkehrbuchung korrigieren",
        "tags": [
          "entries"
        ],
        "responses": {
          "201": {
            "description": "Buchung durch neue Umkehrbuchung korrigieren",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung/Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 200
                  },
                  "returned_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Nur bei einer zugeordneten Zahlung: Tag, an dem das Geld tatsächlich zurückgeflossen ist, bei einer Bankzahlung der Buchungstag des Rückgabe-Umsatzes. Der Storno liegt an diesem Tag."
                  },
                  "misallocated": {
                    "type": "boolean",
                    "description": "Nur bei einer zugeordneten Zahlung aus einem vergangenen Jahr: Das Geld kam an und wurde nur falsch zugeordnet."
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "x-idempotency": {
          "operation": "entry.reverse",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "get_api_v1_me",
        "summary": "Identität, Mandant und aktuelle Rollenrechte lesen",
        "tags": [
          "me"
        ],
        "responses": {
          "200": {
            "description": "Identität, Mandant und aktuelle Rollenrechte lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "chart": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "SKR03",
                                "SKR04"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "leistungen": {
                          "type": "array",
                          "description": "Gebuchte Leistungen des Mandanten (buchhaltung, dms). Routen einer nicht gebuchten Leistung antworten 403 mit error=leistung_fehlt.",
                          "items": {
                            "type": "string",
                            "enum": [
                              "buchhaltung",
                              "dms"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "chart",
                        "leistungen"
                      ],
                      "additionalProperties": false
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "name": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "owner",
                            "accountant",
                            "viewer"
                          ]
                        },
                        "can_post": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "role",
                        "can_post"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "tenant",
                    "user"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      }
    },
    "/api/v1/mcp-connections": {
      "get": {
        "operationId": "get_api_v1_mcp_connections",
        "summary": "Eigene sichtbare MCP-Verbindungen lesen",
        "tags": [
          "mcp-connections"
        ],
        "responses": {
          "200": {
            "description": "Eigene sichtbare MCP-Verbindungen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/McpConnection"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      }
    },
    "/api/v1/mcp-connections/{id}": {
      "delete": {
        "operationId": "delete_api_v1_mcp_connections_id",
        "summary": "MCP-Verbindung widerrufen",
        "tags": [
          "mcp-connections"
        ],
        "responses": {
          "204": {
            "description": "MCP-Verbindung widerrufen"
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Verbindung nicht sichtbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/users": {
      "get": {
        "operationId": "get_api_v1_users",
        "summary": "Als Inhaber Benutzer lesen",
        "tags": [
          "users"
        ],
        "responses": {
          "200": {
            "description": "Als Inhaber Benutzer lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/User"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_users",
        "summary": "Als Inhaber mit admin-Schlüssel Benutzer einladen",
        "tags": [
          "users"
        ],
        "responses": {
          "201": {
            "description": "Als Inhaber mit admin-Schlüssel Benutzer einladen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/User"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "accountant",
                      "viewer"
                    ]
                  }
                },
                "required": [
                  "email",
                  "role"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/users/{id}": {
      "patch": {
        "operationId": "patch_api_v1_users_id",
        "summary": "Als Inhaber mit admin-Schlüssel Benutzer ändern oder deaktivieren",
        "tags": [
          "users"
        ],
        "responses": {
          "200": {
            "description": "Als Inhaber mit admin-Schlüssel Benutzer ändern oder deaktivieren",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/User"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Fachregel, etwa letzter Inhaber",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "accountant",
                      "viewer"
                    ]
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/assistant/improvement": {
      "get": {
        "operationId": "get_api_v1_assistant_improvement",
        "summary": "Verfügbarkeit und Zustimmung zum Assistenten-Tracing lesen",
        "tags": [
          "assistant"
        ],
        "responses": {
          "200": {
            "description": "Verfügbarkeit und Zustimmung zum Assistenten-Tracing lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssistantImprovement"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      },
      "delete": {
        "operationId": "delete_api_v1_assistant_improvement",
        "summary": "Als Inhaber Tracing-Zustimmung widerrufen",
        "tags": [
          "assistant"
        ],
        "responses": {
          "200": {
            "description": "Als Inhaber Tracing-Zustimmung widerrufen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssistantImprovement"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      },
      "post": {
        "operationId": "post_api_v1_assistant_improvement",
        "summary": "API-Einschalten wird ausdrücklich verweigert",
        "tags": [
          "assistant"
        ],
        "responses": {
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "API-Einschalten wird ausdrücklich verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Allow: GET, DELETE. Einschalten nur mit gelesener Zustimmung in Einstellungen → Assistent. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/reports/month": {
      "get": {
        "operationId": "get_api_v1_reports_month",
        "summary": "Kennzahl des laufenden Monats lesen",
        "tags": [
          "reports"
        ],
        "responses": {
          "200": {
            "description": "Kennzahl des laufenden Monats lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "month": {
                      "type": "string",
                      "pattern": "^[0-9]{4}-[0-9]{2}$"
                    },
                    "revenue_cents": {
                      "type": "integer"
                    },
                    "receivable_cents": {
                      "type": "integer"
                    },
                    "payable_cents": {
                      "type": "integer"
                    },
                    "posted": {
                      "type": "integer"
                    },
                    "entries": {
                      "type": "integer"
                    },
                    "drafts": {
                      "type": "integer"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "month",
                    "revenue_cents",
                    "receivable_cents",
                    "payable_cents",
                    "posted",
                    "entries",
                    "drafts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      }
    },
    "/api/v1/tasks": {
      "get": {
        "operationId": "get_api_v1_tasks",
        "summary": "Aufgaben, Gruppen und Fristen lesen",
        "tags": [
          "tasks"
        ],
        "responses": {
          "200": {
            "description": "Aufgaben, Gruppen und Fristen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "can_act": {
                      "type": "boolean"
                    },
                    "top": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Task"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Task"
                      }
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "document",
                              "transaction",
                              "entry",
                              "invoice",
                              "quote"
                            ]
                          },
                          "count": {
                            "type": "integer"
                          },
                          "title": {
                            "type": "string"
                          },
                          "web_url": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "count",
                          "title",
                          "web_url"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "deadlines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "vat_return",
                              "overdue_invoices"
                            ]
                          },
                          "title": {
                            "type": "string"
                          },
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "overdue": {
                            "type": "boolean"
                          },
                          "web_url": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "title",
                          "date",
                          "overdue",
                          "web_url"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "prepared_today": {
                      "type": "object",
                      "properties": {
                        "entries": {
                          "type": "integer"
                        },
                        "invoices": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "entries",
                        "invoices"
                      ],
                      "additionalProperties": false
                    },
                    "as_of": {
                      "type": "string"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "count",
                    "can_act",
                    "top",
                    "items",
                    "groups",
                    "deadlines",
                    "prepared_today",
                    "as_of"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      }
    },
    "/api/v1/uebersicht": {
      "get": {
        "operationId": "get_api_v1_uebersicht",
        "summary": "Zahlen der Startseite lesen",
        "description": "Was du bekommst und was du zahlen musst, Rechnung für Rechnung nach Fälligkeit; der Kontostand der nächsten drei Monate als Spanne; Gewinn oder Verlust je Monat. Dieselben Zahlen wie auf der Startseite, für jede Rolle lesbar, nur für die eigene Firma. Die Summen gelten immer für alle offenen Posten, die Listen sind auf items_limit gekürzt (Standard 20).",
        "tags": [
          "reports"
        ],
        "parameters": [
          {
            "name": "items_limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 5000,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Zahlen der Startseite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "as_of": {
                      "type": "string",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                    },
                    "receivables": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "none",
                            "open"
                          ]
                        },
                        "total_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "invoices_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "unallocated_cents": {
                          "type": "integer",
                          "description": "Zahlungen ohne Zuordnung zu einer Rechnung (negativ); in total_cents enthalten, nicht in items."
                        },
                        "count": {
                          "type": "integer"
                        },
                        "overdue_count": {
                          "type": "integer"
                        },
                        "overdue_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "next_due_on": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "oldest_date": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line_id": {
                                "type": "integer"
                              },
                              "entry_id": {
                                "type": "integer"
                              },
                              "invoice_id": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "number": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "partner": {
                                "type": "string"
                              },
                              "account_id": {
                                "type": "integer"
                              },
                              "account_number": {
                                "type": "string"
                              },
                              "date": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "due_on": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "due_assumed": {
                                "type": "boolean",
                                "description": "Keine Fälligkeit bekannt: Buchungsdatum plus 30 Tage."
                              },
                              "overdue": {
                                "type": "boolean"
                              },
                              "days_overdue": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "open_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              }
                            },
                            "required": [
                              "line_id",
                              "entry_id",
                              "invoice_id",
                              "number",
                              "partner",
                              "account_id",
                              "account_number",
                              "date",
                              "due_on",
                              "due_assumed",
                              "overdue",
                              "days_overdue",
                              "open_cents"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Nach Fälligkeit, auf items_limit gekürzt."
                        }
                      },
                      "required": [
                        "state",
                        "total_cents",
                        "invoices_cents",
                        "unallocated_cents",
                        "count",
                        "overdue_count",
                        "overdue_cents",
                        "next_due_on",
                        "oldest_date",
                        "items"
                      ],
                      "additionalProperties": false
                    },
                    "payables": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "none",
                            "open"
                          ]
                        },
                        "total_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "invoices_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "unallocated_cents": {
                          "type": "integer",
                          "description": "Zahlungen ohne Zuordnung zu einer Rechnung (negativ); in total_cents enthalten, nicht in items."
                        },
                        "count": {
                          "type": "integer"
                        },
                        "overdue_count": {
                          "type": "integer"
                        },
                        "overdue_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "next_due_on": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "oldest_date": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line_id": {
                                "type": "integer"
                              },
                              "entry_id": {
                                "type": "integer"
                              },
                              "invoice_id": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "number": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "partner": {
                                "type": "string"
                              },
                              "account_id": {
                                "type": "integer"
                              },
                              "account_number": {
                                "type": "string"
                              },
                              "date": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "due_on": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "due_assumed": {
                                "type": "boolean",
                                "description": "Keine Fälligkeit bekannt: Buchungsdatum plus 30 Tage."
                              },
                              "overdue": {
                                "type": "boolean"
                              },
                              "days_overdue": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "open_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              }
                            },
                            "required": [
                              "line_id",
                              "entry_id",
                              "invoice_id",
                              "number",
                              "partner",
                              "account_id",
                              "account_number",
                              "date",
                              "due_on",
                              "due_assumed",
                              "overdue",
                              "days_overdue",
                              "open_cents"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Nach Fälligkeit, auf items_limit gekürzt."
                        }
                      },
                      "required": [
                        "state",
                        "total_cents",
                        "invoices_cents",
                        "unallocated_cents",
                        "count",
                        "overdue_count",
                        "overdue_cents",
                        "next_due_on",
                        "oldest_date",
                        "items"
                      ],
                      "additionalProperties": false
                    },
                    "cash_forecast": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "ready",
                            "no_bank_account",
                            "no_balance"
                          ]
                        },
                        "balance_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "balance_date": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accounts": {
                          "type": "integer"
                        },
                        "accounts_without_balance": {
                          "type": "integer"
                        },
                        "weeks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "from": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "until": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "low_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              },
                              "high_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                              }
                            },
                            "required": [
                              "from",
                              "until",
                              "low_cents",
                              "high_cents"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "in_three_months": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "from": {
                                  "type": "string",
                                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                                },
                                "until": {
                                  "type": "string",
                                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                                },
                                "low_cents": {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                "high_cents": {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                }
                              },
                              "required": [
                                "from",
                                "until",
                                "low_cents",
                                "high_cents"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "not_counted_overdue_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "recurring_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        }
                      },
                      "required": [
                        "state",
                        "balance_cents",
                        "balance_date",
                        "accounts",
                        "accounts_without_balance",
                        "weeks",
                        "in_three_months",
                        "not_counted_overdue_cents",
                        "recurring_cents"
                      ],
                      "additionalProperties": false,
                      "description": "Kontostand der nächsten 13 Wochen als Spanne. Start ist der letzte bekannte Schlusssaldo aller Euro-Konten. Rechnungen, die wir zahlen müssen, ziehen in beiden Werten in der Woche ihrer Fälligkeit ab, überfällige in der ersten Woche. Rechnungen an Kunden zählen in beiden Werten in der Woche ihrer Fälligkeit; sind sie höchstens 30 Tage überfällig, nur im oberen Wert in der ersten Woche; ältere zählen nicht mehr. Aktive Serienrechnungen zählen in beiden Werten zu Termin plus Zahlungsziel. Ohne Bankkonto oder bekannten Kontostand gibt es keine Vorschau, sondern einen Zustand."
                    },
                    "profit": {
                      "type": "object",
                      "properties": {
                        "method": {
                          "type": "string",
                          "enum": [
                            "euer",
                            "guv"
                          ]
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "ready",
                            "partial",
                            "no_entries"
                          ]
                        },
                        "first_entry": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "open_cases": {
                          "type": "integer",
                          "description": "Vorgänge, die die EÜR noch klären lassen will und die deshalb nicht mitzählen."
                        },
                        "months": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "month": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}$"
                              },
                              "from": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "until": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "partial": {
                                "type": "boolean"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "booked",
                                  "before_first_entry",
                                  "not_supported"
                                ]
                              },
                              "profit_cents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "month",
                              "from",
                              "until",
                              "partial",
                              "state",
                              "profit_cents"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "last_month": {
                          "type": "object",
                          "properties": {
                            "month": {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}$"
                            },
                            "from": {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            "until": {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            "partial": {
                              "type": "boolean"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "booked",
                                "before_first_entry",
                                "not_supported"
                              ]
                            },
                            "profit_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "month",
                            "from",
                            "until",
                            "partial",
                            "state",
                            "profit_cents"
                          ],
                          "additionalProperties": false
                        },
                        "previous_month": {
                          "type": "object",
                          "properties": {
                            "month": {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}$"
                            },
                            "from": {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            "until": {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            "partial": {
                              "type": "boolean"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "booked",
                                "before_first_entry",
                                "not_supported"
                              ]
                            },
                            "profit_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "month",
                            "from",
                            "until",
                            "partial",
                            "state",
                            "profit_cents"
                          ],
                          "additionalProperties": false
                        },
                        "spans": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "months": {
                                "type": "integer",
                                "enum": [
                                  1,
                                  2,
                                  3
                                ]
                              },
                              "from": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "until": {
                                "type": "string",
                                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                              },
                              "profit_cents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "months",
                              "from",
                              "until",
                              "profit_cents"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "twelve_months_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "method",
                        "state",
                        "first_entry",
                        "open_cases",
                        "months",
                        "last_month",
                        "previous_month",
                        "spans",
                        "twelve_months_cents"
                      ],
                      "additionalProperties": false,
                      "description": "Gewinn oder Verlust je Monat, zwölf Monate bis heute (der laufende Monat ist angebrochen), dazu der letzte volle Monat, der davor und die letzten ein bis drei vollen Monate. Ein Einzelunternehmen rechnet wie seine EÜR, alle anderen wie die GuV. Null steht nur, wo es keine Zahl gibt: vor der ersten Buchung oder in einem Jahr, für das die EÜR nicht rechnet."
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "as_of",
                    "receivables",
                    "payables",
                    "cash_forecast",
                    "profit"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      }
    },
    "/api/v1/bank/accounts": {
      "get": {
        "operationId": "get_api_v1_bank_accounts",
        "summary": "Bankkonten und Sachkontozuordnung lesen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "Bankkonten und Sachkontozuordnung lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "iban": {
                            "type": "string"
                          },
                          "name": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "currency": {
                            "type": "string"
                          },
                          "transactions": {
                            "type": "integer"
                          },
                          "account": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/AccountIdentity"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ready": {
                            "type": "boolean"
                          },
                          "data_status": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/BankDataStatus"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "null bei einem Zahlungsdienst"
                          }
                        },
                        "required": [
                          "id",
                          "iban",
                          "name",
                          "currency",
                          "transactions",
                          "account",
                          "ready",
                          "data_status"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      }
    },
    "/api/v1/bank/accounts/{id}": {
      "patch": {
        "operationId": "patch_api_v1_bank_accounts_id",
        "summary": "Bankkonto benennen oder geeignetes Sachkonto zuordnen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "Bankkonto benennen oder geeignetes Sachkonto zuordnen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "iban": {
                          "type": "string"
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "account": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/AccountIdentity"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "iban",
                        "name",
                        "account"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder ungeeignetes Konto",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [],
                "additionalProperties": false,
                "anyOf": [
                  {
                    "required": [
                      "account_id"
                    ]
                  },
                  {
                    "required": [
                      "name"
                    ]
                  }
                ]
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/bank/statements": {
      "get": {
        "operationId": "get_api_v1_bank_statements",
        "summary": "Noch vollständig entfernbare Auszugsimporte lesen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "Noch vollständig entfernbare Auszugsimporte lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "document_id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "name": {
                            "type": "string"
                          },
                          "received_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "transactions": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "document_id",
                          "name",
                          "received_at",
                          "transactions"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_bank_statements",
        "summary": "CAMT/MT940-Auszug einlesen",
        "tags": [
          "bank"
        ],
        "responses": {
          "201": {
            "description": "CAMT/MT940-Auszug einlesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatementImportResult"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "CAMT XML oder MT940, höchstens 16777216 Bytes"
                  }
                },
                "required": [
                  "file"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/bank/statements/{id}": {
      "delete": {
        "operationId": "delete_api_v1_bank_statements_id",
        "summary": "Ungebuchten Auszugsimport bewusst entfernen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "Ungebuchten Auszugsimport bewusst entfernen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactions": {
                      "type": "integer"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "transactions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Beleg nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Bereits gebucht oder nicht entfernbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "{id} ist die document_id des Imports, keine bank_statement_id. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/bank/csv/accounts": {
      "post": {
        "operationId": "post_api_v1_bank_csv_accounts",
        "summary": "Eigenes CSV-Bankkonto anlegen",
        "tags": [
          "bank"
        ],
        "responses": {
          "201": {
            "description": "Eigenes CSV-Bankkonto anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "iban": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "iban",
                    "name"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "iban": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "iban",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/bank/institutes": {
      "get": {
        "operationId": "get_api_v1_bank_institutes",
        "summary": "FinTS-Institute suchen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "FinTS-Institute suchen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "blz": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "city": {
                            "type": "string"
                          },
                          "bic": {
                            "type": "string"
                          },
                          "url": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "version": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "blz",
                          "name",
                          "city",
                          "bic",
                          "url",
                          "version"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            }
          }
        ]
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "operationId": "get_api_v1_webhooks",
        "summary": "Neueste 100 eigene Webhook-Abonnements lesen",
        "tags": [
          "webhooks"
        ],
        "responses": {
          "200": {
            "description": "Neueste 100 eigene Webhook-Abonnements lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subscriptions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookSubscription"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "subscriptions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_webhooks",
        "summary": "Eigenes Webhook-Abonnement registrieren; Geheimnis einmal anzeigen",
        "tags": [
          "webhooks"
        ],
        "responses": {
          "201": {
            "description": "Eigenes Webhook-Abonnement registrieren; Geheimnis einmal anzeigen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecret"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültiges oder nicht öffentliches Ziel; höchstens 20 offene Abonnements",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Cache-Control: no-store. Keine Zusage externer Zustellung; Empfänger muss Ereignis-IDs deduplizieren. Jede Zustellung trägt die Kopfzeilen Webhook-Id, Webhook-Timestamp (Unixsekunden), Webhook-Key-Id und Webhook-Signature (v1= und hexadezimal HMAC-SHA256). Signiert ist timestamp + \".\" + Webhook-Id + \".\" + unveränderter Inhalt, Schlüssel ist die hier angezeigte Zeichenfolge. Weise Zustellungen ab, deren Zeitstempel mehr als 300 Sekunden abweicht. Bestätige doppelte Ereignis-IDs mit 2xx, ohne sie erneut zu verarbeiten. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "description": "Öffentliches HTTPS auf Port 443; ohne Benutzerinfo, Query, Fragment, private/reservierte DNS-Ziele."
                  },
                  "types": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "invoice.issued",
                        "invoice.corrected",
                        "journal.posted"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 3,
                    "uniqueItems": true
                  },
                  "confirm_secret": {
                    "const": true
                  }
                },
                "required": [
                  "url",
                  "types",
                  "confirm_secret"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/{id}": {
      "get": {
        "operationId": "get_api_v1_webhooks_id",
        "summary": "100 eigene Zustellungen plus Versuche und Ergebnisse lesen",
        "tags": [
          "webhooks"
        ],
        "responses": {
          "200": {
            "description": "100 eigene Zustellungen plus Versuche und Ergebnisse lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    },
                    "next_before_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "invoice.issued",
                              "invoice.corrected",
                              "journal.posted"
                            ]
                          },
                          "occurred_at": {
                            "type": "string",
                            "description": "Zeitstempel als Text mit Zeitzonenoffset, nicht ISO-normalisiert."
                          },
                          "invoice_id": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "journal_entry_id": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "occurred_at",
                          "invoice_id",
                          "journal_entry_id"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "attempts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "delivery_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "number": {
                            "type": "integer"
                          },
                          "key_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "started_at": {
                            "type": "string",
                            "description": "Zeitstempel als Text mit Zeitzonenoffset, nicht ISO-normalisiert."
                          }
                        },
                        "required": [
                          "id",
                          "delivery_id",
                          "number",
                          "key_id",
                          "started_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "attempt_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "http_status": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "canceled",
                              "response_unknown",
                              "key_changed",
                              "target_rejected",
                              "accepted",
                              "rate_limited",
                              "server_error",
                              "permanent_http_error"
                            ]
                          },
                          "finished_at": {
                            "type": "string",
                            "description": "Zeitstempel als Text mit Zeitzonenoffset, nicht ISO-normalisiert."
                          }
                        },
                        "required": [
                          "id",
                          "attempt_id",
                          "http_status",
                          "outcome",
                          "finished_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "deliveries",
                    "next_before_id",
                    "events",
                    "attempts",
                    "results"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fremdes/unbekanntes Abonnement oder Cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige UUID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}/events/{eventId}": {
      "get": {
        "operationId": "get_api_v1_webhooks_id_events_eventId",
        "summary": "Exakte gespeicherte Ereignis-JSON-Bytes lesen",
        "tags": [
          "webhooks"
        ],
        "responses": {
          "200": {
            "description": "Exakte gespeicherte Ereignis-JSON-Bytes lesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEvent"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Kein eigenes Abonnement oder keine zugehörige Zustellung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige UUID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Unveränderte raw_body-Bytes; ergänzt keine setup-/billing-Hinweise. Ressourcenverweis nennt aktuellen GET-Vertrag, keinen historischen Ressourcensnapshot.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}/{operation}": {
      "post": {
        "operationId": "post_api_v1_webhooks_id_operation",
        "summary": "Abonnement steuern oder vorhandene Zustellung bewusst nachsenden",
        "tags": [
          "webhooks"
        ],
        "responses": {
          "200": {
            "description": "Abonnement steuern oder vorhandene Zustellung bewusst nachsenden",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "setup": {
                          "type": "object",
                          "properties": {
                            "complete": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "missing": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "complete",
                            "message",
                            "missing"
                          ],
                          "additionalProperties": false
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "overdue",
                                "payment_failed"
                              ]
                            },
                            "can_write": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "due_by": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "amount_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reference": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "transfer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "status",
                            "can_write",
                            "message",
                            "due_by",
                            "amount_cents",
                            "reference",
                            "transfer"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "$ref": "#/components/schemas/WebhookSecret"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "event_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "delivery_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "setup": {
                          "type": "object",
                          "properties": {
                            "complete": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "missing": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "complete",
                            "message",
                            "missing"
                          ],
                          "additionalProperties": false
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "overdue",
                                "payment_failed"
                              ]
                            },
                            "can_write": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "due_by": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "amount_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reference": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "transfer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "status",
                            "can_write",
                            "message",
                            "due_by",
                            "amount_cents",
                            "reference",
                            "transfer"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "event_id",
                        "delivery_id"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fremde/unbekannte ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Widerrufen, falsche Generation, Frist oder Nachsendegrenze",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "pause/resume/revoke: kein Body. rotate: confirm_secret=true. replace: url, types und confirm_secret=true. replay: delivery_id und confirm_replay=true; höchstens zwei Nachsendungen innerhalb sieben Tagen. Rotation erlaubt Empfang des alten Schlüssels noch 300 Sekunden; kein erneuter Geheimnisabruf. Pause/replace/revoke stornieren offene Zustellungen. Kein neuer Rechnungsschreibvorgang. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "operation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "pause",
                "resume",
                "revoke",
                "rotate",
                "replace",
                "replay"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "description": "Öffentliches HTTPS auf Port 443; ohne Benutzerinfo, Query, Fragment, private/reservierte DNS-Ziele."
                  },
                  "types": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "invoice.issued",
                        "invoice.corrected",
                        "journal.posted"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 3,
                    "uniqueItems": true
                  },
                  "confirm_secret": {
                    "const": true
                  },
                  "delivery_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "confirm_replay": {
                    "const": true
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/document-mail-inbox": {
      "get": {
        "operationId": "get_api_v1_document_mail_inbox",
        "summary": "Mail-Eingang und neueste 25 Zustellungen lesen",
        "tags": [
          "document-mail-inbox"
        ],
        "responses": {
          "200": {
            "description": "Mail-Eingang und neueste 25 Zustellungen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailInbox"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_document_mail_inbox",
        "summary": "Mailadresse rotieren/deaktivieren oder Anhang gezielt erneut verarbeiten",
        "tags": [
          "document-mail-inbox"
        ],
        "responses": {
          "200": {
            "description": "Mailadresse rotieren/deaktivieren oder Anhang gezielt erneut verarbeiten",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailInbox"
                    },
                    "created": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "address": {
                              "type": "string"
                            },
                            "inbox_id": {
                              "type": "integer",
                              "minimum": 1
                            }
                          },
                          "required": [
                            "address",
                            "inbox_id"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "created"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Anhang nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Veraltete Vorschau oder Zustand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "rotate/disable verlangen zusätzlich das Recht zur Benutzerverwaltung (Inhaber und admin). rotate antwortet mit 422, solange available falsch ist. Dafür revision aus Inbox verwenden. retry verlangt attachment_id und retry_revision des Anhangs im Feld revision; maximal fünf Versuche, importierte/duplizierte Anhänge bleiben. rotate liefert Adresse einmal in created. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "rotate",
                      "disable",
                      "retry"
                    ]
                  },
                  "revision": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "attachment_id": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "action",
                  "revision"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/setup": {
      "get": {
        "operationId": "get_api_v1_setup",
        "summary": "Einrichtung und konkrete fehlende Schritte lesen",
        "tags": [
          "setup"
        ],
        "responses": {
          "200": {
            "description": "Einrichtung und konkrete fehlende Schritte lesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupStatus"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": ""
      },
      "post": {
        "operationId": "post_api_v1_setup",
        "summary": "Angegebene Unternehmenseinstellungen ändern",
        "tags": [
          "setup"
        ],
        "responses": {
          "200": {
            "description": "Angegebene Unternehmenseinstellungen ändern",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupStatus"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Teiländerung. Kontenrahmenwechsel nur separat per Konsole. Profil/Nummer atomar, danach Logo, Versteuerung und Rhythmus separat: Fehler kann vorherige Teilschritte erhalten. Ist verlangt basis. Logo: PNG/JPEG/WebP, 2 MiB; Basis64 streng. Das Nummernmuster wird geprüft. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 200
                  },
                  "chart": {
                    "type": "string",
                    "enum": [
                      "SKR03",
                      "SKR04"
                    ]
                  },
                  "taxation": {
                    "type": "string",
                    "enum": [
                      "soll",
                      "ist"
                    ]
                  },
                  "basis": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "limit",
                          "no_bookkeeping",
                          "profession"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "valid_from": {
                    "type": "string",
                    "format": "date"
                  },
                  "note": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_filing": {
                    "type": "string",
                    "enum": [
                      "month",
                      "quarter"
                    ]
                  },
                  "vat_filing_from": {
                    "type": "string",
                    "format": "date"
                  },
                  "tax_number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "street": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "register": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "represented_by": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "bank_name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "website": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postal_code": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                  },
                  "small_business": {
                    "type": "boolean"
                  },
                  "iban": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 34
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "bic": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 11
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 50
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "receivables_account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "invoice_number_format": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "credit_note_number_format": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "next_invoice_number": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 999999
                  },
                  "next_invoice_number_year": {
                    "type": "integer",
                    "minimum": 2000,
                    "maximum": 2100
                  },
                  "logo_base64": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "invoice_layout": {
                    "type": "string",
                    "enum": [
                      "summator",
                      "klassisch"
                    ]
                  },
                  "invoice_font": {
                    "type": "string",
                    "enum": [
                      "inter",
                      "arimo"
                    ]
                  },
                  "invoice_prices": {
                    "type": "string",
                    "enum": [
                      "net",
                      "gross"
                    ]
                  },
                  "legal_form": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "sole_proprietor",
                          "partnership",
                          "corporation"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/setup/logo": {
      "post": {
        "operationId": "post_api_v1_setup_logo",
        "summary": "Rechnungslogo speichern",
        "tags": [
          "setup"
        ],
        "responses": {
          "200": {
            "description": "Rechnungslogo speichern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "logo": {
                      "type": "boolean"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "logo"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "logo": {
                    "type": "string",
                    "format": "binary",
                    "description": "PNG/JPEG/WebP bis 2097152 Bytes; als PNG auf höchstens 1200×600 Pixel gespeichert."
                  }
                },
                "required": [
                  "logo"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_api_v1_setup_logo",
        "summary": "Rechnungslogo entfernen",
        "tags": [
          "setup"
        ],
        "responses": {
          "200": {
            "description": "Rechnungslogo entfernen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "logo": {
                      "type": "boolean"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "logo"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/documents": {
      "get": {
        "operationId": "get_api_v1_documents",
        "summary": "Belege nach Empfangszeit seitenweise lesen",
        "tags": [
          "documents"
        ],
        "responses": {
          "200": {
            "description": "Belege nach Empfangszeit seitenweise lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Document"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total",
                        "page"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "hidden",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Zeigt statt der sichtbaren Belege die ausgeblendeten Fehlimporte."
          },
          {
            "name": "unlinked",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Jeder truthy Querywert aktiviert Filter, auch String false."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 25
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_documents",
        "summary": "Original einreichen und Erkennung anstoßen",
        "tags": [
          "documents"
        ],
        "responses": {
          "201": {
            "description": "Original einreichen und Erkennung anstoßen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Document"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "1 bis 33554432 Bytes. application/pdf, image/jpeg, image/png, image/heic, image/webp, image/tiff, text/xml, application/xml, text/csv, application/json. OCR hat eigene engere Grenzen."
                  },
                  "document_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "note": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "file"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{id}": {
      "get": {
        "operationId": "get_api_v1_documents_id",
        "summary": "Beleg und Integritätsprüfung lesen",
        "tags": [
          "documents"
        ],
        "responses": {
          "200": {
            "description": "Beleg und Integritätsprüfung lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "recognition": {
                          "$ref": "#/components/schemas/Recognition"
                        },
                        "name": {
                          "type": "string"
                        },
                        "mime_type": {
                          "type": "string"
                        },
                        "size_bytes": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "document_date": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "received_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "locked": {
                          "type": "boolean"
                        },
                        "discardable": {
                          "type": "boolean"
                        },
                        "locked_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "entries": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "entry_number": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "description": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "entry_number",
                              "description"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "duplicates": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DocumentDuplicate"
                          }
                        },
                        "integrity_ok": {
                          "type": "boolean"
                        },
                        "validation": {
                          "$ref": "#/components/schemas/IncomingValidationState"
                        },
                        "hidden": {
                          "type": "boolean",
                          "description": "Ausgeblendeter Fehlimport. Original und Historie bleiben erhalten."
                        },
                        "visibility_history": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DocumentVisibilityEvent"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "recognition",
                        "name",
                        "mime_type",
                        "size_bytes",
                        "sha256",
                        "document_date",
                        "note",
                        "received_at",
                        "locked",
                        "discardable",
                        "locked_at",
                        "entries",
                        "duplicates",
                        "integrity_ok",
                        "validation",
                        "hidden",
                        "visibility_history"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Beleg fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "delete": {
        "operationId": "delete_api_v1_documents_id",
        "summary": "Nur verwerfbaren ungebuchten Beleg entfernen",
        "tags": [
          "documents"
        ],
        "responses": {
          "204": {
            "description": "Nur verwerfbaren ungebuchten Beleg entfernen"
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Beleg fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Gesperrt, gesiegelt oder geschützte E-Rechnung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "discardable ist ein Hinweis, der Server prüft erneut. Original einer gebuchten Rechnung bleibt erhalten. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/documents/{id}/file": {
      "get": {
        "operationId": "get_api_v1_documents_id_file",
        "summary": "Hashgeprüfte unveränderte Originaldatei inline lesen",
        "tags": [
          "documents"
        ],
        "responses": {
          "200": {
            "description": "Hashgeprüfte unveränderte Originaldatei inline lesen",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt oder Integritätsfehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Content-Type ist der gespeicherte MIME-Typ; Content-Disposition inline, nosniff. Keine Neuerzeugung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/documents/{id}/recognition": {
      "get": {
        "operationId": "get_api_v1_documents_id_recognition",
        "summary": "Erkennungsstatus lesen",
        "tags": [
          "documents"
        ],
        "responses": {
          "200": {
            "description": "Erkennungsstatus lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Recognition"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "PNG/JPEG/PDF, OCR höchstens 16 MiB/16 Mio Pixel/2 Seiten/120 Sekunden. Höchstens 5 Versuche, mindestens eine Minute Abstand.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_documents_id_recognition",
        "summary": "Erkennung gezielt erneut anfordern",
        "tags": [
          "documents"
        ],
        "responses": {
          "202": {
            "description": "Erkennung gezielt erneut anfordern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Recognition"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "PNG/JPEG/PDF, OCR höchstens 16 MiB/16 Mio Pixel/2 Seiten/120 Sekunden. Höchstens 5 Versuche, mindestens eine Minute Abstand. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/documents/{id}/review": {
      "get": {
        "operationId": "get_api_v1_documents_id_review",
        "summary": "Aktuellen Prüfstand und historische Lesungen lesen",
        "tags": [
          "documents"
        ],
        "responses": {
          "200": {
            "description": "Aktuellen Prüfstand und historische Lesungen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentReview"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_documents_id_review",
        "summary": "Korrektur als neuen Prüfentwurf anhängen",
        "tags": [
          "documents"
        ],
        "responses": {
          "201": {
            "description": "Korrektur als neuen Prüfentwurf anhängen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocumentReview"
                    },
                    "saved_extract_id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "saved_extract_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Netto+Steuer=Brutto, Vorzeichen und Gruppen müssen passen. Fehlende Werte bleiben null; Währung als ISO-Code. Keine Originaländerung. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "values": {
                    "$ref": "#/components/schemas/ReviewValues"
                  }
                },
                "required": [
                  "version",
                  "values"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{id}/review/preview": {
      "post": {
        "operationId": "post_api_v1_documents_id_review_preview",
        "summary": "Übernahme ohne Festschreibung vorschauen",
        "tags": [
          "documents"
        ],
        "responses": {
          "200": {
            "description": "Übernahme ohne Festschreibung vorschauen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "document_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "original_sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "version": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "extract_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "values": {
                          "$ref": "#/components/schemas/ReviewValues"
                        },
                        "booking": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "description": {
                                  "type": "string"
                                },
                                "lines": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "account_id": {
                                        "type": "integer",
                                        "minimum": 1
                                      },
                                      "tax_key_id": {
                                        "type": "integer",
                                        "minimum": 1
                                      },
                                      "side": {
                                        "type": "string",
                                        "enum": [
                                          "debit",
                                          "credit"
                                        ]
                                      },
                                      "amount_cents": {
                                        "type": "integer"
                                      },
                                      "cost_center_id": {
                                        "type": [
                                          "integer",
                                          "null"
                                        ],
                                        "minimum": 1
                                      },
                                      "cost_splits": {
                                        "type": "array",
                                        "minItems": 1,
                                        "maxItems": 100,
                                        "items": {
                                          "$ref": "#/components/schemas/CostSplit89"
                                        }
                                      }
                                    },
                                    "required": [
                                      "account_id",
                                      "side",
                                      "amount_cents"
                                    ],
                                    "additionalProperties": false,
                                    "description": "Optional cost_center_id OR cost_splits on net revenue/expense only. Splits total calculated net cents; tax and contra remain unassigned."
                                  }
                                },
                                "groups": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "index": {
                                        "type": "integer"
                                      },
                                      "account": {
                                        "type": "string"
                                      },
                                      "tax_key": {
                                        "type": "string"
                                      },
                                      "category": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "scheme": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "net_cents": {
                                        "type": "integer"
                                      },
                                      "tax_cents": {
                                        "type": "integer"
                                      },
                                      "gross_cents": {
                                        "type": "integer"
                                      },
                                      "tax_account_state": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "integer",
                                                "minimum": 1
                                              },
                                              "type": {
                                                "type": "string"
                                              },
                                              "chart": {
                                                "type": "string"
                                              },
                                              "is_active": {
                                                "type": "boolean"
                                              },
                                              "vat_box": {
                                                "type": [
                                                  "string",
                                                  "null"
                                                ]
                                              },
                                              "category_code": {
                                                "type": [
                                                  "string",
                                                  "null"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "type",
                                              "chart",
                                              "is_active",
                                              "vat_box",
                                              "category_code"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "classification": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "integer",
                                            "minimum": 1
                                          },
                                          "rate_bp": {
                                            "type": "integer"
                                          },
                                          "category": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "direction": {
                                            "type": "string"
                                          },
                                          "account_id": {
                                            "type": [
                                              "integer",
                                              "null"
                                            ]
                                          },
                                          "counter_account_id": {
                                            "type": [
                                              "integer",
                                              "null"
                                            ]
                                          },
                                          "vat_box": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "chart": {
                                            "type": "string"
                                          },
                                          "is_active": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "rate_bp",
                                          "category",
                                          "direction",
                                          "account_id",
                                          "counter_account_id",
                                          "vat_box",
                                          "chart",
                                          "is_active"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "account_state": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "integer",
                                            "minimum": 1
                                          },
                                          "type": {
                                            "type": "string"
                                          },
                                          "chart": {
                                            "type": "string"
                                          },
                                          "is_active": {
                                            "type": "boolean"
                                          },
                                          "vat_box": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "category_code": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "type",
                                          "chart",
                                          "is_active",
                                          "vat_box",
                                          "category_code"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "index",
                                      "account",
                                      "tax_key",
                                      "category",
                                      "scheme",
                                      "net_cents",
                                      "tax_cents",
                                      "gross_cents",
                                      "tax_account_state",
                                      "classification",
                                      "account_state"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "account": {
                                  "type": "string"
                                },
                                "tax_key": {
                                  "type": "string"
                                },
                                "counter_account": {
                                  "type": "string"
                                },
                                "counter_state": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "chart": {
                                      "type": "string"
                                    },
                                    "is_active": {
                                      "type": "boolean"
                                    },
                                    "vat_box": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "category_code": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "type",
                                    "chart",
                                    "is_active",
                                    "vat_box",
                                    "category_code"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "description",
                                "lines",
                                "groups",
                                "account",
                                "tax_key",
                                "counter_account",
                                "counter_state"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "limitation": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "duplicates": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "beleg_id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "aussteller": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "rechnungsnummer": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "datum": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "brutto_cents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "description": "Ganzzahlige Cent"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "e_rechnung": {
                                "type": "boolean"
                              },
                              "stand": {
                                "type": "string"
                              },
                              "buchung": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "merkmale": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "gleich": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "beleg_id",
                              "name",
                              "aussteller",
                              "rechnungsnummer",
                              "datum",
                              "brutto_cents",
                              "e_rechnung",
                              "stand",
                              "buchung",
                              "merkmale",
                              "gleich"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "actor_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "token": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        }
                      },
                      "required": [
                        "document_id",
                        "original_sha256",
                        "version",
                        "extract_id",
                        "values",
                        "booking",
                        "limitation",
                        "duplicates",
                        "actor_id",
                        "token"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "booking": {
                    "type": "object",
                    "properties": {
                      "counter_account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "tax_key_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "groups": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "account_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "tax_key_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "cost_center_id": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "minimum": 1
                            },
                            "cost_splits": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/CostSplit89"
                              }
                            }
                          },
                          "required": [
                            "account_id",
                            "tax_key_id"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 12
                      },
                      "cost_center_id": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1
                      }
                    },
                    "required": [
                      "counter_account_id",
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "version"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{id}/review/confirm": {
      "post": {
        "operationId": "post_api_v1_documents_id_review_confirm",
        "summary": "Prüfstand bestätigen; gegebenenfalls Buchungsentwurf anlegen",
        "tags": [
          "documents"
        ],
        "responses": {
          "201": {
            "description": "Prüfstand bestätigen; gegebenenfalls Buchungsentwurf anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "extract": {
                          "$ref": "#/components/schemas/DocumentExtractRecord"
                        },
                        "entry": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/JournalEntryRecord"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "limitation": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "extract",
                        "entry",
                        "limitation"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Gesperrte/gesiegelte Belege, laufende Erkennung, alte Version oder Token werden 422. Dubletten ausdrücklich bestätigen. limitation kann Übernahme ohne Buchung erlauben. Niemals automatische Festschreibung. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "booking": {
                    "type": "object",
                    "properties": {
                      "counter_account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "tax_key_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "groups": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "account_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "tax_key_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "cost_center_id": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "minimum": 1
                            },
                            "cost_splits": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/CostSplit89"
                              }
                            }
                          },
                          "required": [
                            "account_id",
                            "tax_key_id"
                          ],
                          "additionalProperties": false
                        },
                        "maxItems": 12
                      },
                      "cost_center_id": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1
                      }
                    },
                    "required": [
                      "counter_account_id",
                      "description"
                    ],
                    "additionalProperties": false
                  },
                  "preview_token": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "duplicate_acknowledged": {
                    "type": "boolean"
                  },
                  "confirm": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  }
                },
                "required": [
                  "version",
                  "preview_token",
                  "confirm"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/accounts/{id}": {
      "patch": {
        "operationId": "patch_api_v1_accounts_id",
        "summary": "Begrenzt Sachkontenstammdaten pflegen",
        "tags": [
          "accounts"
        ],
        "responses": {
          "200": {
            "description": "Begrenzt Sachkontenstammdaten pflegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "number": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "category": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "is_active": {
                      "type": "boolean"
                    },
                    "vat_box": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "vat_reportable": {
                      "type": "boolean"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "number",
                    "name",
                    "category",
                    "is_active",
                    "vat_box",
                    "vat_reportable"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Keine fremden Felder. Nummer, Art und Rahmen bleiben fest; bebuchte Kategorie und vorhandene Kennziffer nicht umdeuten; Personenkonten und Bankkonten separat. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 200
                  },
                  "category": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_box": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[0-9]{2,3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_reportable": {
                    "type": "boolean"
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [],
                "additionalProperties": false,
                "minProperties": 1
              }
            }
          }
        }
      }
    },
    "/api/v1/bank/connections": {
      "get": {
        "operationId": "get_api_v1_bank_connections",
        "summary": "FinTS-Konfiguration und gespeicherte Zugänge lesen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "FinTS-Konfiguration und gespeicherte Zugänge lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BankConnection"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "enabled",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": ""
      },
      "post": {
        "operationId": "post_api_v1_bank_connections",
        "summary": "FinTS-Zugang konfigurieren",
        "tags": [
          "bank"
        ],
        "responses": {
          "201": {
            "description": "FinTS-Zugang konfigurieren",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BankConnection"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "fetch_from höchstens heute. Kein PIN-Speichern; tatsächlicher Abruf erfordert installierte FinTS-Konfiguration und Bankfreigabe. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bank_code": {
                    "type": "string",
                    "maxLength": 12
                  },
                  "username": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "url": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fetch_from": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "bank_code",
                  "username"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/bank/connections/{id}/tan-modes": {
      "post": {
        "operationId": "post_api_v1_bank_connections_id_tan_modes",
        "summary": "TAN-Verfahren bei der Bank lesen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "TAN-Verfahren bei der Bank lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "decoupled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "decoupled"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pin": {
                    "type": "string",
                    "maxLength": 100,
                    "writeOnly": true
                  }
                },
                "required": [
                  "pin"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/bank/connections/{id}/tan-mode": {
      "post": {
        "operationId": "post_api_v1_bank_connections_id_tan_mode",
        "summary": "TAN-Verfahren und Medium auswählen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "TAN-Verfahren und Medium auswählen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BankConnection"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pin": {
                    "type": "string",
                    "maxLength": 100,
                    "writeOnly": true
                  },
                  "tan_mode": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tan_medium": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "pin"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/bank/connections/{id}/fetch": {
      "post": {
        "operationId": "post_api_v1_bank_connections_id_fetch",
        "summary": "FinTS fetch",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "FinTS fetch",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "done"
                      ]
                    },
                    "statements": {
                      "type": "integer"
                    },
                    "transactions": {
                      "type": "integer"
                    },
                    "duplicates": {
                      "type": "integer"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "status",
                    "statements",
                    "transactions",
                    "duplicates",
                    "warnings",
                    "accounts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "TAN oder entkoppelte Freigabe erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "tan"
                      ]
                    },
                    "token": {
                      "type": "string",
                      "minLength": 40,
                      "maxLength": 40
                    },
                    "challenge": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "challenge_image": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "decoupled": {
                      "type": "boolean"
                    },
                    "nachholen_ab": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "status",
                    "token",
                    "challenge",
                    "challenge_image",
                    "decoupled",
                    "nachholen_ab"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "PIN nur je Anfrage; bis 180 Sekunden. 202 verlangt ausdrückliche TAN/Freigabe über resume mit demselben from beim Nachholen. backfill.from vor heute. Fachliche Fehler einschließlich fehlender Verbindung: 422. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pin": {
                    "type": "string",
                    "maxLength": 100,
                    "writeOnly": true
                  }
                },
                "required": [
                  "pin"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/bank/connections/{id}/backfill": {
      "post": {
        "operationId": "post_api_v1_bank_connections_id_backfill",
        "summary": "FinTS backfill",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "FinTS backfill",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "done"
                      ]
                    },
                    "statements": {
                      "type": "integer"
                    },
                    "transactions": {
                      "type": "integer"
                    },
                    "duplicates": {
                      "type": "integer"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "status",
                    "statements",
                    "transactions",
                    "duplicates",
                    "warnings",
                    "accounts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "TAN oder entkoppelte Freigabe erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "tan"
                      ]
                    },
                    "token": {
                      "type": "string",
                      "minLength": 40,
                      "maxLength": 40
                    },
                    "challenge": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "challenge_image": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "decoupled": {
                      "type": "boolean"
                    },
                    "nachholen_ab": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "status",
                    "token",
                    "challenge",
                    "challenge_image",
                    "decoupled",
                    "nachholen_ab"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "PIN nur je Anfrage; bis 180 Sekunden. 202 verlangt ausdrückliche TAN/Freigabe über resume mit demselben from beim Nachholen. backfill.from vor heute. Fachliche Fehler einschließlich fehlender Verbindung: 422. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pin": {
                    "type": "string",
                    "maxLength": 100,
                    "writeOnly": true
                  },
                  "from": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "pin",
                  "from"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/bank/connections/{id}/resume": {
      "post": {
        "operationId": "post_api_v1_bank_connections_id_resume",
        "summary": "FinTS resume",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "FinTS resume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "done"
                      ]
                    },
                    "statements": {
                      "type": "integer"
                    },
                    "transactions": {
                      "type": "integer"
                    },
                    "duplicates": {
                      "type": "integer"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "status",
                    "statements",
                    "transactions",
                    "duplicates",
                    "warnings",
                    "accounts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "TAN oder entkoppelte Freigabe erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "tan"
                      ]
                    },
                    "token": {
                      "type": "string",
                      "minLength": 40,
                      "maxLength": 40
                    },
                    "challenge": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "challenge_image": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "decoupled": {
                      "type": "boolean"
                    },
                    "nachholen_ab": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "status",
                    "token",
                    "challenge",
                    "challenge_image",
                    "decoupled",
                    "nachholen_ab"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "PIN nur je Anfrage; bis 180 Sekunden. 202 verlangt ausdrückliche TAN/Freigabe über resume mit demselben from beim Nachholen. backfill.from vor heute. Fachliche Fehler einschließlich fehlender Verbindung: 422. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pin": {
                    "type": "string",
                    "maxLength": 100,
                    "writeOnly": true
                  },
                  "token": {
                    "type": "string",
                    "minLength": 40,
                    "maxLength": 40
                  },
                  "tan": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 20,
                        "writeOnly": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "from": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "pin",
                  "token"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/bank/transactions": {
      "get": {
        "operationId": "get_api_v1_bank_transactions",
        "summary": "Bankumsätze mit unabhängiger Offen-Summe lesen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "Bankumsätze mit unabhängiger Offen-Summe lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BankTransaction"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer"
                        },
                        "per_page": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "page",
                        "per_page",
                        "total",
                        "pages"
                      ],
                      "additionalProperties": false
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "open": {
                          "type": "integer"
                        },
                        "unmapped_accounts": {
                          "type": "integer"
                        },
                        "incoming_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "outgoing_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "oldest_on": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "open",
                        "unmapped_accounts",
                        "incoming_cents",
                        "outgoing_cents",
                        "oldest_on"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "meta",
                    "summary"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "settled",
                "all"
              ]
            }
          },
          {
            "name": "bank_account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "in",
                "out"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            },
            "description": "Älterer Alias für per_page; per_page hat Vorrang."
          }
        ]
      }
    },
    "/api/v1/bank/transactions/{id}/book": {
      "post": {
        "operationId": "post_api_v1_bank_transactions_id_book",
        "summary": "Umsatz ausdrücklich auf Sachkonto buchen",
        "tags": [
          "bank"
        ],
        "responses": {
          "201": {
            "description": "Umsatz ausdrücklich auf Sachkonto buchen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "entry_number": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "description": {
                          "type": "string"
                        },
                        "booking_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "lines": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "account": {
                                "type": "string"
                              },
                              "debit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              },
                              "credit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              },
                              "cost_center_id": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "account",
                              "debit_cents",
                              "credit_cents"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "entry_number",
                        "description",
                        "booking_date",
                        "lines"
                      ],
                      "additionalProperties": false
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Kein offener Posten erforderlich; Beleg- und Periodensperren gelten. Warnungen sind nicht sperrend. Eine fehlende ID ergibt 422. Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "tax_key_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 250
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "document_ids": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cost_center_id": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  },
                  "cost_splits": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/CostSplit89"
                    },
                    "minItems": 1,
                    "maxItems": 100
                  }
                },
                "required": [
                  "account_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "x-idempotency": {
          "operation": "transaction.book",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/bank/transactions/{id}/settle": {
      "post": {
        "operationId": "post_api_v1_bank_transactions_id_settle",
        "summary": "Umsatz mit offenen Posten ausgleichen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "Skonto-Vorschau ohne Buchung",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "rule": {
                          "type": "string"
                        },
                        "tenant_id": {
                          "type": "string"
                        },
                        "actor_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transaction_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "statement_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "description": {
                          "type": "string"
                        },
                        "bank_account_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "bank_ledger_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "booking_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "payment_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "allocations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line_id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "amount_cents": {
                                "type": "integer",
                                "minimum": 1
                              }
                            },
                            "required": [
                              "line_id",
                              "amount_cents"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "skonto_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "groups": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SettlementSkontoGroup"
                          }
                        },
                        "remaining_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "confirmation": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "rule",
                        "tenant_id",
                        "actor_id",
                        "transaction_id",
                        "statement_id",
                        "description",
                        "bank_account_id",
                        "bank_ledger_id",
                        "booking_date",
                        "currency",
                        "payment_cents",
                        "allocations",
                        "skonto_cents",
                        "groups",
                        "remaining_cents",
                        "confirmation"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "201": {
            "description": "Umsatz mit offenen Posten ausgleichen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "skonto_groups": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string"
                              },
                              "group": {
                                "$ref": "#/components/schemas/SettlementSkontoGroup"
                              }
                            },
                            "required": [
                              "rule",
                              "group"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "entry_number": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "description": {
                          "type": "string"
                        },
                        "booking_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "lines": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "account": {
                                "type": "string"
                              },
                              "debit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              },
                              "credit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              }
                            },
                            "required": [
                              "account",
                              "debit_cents",
                              "credit_cents"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "skonto_groups",
                        "entry_number",
                        "description",
                        "booking_date",
                        "lines"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Mit Skonto ohne confirmation nur 200 Vorschau. Danach deren confirmation bewusst bestätigen; 15 Minuten gültig. Kein automatischer Zahlungsvorgang. Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "allocations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "line_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "line_id",
                        "amount_cents"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1
                  },
                  "skonto_percent": {
                    "anyOf": [
                      {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "exclusiveMaximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "skonto_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "confirmation": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "allocations"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "x-idempotency": {
          "operation": "transaction.settle",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/bank/transactions/{id}/suggestions": {
      "get": {
        "operationId": "get_api_v1_bank_transactions_id_suggestions",
        "summary": "Ausgleichs- und Buchungsvorschläge lesen",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "Ausgleichs- und Buchungsvorschläge lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transaction": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "amount_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "counterparty_name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "purpose": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "end_to_end_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "booked_on": {
                          "type": "string",
                          "format": "date"
                        },
                        "purpose_text": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "amount_cents",
                        "counterparty_name",
                        "purpose",
                        "end_to_end_id",
                        "booked_on",
                        "purpose_text"
                      ],
                      "additionalProperties": false
                    },
                    "account": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "number": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "personal_kind": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "number",
                            "name",
                            "personal_kind"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "candidates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "line_id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "account_id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "account": {
                            "type": "string"
                          },
                          "entry_number": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "booking_date": {
                            "type": "string",
                            "format": "date"
                          },
                          "description": {
                            "type": "string"
                          },
                          "open_cents": {
                            "type": "integer"
                          },
                          "suggested_cents": {
                            "type": "integer"
                          },
                          "score": {
                            "type": "integer"
                          },
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "number_in_purpose": {
                            "type": "boolean"
                          },
                          "partner_recognized": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "line_id",
                          "account_id",
                          "account",
                          "entry_number",
                          "booking_date",
                          "description",
                          "open_cents",
                          "suggested_cents",
                          "score",
                          "reasons",
                          "number_in_purpose",
                          "partner_recognized"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "booking": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "account_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "tax_key_id": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "grund": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "account_id",
                            "tax_key_id",
                            "grund"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "transaction",
                    "account",
                    "candidates",
                    "booking"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Umsatz fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Schon gebucht; journal_entry_id beigefügt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "journal_entry_id": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "message",
                    "journal_entry_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/bank/csv": {
      "post": {
        "operationId": "post_api_v1_bank_csv",
        "summary": "CSV prüfen, vorschauen oder ausdrücklich importieren",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "CSV prüfen, vorschauen oder ausdrücklich importieren",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "headers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "profile": {
                          "type": "string",
                          "enum": [
                            "generic",
                            "finom"
                          ]
                        },
                        "suggested_mapping": {
                          "type": "object",
                          "description": "Unverbindlicher Spaltenvorschlag: Feldname und nullbasierter Spaltenindex.",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line": {
                                "type": "integer"
                              },
                              "values": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "line",
                              "values"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "setup": {
                          "type": "object",
                          "properties": {
                            "complete": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "missing": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "complete",
                            "message",
                            "missing"
                          ],
                          "additionalProperties": false
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "overdue",
                                "payment_failed"
                              ]
                            },
                            "can_write": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "due_by": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "amount_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reference": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "transfer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "status",
                            "can_write",
                            "message",
                            "due_by",
                            "amount_cents",
                            "reference",
                            "transfer"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "headers",
                        "rows",
                        "profile",
                        "suggested_mapping"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "$ref": "#/components/schemas/CsvPreview"
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Original und Umsätze importiert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatementImportResult"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "multipart options[field]. inspect benötigt nur delimiter/encoding; preview/import benötigen CSVOptions vollständig und bank_account_id. import verlangt token aus Vorschau als confirmation bei bytegleicher Datei/Mapping/Entscheidungen. Nur explizite EUR-Umsätze und gebuchter Status; Konflikte bewusst als new oder duplicate:<id> entscheiden. Kein fester Finom-Spaltenplan. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "1 Byte bis 4194304 Bytes, höchstens 5000 Zeilen und 64 Spalten"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "inspect",
                      "preview",
                      "import"
                    ]
                  },
                  "bank_account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "options": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "delimiter": {
                            "type": "string",
                            "enum": [
                              ";",
                              ","
                            ]
                          },
                          "encoding": {
                            "type": "string",
                            "enum": [
                              "UTF-8",
                              "Windows-1252"
                            ]
                          }
                        },
                        "required": [],
                        "additionalProperties": false
                      },
                      {
                        "$ref": "#/components/schemas/CsvOptions"
                      }
                    ]
                  },
                  "confirmation": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 64,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "file",
                  "mode",
                  "options"
                ],
                "additionalProperties": false,
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "mode": {
                          "enum": [
                            "preview",
                            "import"
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "bank_account_id"
                      ],
                      "properties": {
                        "bank_account_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "options": {
                          "$ref": "#/components/schemas/CsvOptions"
                        }
                      }
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "mode": {
                          "const": "import"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "confirmation"
                      ],
                      "properties": {
                        "confirmation": {
                          "type": "string",
                          "minLength": 64,
                          "maxLength": 64
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/stripe/connections": {
      "get": {
        "operationId": "get_api_v1_stripe_connections",
        "summary": "Installationsstatus und Stripe-Verbindungen lesen",
        "tags": [
          "stripe"
        ],
        "responses": {
          "200": {
            "description": "Installationsstatus und Stripe-Verbindungen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StripeConnection"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "enabled",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": ""
      },
      "post": {
        "operationId": "post_api_v1_stripe_connections",
        "summary": "Browserlink zur bewussten Stripe-Verbindung anfordern",
        "tags": [
          "stripe"
        ],
        "responses": {
          "201": {
            "description": "Browserlink zur bewussten Stripe-Verbindung anfordern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "message": {
                      "type": "string"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "url",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "from höchstens heute; Browseranmeldung und Einwilligung erforderlich. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/stripe/connections/key": {
      "post": {
        "operationId": "post_api_v1_stripe_connections_key",
        "summary": "Eigenen eingeschränkten Stripe-Schlüssel verbinden",
        "tags": [
          "stripe"
        ],
        "responses": {
          "201": {
            "description": "Eigenen eingeschränkten Stripe-Schlüssel verbinden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StripeConnection"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "from höchstens heute. Externer API-Aufruf; kein Schlüssel in Antworten. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "maxLength": 255,
                    "writeOnly": true
                  },
                  "from": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/stripe/connections/{id}/fetch": {
      "post": {
        "operationId": "post_api_v1_stripe_connections_id_fetch",
        "summary": "Transaktionen einer Stripe-Verbindung abrufen",
        "tags": [
          "stripe"
        ],
        "responses": {
          "200": {
            "description": "Transaktionen einer Stripe-Verbindung abrufen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "statements": {
                          "type": "integer"
                        },
                        "transactions": {
                          "type": "integer"
                        },
                        "warnings": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "statements",
                        "transactions",
                        "warnings"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Bis 180 Sekunden; Überschneidungen werden per Fingerprint dedupliziert. Kein Zahlungsauftrag. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/stripe/connections/{id}/disconnect": {
      "post": {
        "operationId": "post_api_v1_stripe_connections_id_disconnect",
        "summary": "Stripe-Geheimnisse entfernen, Historie erhalten",
        "tags": [
          "stripe"
        ],
        "responses": {
          "200": {
            "description": "Stripe-Geheimnisse entfernen, Historie erhalten",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StripeConnection"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/quotes": {
      "get": {
        "operationId": "get_api_v1_quotes",
        "summary": "Angebote seitenweise lesen",
        "tags": [
          "quotes"
        ],
        "responses": {
          "200": {
            "description": "Angebote seitenweise lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "current_page": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Quote"
                          }
                        },
                        "first_page_url": {
                          "type": "string"
                        },
                        "from": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "last_page": {
                          "type": "integer"
                        },
                        "last_page_url": {
                          "type": "string"
                        },
                        "links": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "label": {
                                "type": "string"
                              },
                              "active": {
                                "type": "boolean"
                              },
                              "page": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "url",
                              "label",
                              "active",
                              "page"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "next_page_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "path": {
                          "type": "string"
                        },
                        "per_page": {
                          "type": "integer"
                        },
                        "prev_page_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "to": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "current_page",
                        "data",
                        "first_page_url",
                        "from",
                        "last_page",
                        "last_page_url",
                        "links",
                        "next_page_url",
                        "path",
                        "per_page",
                        "prev_page_url",
                        "to",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "data enthält die Seite, data.data die Angebote. Fest 30 pro Seite; Liste ohne lines, Detail mit lines. Datumsfelder sind UTC-Mitternachtszeitstempel.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_quotes",
        "summary": "Angebotsentwurf speichern; Positionen vollständig ersetzen",
        "tags": [
          "quotes"
        ],
        "responses": {
          "201": {
            "description": "Angebotsentwurf speichern; Positionen vollständig ersetzen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Auch PATCH verlangt quote_date und lines. valid_until ab quote_date. Maximal 100 Positionen, netto höchstens 1000000000000 Cent. Nur draft änderbar; keine Ausstellung. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quote_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "valid_until": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "intro_text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1800
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "closing_text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "EUR"
                    ]
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "article_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "description": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "detail": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 2000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "quantity": {
                          "type": "number",
                          "exclusiveMinimum": 0,
                          "maximum": 1000000
                        },
                        "unit": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 3
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "unit_price_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 1000000000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "tax_key_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revenue_account_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rate_label": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "quantity"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 100
                  },
                  "recipient_name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_street": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "buyer_reference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_postal_code": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_vat_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "email",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "quote_date",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/quotes/{id}": {
      "get": {
        "operationId": "get_api_v1_quotes_id",
        "summary": "Angebotsfassung mit Positionen lesen",
        "tags": [
          "quotes"
        ],
        "responses": {
          "200": {
            "description": "Angebotsfassung mit Positionen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_api_v1_quotes_id",
        "summary": "Angebotsentwurf speichern; Positionen vollständig ersetzen",
        "tags": [
          "quotes"
        ],
        "responses": {
          "200": {
            "description": "Angebotsentwurf speichern; Positionen vollständig ersetzen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Auch PATCH verlangt quote_date und lines. valid_until ab quote_date. Maximal 100 Positionen, netto höchstens 1000000000000 Cent. Nur draft änderbar; keine Ausstellung. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quote_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "valid_until": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "intro_text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1800
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "closing_text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "EUR"
                    ]
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "article_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "description": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "detail": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 2000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "quantity": {
                          "type": "number",
                          "exclusiveMinimum": 0,
                          "maximum": 1000000
                        },
                        "unit": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 3
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "unit_price_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 1000000000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "tax_key_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revenue_account_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rate_label": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "quantity"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 100
                  },
                  "recipient_name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_street": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "buyer_reference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_country": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_postal_code": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_vat_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "email",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "quote_date",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/quotes/{id}/release": {
      "post": {
        "operationId": "post_api_v1_quotes_id_release",
        "summary": "Angebotsfassung endgültig freigeben und Original speichern",
        "tags": [
          "quotes"
        ],
        "responses": {
          "200": {
            "description": "Angebotsfassung endgültig freigeben und Original speichern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Vollständige Absender-/Empfängeranschrift, gültige Frist, Positionen mit Preis, Steuer und Erlöskonto. Noch keine Rechnung/Buchung. Wiederholte Freigabe liefert bestehende Fassung. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/quotes/{id}/decision": {
      "post": {
        "operationId": "post_api_v1_quotes_id_decision",
        "summary": "Belegte Angebotsentscheidung erfassen",
        "tags": [
          "quotes"
        ],
        "responses": {
          "200": {
            "description": "Belegte Angebotsentscheidung erfassen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Nur released; Datum zwischen Freigabe und heute, Annahme nur innerhalb gültiger Frist. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "accepted",
                      "rejected"
                    ]
                  },
                  "decision_on": {
                    "type": "string",
                    "format": "date"
                  },
                  "decision_source": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "decision",
                  "decision_on",
                  "decision_source"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/quotes/{id}/revision": {
      "post": {
        "operationId": "post_api_v1_quotes_id_revision",
        "summary": "Offenes freigegebenes Angebot durch neue Entwurfsfassung ersetzen",
        "tags": [
          "quotes"
        ],
        "responses": {
          "201": {
            "description": "Offenes freigegebenes Angebot durch neue Entwurfsfassung ersetzen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/quotes/{id}/convert": {
      "post": {
        "operationId": "post_api_v1_quotes_id_convert",
        "summary": "Angenommenes Angebot einmalig in Rechnungsentwurf überführen",
        "tags": [
          "quotes"
        ],
        "responses": {
          "200": {
            "description": "Angenommenes Angebot einmalig in Rechnungsentwurf überführen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceRecord"
                    },
                    "quote_id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "quote_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Leistungstag oder vollständiger Zeitraum. Bereits konvertiert: dieselbe invoice_id. Keine automatische Ausstellung. Die Antwort hat eine andere Form als GET /invoices. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "invoice_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "service_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "service_period_from": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "service_period_to": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "invoice_date"
                ],
                "additionalProperties": false,
                "oneOf": [
                  {
                    "required": [
                      "service_date"
                    ],
                    "not": {
                      "anyOf": [
                        {
                          "required": [
                            "service_period_from"
                          ]
                        },
                        {
                          "required": [
                            "service_period_to"
                          ]
                        }
                      ]
                    }
                  },
                  {
                    "required": [
                      "service_period_from",
                      "service_period_to"
                    ],
                    "not": {
                      "required": [
                        "service_date"
                      ]
                    }
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/quotes/{id}/file": {
      "get": {
        "operationId": "get_api_v1_quotes_id_file",
        "summary": "Gespeichertes Angebots-PDF herunterladen",
        "tags": [
          "quotes"
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Angebots-PDF herunterladen",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entwurf oder unbekannte Fassung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Originalprüfung fehlgeschlagen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/recurring-invoices": {
      "get": {
        "operationId": "get_api_v1_recurring_invoices",
        "summary": "Serien seitenweise lesen",
        "tags": [
          "recurring-invoices"
        ],
        "responses": {
          "200": {
            "description": "Serien seitenweise lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "current_page": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/RecurringInvoice"
                          }
                        },
                        "first_page_url": {
                          "type": "string"
                        },
                        "from": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "last_page": {
                          "type": "integer"
                        },
                        "last_page_url": {
                          "type": "string"
                        },
                        "links": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "label": {
                                "type": "string"
                              },
                              "active": {
                                "type": "boolean"
                              },
                              "page": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "url",
                              "label",
                              "active",
                              "page"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "next_page_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "path": {
                          "type": "string"
                        },
                        "per_page": {
                          "type": "integer"
                        },
                        "prev_page_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "to": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "current_page",
                        "data",
                        "first_page_url",
                        "from",
                        "last_page",
                        "last_page_url",
                        "links",
                        "next_page_url",
                        "path",
                        "per_page",
                        "prev_page_url",
                        "to",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Fest 30 pro Seite. Kalenderanker Europe/Berlin; Monatsende bleibt Monatsende; höchstens 2400 Zyklen.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_recurring_invoices",
        "summary": "Entwurfserie aus eigenem Rechnungsentwurf anlegen",
        "tags": [
          "recurring-invoices"
        ],
        "responses": {
          "201": {
            "description": "Entwurfserie aus eigenem Rechnungsentwurf anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RecurringInvoice"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "starts_on ab heute, ends_on ab starts_on. Quelle muss Entwurf mit Kundenkonto und Positionen sein, keine Abschlags-/Schlussrechnung. Nur mode=draft; Ausgabe noch inaktiv. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "source_invoice_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "starts_on": {
                    "type": "string",
                    "format": "date"
                  },
                  "ends_on": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "interval_months": {
                    "type": "integer",
                    "enum": [
                      1,
                      3,
                      12
                    ]
                  },
                  "billing_timing": {
                    "type": "string",
                    "enum": [
                      "advance",
                      "arrears"
                    ]
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "draft"
                    ]
                  }
                },
                "required": [
                  "name",
                  "source_invoice_id",
                  "starts_on",
                  "interval_months",
                  "billing_timing"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/recurring-invoices/{id}": {
      "get": {
        "operationId": "get_api_v1_recurring_invoices_id",
        "summary": "Serie, Historie, Zustimmung und Vorschau lesen",
        "tags": [
          "recurring-invoices"
        ],
        "responses": {
          "200": {
            "description": "Serie, Historie, Zustimmung und Vorschau lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RecurringInvoice"
                    },
                    "automation": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RecurringAutomation"
                      }
                    },
                    "consent": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "recurring_invoice_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "revision_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "actor_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "tenant_id": {
                              "type": "string"
                            },
                            "mode": {
                              "type": "string",
                              "enum": [
                                "draft",
                                "issue",
                                "send"
                              ]
                            },
                            "version": {
                              "type": "string"
                            },
                            "scope": {
                              "type": "string"
                            },
                            "valid_until": {
                              "type": "string"
                            },
                            "created_at": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "recurring_invoice_id",
                            "revision_id",
                            "actor_id",
                            "tenant_id",
                            "mode",
                            "version",
                            "scope",
                            "valid_until",
                            "created_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SourceJson"
                          },
                          "maxItems": 0
                        }
                      ]
                    },
                    "preview": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 2399
                          },
                          "due_on": {
                            "type": "string",
                            "format": "date"
                          },
                          "service_period_from": {
                            "type": "string",
                            "format": "date"
                          },
                          "service_period_to": {
                            "type": "string",
                            "format": "date"
                          },
                          "revision_id": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "gross_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "index",
                          "due_on",
                          "service_period_from",
                          "service_period_to",
                          "revision_id",
                          "gross_cents"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "missed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 2399
                          },
                          "due_on": {
                            "type": "string",
                            "format": "date"
                          },
                          "service_period_from": {
                            "type": "string",
                            "format": "date"
                          },
                          "service_period_to": {
                            "type": "string",
                            "format": "date"
                          },
                          "revision_id": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "gross_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "index",
                          "due_on",
                          "service_period_from",
                          "service_period_to",
                          "revision_id",
                          "gross_cents"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "supported_modes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "draft"
                        ]
                      }
                    },
                    "interactive_modes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "issue",
                          "send"
                        ]
                      }
                    },
                    "consent_channel": {
                      "type": "string",
                      "enum": [
                        "web"
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "automation",
                    "consent",
                    "preview",
                    "missed",
                    "supported_modes",
                    "interactive_modes",
                    "consent_channel"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Serie fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/recurring-invoices/{id}/revisions": {
      "post": {
        "operationId": "post_api_v1_recurring_invoices_id_revisions",
        "summary": "Zukünftige Serie revisionieren",
        "tags": [
          "recurring-invoices"
        ],
        "responses": {
          "201": {
            "description": "Zukünftige Serie revisionieren",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RecurringInvoice"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "effective_on nach heute und exakt zukünftiger unverbrauchter Rechnungstermin, gleicher Kunde. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_invoice_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "effective_on": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "source_invoice_id",
                  "effective_on"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/recurring-invoices/{id}/{action}": {
      "post": {
        "operationId": "post_api_v1_recurring_invoices_id_action",
        "summary": "Serie aktivieren, pausieren, fortsetzen oder beenden",
        "tags": [
          "recurring-invoices"
        ],
        "responses": {
          "200": {
            "description": "Serie aktivieren, pausieren, fortsetzen oder beenden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RecurringInvoice"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "activate: confirmed erforderlich. pause/end: kein Body. resume: confirmed und catch_up (auch leere Liste); verpasste nicht gewählte Zyklen werden skipped. Vergangenes activate wird wie resume behandelt. Kein REST-Zustimmungsweg für issue/send. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "activate",
                "pause",
                "resume",
                "end"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  },
                  "catch_up": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 2399
                    },
                    "maxItems": 2400,
                    "uniqueItems": true
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/recurring-invoices/{id}/run": {
      "post": {
        "operationId": "post_api_v1_recurring_invoices_id_run",
        "summary": "Einzelnen Zyklus ausdrücklich ausführen",
        "tags": [
          "recurring-invoices"
        ],
        "responses": {
          "200": {
            "description": "Einzelnen Zyklus ausdrücklich ausführen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/RecurringCycle"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Erzeugt höchstens einen Entwurf je Zyklus. Fehlgeschlagene Wiederholung nur bewusst retry. Automatische issue/send benötigt zuvor eigene Webzustimmung und unveränderten Vertrag; siehe automation/consent im Detail. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "index": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2399
                  },
                  "retry": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "index"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/billing": {
      "get": {
        "operationId": "get_api_v1_billing",
        "summary": "Abgeleiteten Abozugang und konfigurierte Nettopreise lesen",
        "tags": [
          "billing"
        ],
        "responses": {
          "200": {
            "description": "Abgeleiteten Abozugang und konfigurierte Nettopreise lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "trial",
                        "active",
                        "overdue",
                        "read_only",
                        "archived"
                      ]
                    },
                    "label": {
                      "type": "string"
                    },
                    "can_write": {
                      "type": "boolean"
                    },
                    "exempt": {
                      "type": "boolean"
                    },
                    "plan": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "monthly",
                            "yearly"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "payment_pending": {
                      "type": "boolean",
                      "description": "Die erste Zahlung des Abos ist noch nicht eingegangen, etwa eine Lastschrift. Das Abo gibt bis dahin keinen Zugang."
                    },
                    "payment_failing": {
                      "type": "boolean"
                    },
                    "payment_due_by": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "trial_ends_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "cancels_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "read_only_until": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "retain_until": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "intro_offer": {
                      "type": "boolean"
                    },
                    "prices": {
                      "type": "object",
                      "properties": {
                        "monthly": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "yearly": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "intro": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        }
                      },
                      "required": [
                        "monthly",
                        "yearly",
                        "intro"
                      ],
                      "additionalProperties": false
                    },
                    "vat_percent": {
                      "type": "integer"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "access",
                    "label",
                    "can_write",
                    "exempt",
                    "plan",
                    "payment_pending",
                    "payment_failing",
                    "payment_due_by",
                    "trial_ends_at",
                    "cancels_at",
                    "read_only_until",
                    "retain_until",
                    "intro_offer",
                    "prices",
                    "vat_percent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Erreichbar auch ohne laufendes Abo."
      }
    },
    "/api/v1/billing/checkout": {
      "post": {
        "operationId": "post_api_v1_billing_checkout",
        "summary": "Abo-checkout-Link anfordern",
        "tags": [
          "billing"
        ],
        "responses": {
          "200": {
            "description": "Abo-checkout-Link anfordern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Mensch öffnet URL; externer Stripe-Vorgang. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plan": {
                    "type": "string",
                    "enum": [
                      "monthly",
                      "yearly"
                    ]
                  }
                },
                "required": [
                  "plan"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/portal": {
      "post": {
        "operationId": "post_api_v1_billing_portal",
        "summary": "Abo-portal-Link anfordern",
        "tags": [
          "billing"
        ],
        "responses": {
          "200": {
            "description": "Abo-portal-Link anfordern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Mensch öffnet URL; externer Stripe-Vorgang. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz."
      }
    },
    "/api/v1/reports/trial-balance": {
      "get": {
        "operationId": "get_api_v1_reports_trial_balance",
        "summary": "Historische Summen- und Saldenliste lesen",
        "tags": [
          "reports"
        ],
        "responses": {
          "200": {
            "description": "Historische Summen- und Saldenliste lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "as_of": {
                      "type": "string",
                      "format": "date"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TrialBalanceRow"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "as_of",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ]
      }
    },
    "/api/v1/reports/open-items": {
      "get": {
        "operationId": "get_api_v1_reports_open_items",
        "summary": "Offene Posten je Partner am Stichtag lesen",
        "tags": [
          "reports"
        ],
        "responses": {
          "200": {
            "description": "Offene Posten je Partner am Stichtag lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "as_of": {
                      "type": "string",
                      "format": "date"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "account_id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "number": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "debtor",
                              "creditor"
                            ]
                          },
                          "open_cents": {
                            "type": "integer",
                            "description": "Ganzzahlige Cent"
                          },
                          "laut_rechnung_bezahlt_cents": {
                            "type": "integer",
                            "description": "Ganzzahlige Cent"
                          },
                          "oldest_date": {
                            "type": "string",
                            "format": "date"
                          },
                          "days_open": {
                            "type": "integer"
                          },
                          "items": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "account_id",
                          "number",
                          "name",
                          "kind",
                          "open_cents",
                          "laut_rechnung_bezahlt_cents",
                          "oldest_date",
                          "days_open",
                          "items"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "as_of",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "debtor",
                "creditor"
              ]
            }
          }
        ]
      }
    },
    "/api/v1/reports/ledger": {
      "get": {
        "operationId": "get_api_v1_reports_ledger",
        "summary": "Kontenblatt ohne Snapshot vorschauen",
        "tags": [
          "reports"
        ],
        "responses": {
          "200": {
            "description": "Kontenblatt ohne Snapshot vorschauen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "summary": {
                          "$ref": "#/components/schemas/LedgerSummary"
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/LedgerRow"
                          }
                        },
                        "page": {
                          "type": "integer"
                        },
                        "per_page": {
                          "const": 50
                        },
                        "generated_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "summary",
                        "rows",
                        "page",
                        "per_page",
                        "generated_at"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "through ab from. Nur festgeschriebene Historie; Anfangssaldo aus gebundenem Jahresvortrag und folgenden Buchungen, sonst aus gespeicherter Historie. Ein Beginn vor dem letzten gültigen Vortrag ergibt 422 an from.",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "through",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000000
            }
          }
        ]
      }
    },
    "/api/v1/reports/ledger-exports": {
      "post": {
        "operationId": "post_api_v1_reports_ledger_exports",
        "summary": "Bewusst unveränderlichen Kontenexport speichern",
        "tags": [
          "reports"
        ],
        "responses": {
          "201": {
            "description": "Bewusst unveränderlichen Kontenexport speichern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "metadata": {
                          "$ref": "#/components/schemas/LedgerMetadata"
                        }
                      },
                      "required": [
                        "id",
                        "metadata"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz. Bei einem Kontenblatt ergibt ein Beginn vor dem letzten gültigen Vortrag 422 an from.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "from": {
                    "type": "string",
                    "format": "date"
                  },
                  "through": {
                    "type": "string",
                    "format": "date"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "ledger",
                      "trial_balance"
                    ]
                  },
                  "confirmed": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "confirmed",
                  "through"
                ],
                "additionalProperties": false,
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "kind": {
                          "const": "ledger"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "account_id",
                        "from"
                      ]
                    }
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/ledger-exports/{id}": {
      "get": {
        "operationId": "get_api_v1_reports_ledger_exports_id",
        "summary": "Exportdaten in Seiten zu 50 lesen",
        "tags": [
          "reports"
        ],
        "responses": {
          "200": {
            "description": "Exportdaten in Seiten zu 50 lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "metadata": {
                          "$ref": "#/components/schemas/LedgerMetadata"
                        },
                        "verification_scope": {
                          "type": "string",
                          "enum": [
                            "legacy-stored-sources; historical-visibility-unprovable",
                            "exact-captured-audit-membership"
                          ]
                        },
                        "page": {
                          "type": "integer"
                        },
                        "per_page": {
                          "const": 50
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/LedgerRow"
                              },
                              {
                                "$ref": "#/components/schemas/TrialBalanceRow"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "metadata",
                        "verification_scope",
                        "page",
                        "per_page",
                        "rows"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Integritätsfehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000000
            }
          }
        ]
      }
    },
    "/api/v1/reports/ledger-exports/{id}/download": {
      "get": {
        "operationId": "get_api_v1_reports_ledger_exports_id_download",
        "summary": "Gespeicherten geprüften Kontenexport herunterladen",
        "tags": [
          "reports"
        ],
        "responses": {
          "200": {
            "description": "Gespeicherten geprüften Kontenexport herunterladen",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Integritäts-/Quellenprüfung gescheitert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültiges Format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "html"
              ]
            },
            "description": "Standard csv; beide als application/octet-stream."
          }
        ]
      }
    },
    "/api/v1/archives/preview": {
      "get": {
        "operationId": "get_api_v1_archives_preview",
        "summary": "Eigenen vollständigen Archivumfang vorschauen",
        "tags": [
          "archives"
        ],
        "responses": {
          "200": {
            "description": "Eigenen vollständigen Archivumfang vorschauen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ArchiveSummary"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "fiscal_year_id setzt Fokus; Archiv bleibt vollständiger klassifizierter Mandantenbestand, keine künstliche Teilarchivierung.",
        "parameters": [
          {
            "name": "fiscal_year_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/archives": {
      "post": {
        "operationId": "post_api_v1_archives",
        "summary": "Archivkopie bewusst asynchron anfordern",
        "tags": [
          "archives"
        ],
        "responses": {
          "202": {
            "description": "Archivkopie bewusst asynchron anfordern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ArchivePackage"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "request_key gehört zur identischen Vorschau und Person. Höchstens ein offener Auftrag; gleiche Anfrage liefert vorhandenen Auftrag. Originale werden nicht gelöscht oder neu versioniert. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fiscal_year_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fingerprint": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "request_key": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "confirmed": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  }
                },
                "required": [
                  "fingerprint",
                  "request_key",
                  "confirmed"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/archives/{uuid}": {
      "get": {
        "operationId": "get_api_v1_archives_uuid",
        "summary": "Archivstatus einschließlich Ablauf lesen",
        "tags": [
          "archives"
        ],
        "responses": {
          "200": {
            "description": "Archivstatus einschließlich Ablauf lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ArchivePackage"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte/ungültige UUID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/archives/{uuid}/download": {
      "get": {
        "operationId": "get_api_v1_archives_uuid_download",
        "summary": "Hashgeprüfte ZIP-Archivkopie herunterladen",
        "tags": [
          "archives"
        ],
        "responses": {
          "200": {
            "description": "Hashgeprüfte ZIP-Archivkopie herunterladen",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte UUID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Nicht bereit, Kopiensperre oder Integritätsfehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Kopie abgelaufen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/euer/reports": {
      "post": {
        "operationId": "post_api_v1_euer_reports",
        "summary": "Fachliche EÜR-Auswertung als Snapshot erstellen",
        "tags": [
          "euer"
        ],
        "responses": {
          "201": {
            "description": "Fachliche EÜR-Auswertung als Snapshot erstellen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EuerReport"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Nicht unabhängige Transaktion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Fachprofil oder Berichtsgrenze",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Einzelunternehmen, angelegtes Kalenderjahr 2025 bis 2027; maximal 10000 Buchungen, 100000 Zeilen, 50000 Zuordnungen und 1000000000 Cent je Buchung. Kein ELSTER-/amtlicher Formularvertrag. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "year": {
                    "type": "integer",
                    "enum": [
                      2025,
                      2026,
                      2027
                    ]
                  }
                },
                "required": [
                  "year"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/euer/reports/{id}": {
      "get": {
        "operationId": "get_api_v1_euer_reports_id",
        "summary": "Historischen EÜR-Snapshot mit stale-Hinweis lesen",
        "tags": [
          "euer"
        ],
        "responses": {
          "200": {
            "description": "Historischen EÜR-Snapshot mit stale-Hinweis lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EuerReport"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Snapshot-Hash falsch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/euer/reports/{id}/revisions": {
      "post": {
        "operationId": "post_api_v1_euer_reports_id_revisions",
        "summary": "Belegte EÜR-Klärung oder Ergänzung anhängen",
        "tags": [
          "euer"
        ],
        "responses": {
          "201": {
            "description": "Belegte EÜR-Klärung oder Ergänzung anhängen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "revision_id": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "revision_id"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Integrität/Transaktion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Veralteter Quellenstand oder unzulässige Klärung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "case: vorhandener Ereignisschlüssel; withdrawal: Schlüssel einer Klärung, die dieser Bericht als orphaned_resolution, duplicate_resolution oder asset_resolution meldet; mapping: account:<id>; supplement: manual:<1–80 Buchstaben/Ziffern/_/->. Snapshot bleibt unverändert, neue Auswertung für neue Klärung. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "case",
                      "supplement",
                      "mapping",
                      "withdrawal"
                    ],
                    "description": "`withdrawal` hebt eine Klärung auf, die der Bericht als `orphaned_resolution`, `duplicate_resolution` oder `asset_resolution` meldet, und braucht weder `rows` noch `role`."
                  },
                  "report_year": {
                    "type": "integer",
                    "enum": [
                      2025,
                      2026,
                      2027
                    ]
                  },
                  "source_key": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 2000
                  },
                  "origin": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 2000
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "row": {
                          "type": "string",
                          "enum": [
                            "revenue",
                            "output_vat",
                            "vat_refund",
                            "goods",
                            "staff",
                            "rent",
                            "other",
                            "input_vat",
                            "vat_paid",
                            "depreciation",
                            "excluded"
                          ]
                        },
                        "cents": {
                          "type": "integer",
                          "minimum": -1000000000,
                          "maximum": 1000000000
                        }
                      },
                      "required": [
                        "row",
                        "cents"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "maxItems": 12
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "revenue",
                      "goods",
                      "staff",
                      "rent",
                      "other",
                      "excluded",
                      "cash"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "report_year",
                  "source_key",
                  "reason",
                  "origin"
                ],
                "additionalProperties": false,
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "kind": {
                          "const": "mapping"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "role"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "kind": {
                          "enum": [
                            "case",
                            "supplement"
                          ]
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "rows"
                      ]
                    }
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/euer/reports/{id}/download": {
      "get": {
        "operationId": "get_api_v1_euer_reports_id_download",
        "summary": "Historische EÜR als gespeichertes HTML oder JSON exportieren",
        "tags": [
          "euer"
        ],
        "responses": {
          "200": {
            "description": "Historische EÜR als gespeichertes HTML oder JSON exportieren",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "snapshot_hash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "source_hash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "snapshot": {
                      "$ref": "#/components/schemas/EuerSnapshot"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "snapshot_hash",
                    "source_hash",
                    "snapshot"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Integrität",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "html",
                "json"
              ]
            },
            "description": "Standard html"
          }
        ]
      }
    },
    "/api/v1/guv/reports": {
      "post": {
        "operationId": "post_api_v1_guv_reports",
        "summary": "Laufende GuV als Snapshot erstellen",
        "tags": [
          "guv"
        ],
        "responses": {
          "201": {
            "description": "Laufende GuV als Snapshot erstellen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GuvReport"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Einzelunternehmen, SKR03/04, Soll/Ist; jeder Zeitraum innerhalb eines angelegten Kalenderjahrs 2025 bis 2027. Gegenperiode muss existieren; keine Nullannahme. Kein Jahresabschluss. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "format": "date"
                  },
                  "to": {
                    "type": "string",
                    "format": "date"
                  },
                  "compare": {
                    "type": "string",
                    "enum": [
                      "none",
                      "previous_year",
                      "previous_period"
                    ]
                  }
                },
                "required": [
                  "from",
                  "to",
                  "compare"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/guv/reports/{id}": {
      "get": {
        "operationId": "get_api_v1_guv_reports_id",
        "summary": "GuV-Snapshot und Veraltungsstatus lesen",
        "tags": [
          "guv"
        ],
        "responses": {
          "200": {
            "description": "GuV-Snapshot und Veraltungsstatus lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GuvReport"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Integrität",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/guv/reports/{id}/revisions": {
      "post": {
        "operationId": "post_api_v1_guv_reports_id_revisions",
        "summary": "Belegte GuV-Kontenzuordnung anhängen",
        "tags": [
          "guv"
        ],
        "responses": {
          "201": {
            "description": "Belegte GuV-Kontenzuordnung anhängen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "revision_id": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "revision_id"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Integrität",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Veralteter/unzulässiger Stand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "row_key": {
                    "type": "string",
                    "enum": [
                      "sales",
                      "inventory",
                      "own_work",
                      "other_income",
                      "materials",
                      "services",
                      "wages",
                      "social",
                      "depreciation",
                      "current_depreciation",
                      "other_expense",
                      "participation_income",
                      "securities_income",
                      "interest_income",
                      "financial_depreciation",
                      "interest_expense",
                      "income_tax",
                      "other_tax"
                    ]
                  },
                  "snapshot_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 2000
                  },
                  "origin": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "account_id",
                  "row_key",
                  "snapshot_hash",
                  "reason",
                  "origin"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/guv/reports/{id}/download": {
      "post": {
        "operationId": "post_api_v1_guv_reports_id_download",
        "summary": "Vertraulichen GuV-Download bewusst anfordern",
        "tags": [
          "guv"
        ],
        "responses": {
          "200": {
            "description": "Vertraulichen GuV-Download bewusst anfordern",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "source_hash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "snapshot_hash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "snapshot": {
                      "$ref": "#/components/schemas/GuvSnapshot"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "source_hash",
                    "snapshot_hash",
                    "snapshot"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Hash falsch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Veraltet ohne historical oder Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Stale-Snapshot nur mit historical=true. confidential wird falls vorhanden als accepted geprüft. Hashheader X-Content-SHA256. Protokollierter Download. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "html",
                      "csv",
                      "json"
                    ]
                  },
                  "confidential": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  },
                  "snapshot_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "historical": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "format",
                  "snapshot_hash"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/datev/preview": {
      "post": {
        "operationId": "post_api_v1_datev_preview",
        "summary": "DATEV-Paketvorschau mit Hindernissen erstellen",
        "tags": [
          "datev"
        ],
        "responses": {
          "200": {
            "description": "DATEV-Paketvorschau mit Hindernissen erstellen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DatevPreview"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "to ab from und innerhalb Wirtschaftsjahr. Explizite Kontenautomatik je Konto. Keine externe DATEV-Annahme; nur festgeschriebene Buchungen, maximal 99999 Exportbuchungen. Unterschiedliche Beleg-/Buchungstage oder Mehrrechnungszahlung im Startprofil gesperrt. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fiscal_year_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "from": {
                    "type": "string",
                    "format": "date"
                  },
                  "to": {
                    "type": "string",
                    "format": "date"
                  },
                  "advisor": {
                    "type": "integer",
                    "minimum": 1001,
                    "maximum": 9999999
                  },
                  "client": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 99999
                  },
                  "account_length": {
                    "type": "integer",
                    "minimum": 4,
                    "maximum": 8
                  },
                  "account_modes": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "manual",
                                "automatic700",
                                "automatic1900"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "manual",
                                "automatic700",
                                "automatic1900"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "maxItems": 0
                      }
                    ]
                  }
                },
                "required": [
                  "fiscal_year_id",
                  "from",
                  "to",
                  "advisor",
                  "client",
                  "account_length",
                  "account_modes"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/datev/packages": {
      "post": {
        "operationId": "post_api_v1_datev_packages",
        "summary": "DATEV-Paket an geprüfte Vorschau gebunden anfordern",
        "tags": [
          "datev"
        ],
        "responses": {
          "202": {
            "description": "DATEV-Paket an geprüfte Vorschau gebunden anfordern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DatevPackageStatus"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Keine Hindernisse und identischer Fingerprint erforderlich. Paketkopie sieben Tage. Kein automatischer Upload zu DATEV. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fiscal_year_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "from": {
                    "type": "string",
                    "format": "date"
                  },
                  "to": {
                    "type": "string",
                    "format": "date"
                  },
                  "advisor": {
                    "type": "integer",
                    "minimum": 1001,
                    "maximum": 9999999
                  },
                  "client": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 99999
                  },
                  "account_length": {
                    "type": "integer",
                    "minimum": 4,
                    "maximum": 8
                  },
                  "account_modes": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "manual",
                                "automatic700",
                                "automatic1900"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "manual",
                                "automatic700",
                                "automatic1900"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "maxItems": 0
                      }
                    ]
                  },
                  "fingerprint": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  }
                },
                "required": [
                  "fiscal_year_id",
                  "from",
                  "to",
                  "advisor",
                  "client",
                  "account_length",
                  "account_modes",
                  "fingerprint"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/datev/packages/{id}": {
      "get": {
        "operationId": "get_api_v1_datev_packages_id",
        "summary": "DATEV-Paketstatus lesen",
        "tags": [
          "datev"
        ],
        "responses": {
          "200": {
            "description": "DATEV-Paketstatus lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DatevPackageStatus"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/datev/packages/{id}/download": {
      "get": {
        "operationId": "get_api_v1_datev_packages_id_download",
        "summary": "Geprüftes DATEV-ZIP herunterladen",
        "tags": [
          "datev"
        ],
        "responses": {
          "200": {
            "description": "Geprüftes DATEV-ZIP herunterladen",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Noch nicht bereit oder Integritätsfehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Sieben-Tage-Kopie abgelaufen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/assets": {
      "get": {
        "operationId": "get_api_v1_assets",
        "summary": "Anlagen und Kontenabgleich lesen",
        "tags": [
          "assets"
        ],
        "responses": {
          "200": {
            "description": "Anlagen und Kontenabgleich lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "assets": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FixedAsset"
                          }
                        },
                        "reconciliation": {
                          "$ref": "#/components/schemas/AssetReconciliation"
                        },
                        "limits": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "assets",
                        "reconciliation",
                        "limits"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": ""
      }
    },
    "/api/v1/assets/register": {
      "get": {
        "operationId": "get_api_v1_assets_register",
        "summary": "Anlagenverzeichnis und Abstimmung zum Stichtag lesen",
        "tags": [
          "assets"
        ],
        "responses": {
          "200": {
            "description": "Anlagenverzeichnis zum Stichtag",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetRegister"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Stichtag, ohne Angabe heute."
          }
        ]
      }
    },
    "/api/v1/assets/{id}": {
      "get": {
        "operationId": "get_api_v1_assets_id",
        "summary": "Anlagenkarte samt unveränderlicher Historie lesen",
        "tags": [
          "assets"
        ],
        "responses": {
          "200": {
            "description": "Anlagenkarte samt unveränderlicher Historie lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssetCard"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/assets/actions": {
      "post": {
        "operationId": "post_api_v1_assets_actions",
        "summary": "Explizite Anlagenaktion ausführen",
        "tags": [
          "assets"
        ],
        "responses": {
          "200": {
            "description": "Explizite Anlagenaktion ausführen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "parameters": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                "origin": {
                                  "type": "string",
                                  "enum": [
                                    "new",
                                    "linked",
                                    "opening"
                                  ]
                                },
                                "acquired_on": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "commissioned_on": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "opening_on": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "cost_cents": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000000000
                                },
                                "prior_depreciation_cents": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "opening_book_cents": {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                "useful_years": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 100
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "linear"
                                  ]
                                },
                                "profile": {
                                  "type": "string",
                                  "enum": [
                                    "movable-common-basis"
                                  ]
                                },
                                "asset_account_id": {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                "expense_account_id": {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                "document_id": {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                "acquisition_entry_id": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "counter_account_id": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "supersedes_id": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "basis_reason": {
                                  "type": "string",
                                  "minLength": 10,
                                  "maxLength": 2000
                                }
                              },
                              "required": [
                                "name",
                                "origin",
                                "acquired_on",
                                "commissioned_on",
                                "opening_on",
                                "cost_cents",
                                "prior_depreciation_cents",
                                "opening_book_cents",
                                "useful_years",
                                "method",
                                "profile",
                                "asset_account_id",
                                "expense_account_id",
                                "document_id",
                                "acquisition_entry_id",
                                "counter_account_id",
                                "supersedes_id",
                                "basis_reason"
                              ],
                              "additionalProperties": false
                            },
                            "rule": {
                              "type": "object",
                              "properties": {
                                "version": {
                                  "type": "string"
                                },
                                "source": {
                                  "type": "string"
                                },
                                "source_sha256": {
                                  "type": "string"
                                },
                                "checked_on": {
                                  "type": "string"
                                },
                                "rounding": {
                                  "type": "string"
                                },
                                "limits": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "version",
                                "source",
                                "source_sha256",
                                "checked_on",
                                "rounding",
                                "limits"
                              ],
                              "additionalProperties": false
                            },
                            "periods": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/AssetPeriod"
                              }
                            },
                            "sources": {
                              "type": "object",
                              "properties": {
                                "asset_account": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "number": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "chart": {
                                      "type": "string"
                                    },
                                    "category_code": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "number",
                                    "name",
                                    "type",
                                    "chart",
                                    "category_code"
                                  ],
                                  "additionalProperties": false
                                },
                                "expense_account": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "number": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "chart": {
                                      "type": "string"
                                    },
                                    "category_code": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "number",
                                    "name",
                                    "type",
                                    "chart",
                                    "category_code"
                                  ],
                                  "additionalProperties": false
                                },
                                "document": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "sha256": {
                                      "type": "string",
                                      "pattern": "^[a-f0-9]{64}$"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "sha256"
                                  ],
                                  "additionalProperties": false
                                },
                                "counter_account": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "number": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    },
                                    "chart": {
                                      "type": "string"
                                    },
                                    "category_code": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "number",
                                    "name",
                                    "type",
                                    "chart",
                                    "category_code"
                                  ],
                                  "additionalProperties": false
                                },
                                "entry": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "entry_number": {
                                      "anyOf": [
                                        {
                                          "type": "integer"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "booking_date": {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    "lines": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "integer",
                                            "minimum": 1
                                          },
                                          "account_id": {
                                            "type": "integer"
                                          },
                                          "debit_cents": {
                                            "type": "integer"
                                          },
                                          "credit_cents": {
                                            "type": "integer"
                                          },
                                          "position": {
                                            "type": "integer"
                                          },
                                          "description": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "tax_key_id": {
                                            "anyOf": [
                                              {
                                                "type": "integer"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "cost_center_id": {
                                            "type": [
                                              "integer",
                                              "null"
                                            ],
                                            "minimum": 1
                                          },
                                          "cost_center_source_line_id": {
                                            "type": [
                                              "integer",
                                              "null"
                                            ],
                                            "minimum": 1
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "account_id",
                                          "debit_cents",
                                          "credit_cents",
                                          "position",
                                          "description",
                                          "tax_key_id"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "entry_number",
                                    "booking_date",
                                    "lines"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "asset_account",
                                "expense_account",
                                "document"
                              ],
                              "additionalProperties": false
                            },
                            "tenant_id": {
                              "type": "string"
                            },
                            "fingerprint": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$"
                            }
                          },
                          "required": [
                            "parameters",
                            "rule",
                            "periods",
                            "sources",
                            "tenant_id",
                            "fingerprint"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "$ref": "#/components/schemas/FixedAsset"
                        },
                        {
                          "$ref": "#/components/schemas/AssetBatchPreview"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "approval_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "preview": {
                              "$ref": "#/components/schemas/AssetBatchPreview"
                            }
                          },
                          "required": [
                            "approval_id",
                            "preview"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "run_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "repeated": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "run_id",
                            "repeated"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "reversal_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "repeated": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "reversal_id",
                            "repeated"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "closure_id": {
                              "type": "integer",
                              "minimum": 1
                            }
                          },
                          "required": [
                            "closure_id"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "$ref": "#/components/schemas/AssetCard"
                        },
                        {
                          "$ref": "#/components/schemas/AssetReconciliation"
                        },
                        {
                          "$ref": "#/components/schemas/AssetRegister"
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Nur bewegliche Sachanlagen linear/volle Jahre, gemeinsamer Wertansatz. 1900-01-01 bis vor 2200-01-01; Inbetriebnahme im Anschaffungsmonat. cost=prior+opening exakt nach Plan, Monatsbetrag mindestens 1 Cent. new: geeignetes Gegenkonto, keine bereits verknüpfte Anschaffung; linked/opening: vorhandene belegte Festschreibung. Vorschau/Fingerprint bestätigen. Keine GWG/Gebäude/Sonder-AfA; reverse/close/dispose sind endgültige Fachaktionen. dispose bucht den Restbuchwert gegen counter_account_id und schliesst die Anlage in einem Schritt. Eine Korrekturfassung mit origin=opening, supersedes_id und counter_account_id ohne acquisition_entry_id bucht ihre Eröffnung bei create selbst. register und reconcile lesen zum Stichtag as_of. Nichts läuft von selbst. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "preview"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "origin": {
                        "type": "string",
                        "enum": [
                          "new",
                          "linked",
                          "opening"
                        ]
                      },
                      "acquired_on": {
                        "type": "string",
                        "format": "date"
                      },
                      "commissioned_on": {
                        "type": "string",
                        "format": "date"
                      },
                      "opening_on": {
                        "type": "string",
                        "format": "date"
                      },
                      "cost_cents": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1000000000000
                      },
                      "prior_depreciation_cents": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "opening_book_cents": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "useful_years": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "linear"
                        ]
                      },
                      "profile": {
                        "type": "string",
                        "enum": [
                          "movable-common-basis"
                        ]
                      },
                      "asset_account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "expense_account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "document_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "acquisition_entry_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "counter_account_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "supersedes_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "basis_reason": {
                        "type": "string",
                        "minLength": 10,
                        "maxLength": 2000
                      }
                    },
                    "required": [
                      "operation",
                      "name",
                      "origin",
                      "acquired_on",
                      "commissioned_on",
                      "opening_on",
                      "cost_cents",
                      "prior_depreciation_cents",
                      "opening_book_cents",
                      "useful_years",
                      "method",
                      "profile",
                      "asset_account_id",
                      "expense_account_id",
                      "document_id",
                      "basis_reason"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "create"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "origin": {
                        "type": "string",
                        "enum": [
                          "new",
                          "linked",
                          "opening"
                        ]
                      },
                      "acquired_on": {
                        "type": "string",
                        "format": "date"
                      },
                      "commissioned_on": {
                        "type": "string",
                        "format": "date"
                      },
                      "opening_on": {
                        "type": "string",
                        "format": "date"
                      },
                      "cost_cents": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1000000000000
                      },
                      "prior_depreciation_cents": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "opening_book_cents": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "useful_years": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "linear"
                        ]
                      },
                      "profile": {
                        "type": "string",
                        "enum": [
                          "movable-common-basis"
                        ]
                      },
                      "asset_account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "expense_account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "document_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "acquisition_entry_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "counter_account_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "supersedes_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "basis_reason": {
                        "type": "string",
                        "minLength": 10,
                        "maxLength": 2000
                      },
                      "request_key": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "fingerprint": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "confirmed": {
                        "const": true
                      }
                    },
                    "required": [
                      "operation",
                      "name",
                      "origin",
                      "acquired_on",
                      "commissioned_on",
                      "opening_on",
                      "cost_cents",
                      "prior_depreciation_cents",
                      "opening_book_cents",
                      "useful_years",
                      "method",
                      "profile",
                      "asset_account_id",
                      "expense_account_id",
                      "document_id",
                      "basis_reason",
                      "request_key",
                      "fingerprint",
                      "confirmed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "batch_preview"
                        ]
                      },
                      "ids": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "minItems": 1,
                        "maxItems": 100,
                        "uniqueItems": true
                      },
                      "through": {
                        "type": "string",
                        "pattern": "^[0-9]{4}-[0-9]{2}$"
                      }
                    },
                    "required": [
                      "operation",
                      "ids",
                      "through"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "approve"
                        ]
                      },
                      "ids": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "minItems": 1,
                        "maxItems": 100,
                        "uniqueItems": true
                      },
                      "through": {
                        "type": "string",
                        "pattern": "^[0-9]{4}-[0-9]{2}$"
                      },
                      "fingerprint": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "confirmed": {
                        "const": true
                      }
                    },
                    "required": [
                      "operation",
                      "ids",
                      "through",
                      "fingerprint",
                      "confirmed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "run"
                        ]
                      },
                      "approval_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "confirmed": {
                        "const": true
                      }
                    },
                    "required": [
                      "operation",
                      "approval_id",
                      "confirmed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "reverse"
                        ]
                      },
                      "posting_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "reason": {
                        "type": "string",
                        "minLength": 10,
                        "maxLength": 2000
                      },
                      "confirmed": {
                        "const": true
                      }
                    },
                    "required": [
                      "operation",
                      "posting_id",
                      "reason",
                      "confirmed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "close"
                        ]
                      },
                      "asset_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "reason": {
                        "type": "string",
                        "minLength": 10,
                        "maxLength": 2000
                      },
                      "confirmed": {
                        "const": true
                      }
                    },
                    "required": [
                      "operation",
                      "asset_id",
                      "entry_id",
                      "reason",
                      "confirmed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "card"
                        ]
                      },
                      "asset_id": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "required": [
                      "operation",
                      "asset_id"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "reconcile"
                        ]
                      },
                      "as_of": {
                        "type": "string",
                        "format": "date",
                        "description": "Stichtag von 1900-01-01 bis vor 2200-01-01, ohne Angabe heute."
                      }
                    },
                    "required": [
                      "operation"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "dispose"
                        ]
                      },
                      "asset_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "disposal_on": {
                        "type": "string",
                        "format": "date"
                      },
                      "counter_account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "reason": {
                        "type": "string",
                        "minLength": 10,
                        "maxLength": 2000
                      },
                      "confirmed": {
                        "type": "boolean",
                        "const": true
                      }
                    },
                    "required": [
                      "operation",
                      "asset_id",
                      "disposal_on",
                      "counter_account_id",
                      "reason",
                      "confirmed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "operation": {
                        "type": "string",
                        "enum": [
                          "register"
                        ]
                      },
                      "as_of": {
                        "type": "string",
                        "format": "date",
                        "description": "Stichtag von 1900-01-01 bis vor 2200-01-01, ohne Angabe heute."
                      }
                    },
                    "required": [
                      "operation"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/assets/{id}/download": {
      "get": {
        "operationId": "get_api_v1_assets_id_download",
        "summary": "Anlagenkarte als HTML oder JSON herunterladen",
        "tags": [
          "assets"
        ],
        "responses": {
          "200": {
            "description": "Anlagenkarte als HTML oder JSON herunterladen",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetCard"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ]
            },
            "description": "json wählt JSON, jeder andere/fehlende Wert HTML."
          }
        ]
      }
    },
    "/api/v1/invoices/{id}/mail-preview": {
      "post": {
        "operationId": "post_api_v1_invoices_id_mail_preview",
        "summary": "Rechnungsversand ausdrücklich vorschauen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Rechnungsversand ausdrücklich vorschauen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceMailPreview"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Nur ausgestellte intakte Originale. XML-Altbeleg verlangt include_xml. Noch keine Mail. from/reply_to müssen gültig sein; ungeeignete Mailtransporte werden abgewiesen. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipient": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 200
                  },
                  "include_xml": {
                    "type": "boolean",
                    "description": "Ohne Angabe gilt der Standard des Ausgabeprofils: im strukturierten Profil mit XML, sonst ohne."
                  },
                  "resend": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "recipient"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/invoices/{id}/mail": {
      "post": {
        "operationId": "post_api_v1_invoices_id_mail",
        "summary": "Geprüften Versand verbindlich beauftragen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "202": {
            "description": "Geprüften Versand verbindlich beauftragen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "delivery_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "delivery_id"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "15-Minuten-Token an Mandant/Person/Original/Empfänger gebunden. 202 bedeutet Auftrag, nicht Zustellung. Nach unklarer Übergabe nicht blind wiederholen; history prüfen. Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Ohne Schlüssel bleibt dieser Legacypfad optional; Idempotency-Policy: legacy-optional; required-path=\"/api/v1/idempotent\". Quittungsheader sind nur nach erfolgreicher Reservierung vorhanden.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmation": {
                    "type": "string"
                  },
                  "confirmed": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  }
                },
                "required": [
                  "confirmation",
                  "confirmed"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "x-idempotency": {
          "operation": "invoice.mail",
          "key_required": false,
          "contract": "summator-idempotency/1"
        }
      },
      "get": {
        "operationId": "get_api_v1_invoices_id_mail",
        "summary": "Vollständige Versandhistorie lesen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Vollständige Versandhistorie lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InvoiceMailHistory"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "deliveries"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Rechnung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/invoices/{id}/mail/{delivery}/resume": {
      "post": {
        "operationId": "post_api_v1_invoices_id_mail_delivery_resume",
        "summary": "Bestehenden Versandauftrag kontrolliert fortsetzen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "202": {
            "description": "Bestehenden Versandauftrag kontrolliert fortsetzen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "delivery_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "delivery_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Vorhandener Auftrag, kein neues Original/keine neue Rechnung. Nur zulässiger Status und gleiche Person; unklare Übergabe zuerst prüfen. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "delivery",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/reminders": {
      "get": {
        "operationId": "get_api_v1_reminders",
        "summary": "Überfällige eindeutige Forderungen und Prüfgruppe lesen",
        "tags": [
          "reminders"
        ],
        "responses": {
          "200": {
            "description": "Überfällige eindeutige Forderungen und Prüfgruppe lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "eligible": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReminderState"
                      }
                    },
                    "review": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "invoice_id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "number": {
                            "type": "string"
                          },
                          "recipient_name": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "invoice_id",
                          "number",
                          "recipient_name",
                          "reason"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "eligible",
                    "review"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": ""
      }
    },
    "/api/v1/invoices/{id}/reminders": {
      "get": {
        "operationId": "get_api_v1_invoices_id_reminders",
        "summary": "Mahn- und Erinnerungshistorie einer Rechnung lesen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Mahn- und Erinnerungshistorie einer Rechnung lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "letters": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReminderLetter"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "letters"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Rechnung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/invoices/{id}/reminders/preview": {
      "post": {
        "operationId": "post_api_v1_invoices_id_reminders_preview",
        "summary": "Zahlungserinnerung nach bewusster Forderungsprüfung entwerfen",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Zahlungserinnerung nach bewusster Forderungsprüfung entwerfen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "created"
                      ]
                    },
                    "content": {
                      "$ref": "#/components/schemas/ReminderContent"
                    },
                    "confirmation": {
                      "type": "string"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "status",
                    "content",
                    "confirmation"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "deadline nach heute; disputed muss false sein. Nur überfällige intakte Rechnung mit eindeutigem positivem offenen Posten. Keine unzugeordneten Zahlungen oder Zahlungsstornos. Vorschau speichert kurzlebigen Entwurf, keine Freigabe/Mail. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stage": {
                    "type": "string",
                    "enum": [
                      "reminder",
                      "first",
                      "second"
                    ]
                  },
                  "deadline": {
                    "type": "string",
                    "format": "date"
                  },
                  "checked": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  },
                  "disputed": {
                    "type": "boolean"
                  },
                  "text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 6000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "stage",
                  "deadline",
                  "checked",
                  "disputed"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/reminders/{letter}/release": {
      "post": {
        "operationId": "post_api_v1_reminders_letter_release",
        "summary": "Erinnerung verbindlich freigeben",
        "tags": [
          "reminders"
        ],
        "responses": {
          "200": {
            "description": "Erinnerung verbindlich freigeben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "letter_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "letter_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Token 15 Minuten, gleiche Person/Stand/Tag. Empfänger, Frist, Forderung und Historie werden erneut geprüft. Eigene UUID, keine Rechnungsnummer oder Buchung. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "letter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmation": {
                    "type": "string"
                  },
                  "confirmed": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  }
                },
                "required": [
                  "confirmation",
                  "confirmed"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/reminders/{letter}/send": {
      "post": {
        "operationId": "post_api_v1_reminders_letter_send",
        "summary": "Erinnerung bewusst versenden",
        "tags": [
          "reminders"
        ],
        "responses": {
          "202": {
            "description": "Erinnerung bewusst versenden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "letter_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "letter_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Token 15 Minuten, gleiche Person/Stand/Tag. Empfänger, Frist, Forderung und Historie werden erneut geprüft. Eigene UUID, keine Rechnungsnummer oder Buchung. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "letter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmation": {
                    "type": "string"
                  },
                  "confirmed": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  }
                },
                "required": [
                  "confirmation",
                  "confirmed"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/reminders/{letter}/mail-preview": {
      "post": {
        "operationId": "post_api_v1_reminders_letter_mail_preview",
        "summary": "Versand eines freigegebenen Schreibens vorschauen",
        "tags": [
          "reminders"
        ],
        "responses": {
          "200": {
            "description": "Versand eines freigegebenen Schreibens vorschauen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "letter_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "recipient": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "street": {
                          "type": "string"
                        },
                        "postal_code": {
                          "type": "string"
                        },
                        "city": {
                          "type": "string"
                        },
                        "country": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "street",
                        "postal_code",
                        "city",
                        "country",
                        "email"
                      ],
                      "additionalProperties": false
                    },
                    "from": {
                      "type": "string"
                    },
                    "reply_to": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "body": {
                      "type": "string"
                    },
                    "open_cents": {
                      "type": "integer",
                      "description": "Ganzzahlige Cent"
                    },
                    "deadline": {
                      "type": "string",
                      "format": "date"
                    },
                    "pdf_hash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "confirmation": {
                      "type": "string"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "letter_id",
                    "recipient",
                    "from",
                    "reply_to",
                    "subject",
                    "body",
                    "open_cents",
                    "deadline",
                    "pdf_hash",
                    "confirmation"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": " Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "parameters": [
          {
            "name": "letter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/reminders/{letter}/file": {
      "get": {
        "operationId": "get_api_v1_reminders_letter_file",
        "summary": "Gespeichertes Erinnerungs-PDF herunterladen",
        "tags": [
          "reminders"
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Erinnerungs-PDF herunterladen",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Schreiben fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Integritätsprüfung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "",
        "parameters": [
          {
            "name": "letter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/reconciliation": {
      "get": {
        "operationId": "get_api_v1_reconciliation",
        "summary": "Vorschlagspaare und unverpaarte Ressourcen lesen",
        "tags": [
          "reconciliation"
        ],
        "responses": {
          "200": {
            "description": "Vorschlagspaare und unverpaarte Ressourcen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "pairs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "posten",
                                  "beleg"
                                ]
                              },
                              "certain": {
                                "type": "boolean"
                              },
                              "manual": {
                                "type": "boolean"
                              },
                              "decision_revision": {
                                "type": "integer"
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "amount_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              },
                              "left": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "posten"
                                        ]
                                      },
                                      "line_id": {
                                        "type": "integer",
                                        "minimum": 1
                                      },
                                      "account_id": {
                                        "type": "integer",
                                        "minimum": 1
                                      },
                                      "account": {
                                        "type": "string"
                                      },
                                      "entry_number": {
                                        "anyOf": [
                                          {
                                            "type": "integer"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "booking_date": {
                                        "type": "string",
                                        "format": "date"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "open_cents": {
                                        "type": "integer",
                                        "description": "Ganzzahlige Cent"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "line_id",
                                      "account_id",
                                      "account",
                                      "entry_number",
                                      "booking_date",
                                      "description",
                                      "open_cents"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "beleg"
                                        ]
                                      },
                                      "document_id": {
                                        "type": "integer",
                                        "minimum": 1
                                      },
                                      "name": {
                                        "type": "string"
                                      },
                                      "issuer_name": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "invoice_number": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "account": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "account_number": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "account_name": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "account_reason": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "tax_key": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "issued_on": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "format": "date"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "gross_cents": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "description": "Ganzzahlige Cent"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "account_id": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 1
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "tax_key_id": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 1
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "document_id",
                                      "name",
                                      "issuer_name",
                                      "invoice_number",
                                      "account",
                                      "account_number",
                                      "account_name",
                                      "account_reason",
                                      "tax_key",
                                      "issued_on",
                                      "gross_cents",
                                      "account_id",
                                      "tax_key_id"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "transaction": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "integer",
                                    "minimum": 1
                                  },
                                  "booked_on": {
                                    "type": "string",
                                    "format": "date"
                                  },
                                  "amount_cents": {
                                    "type": "integer",
                                    "description": "Ganzzahlige Cent"
                                  },
                                  "counterparty_name": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "counterparty_iban": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "bank_account": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "purpose": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "booked_on",
                                  "amount_cents",
                                  "counterparty_name",
                                  "counterparty_iban",
                                  "bank_account",
                                  "purpose"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "key",
                              "kind",
                              "certain",
                              "manual",
                              "decision_revision",
                              "reasons",
                              "amount_cents",
                              "left",
                              "transaction"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "posten"
                                ]
                              },
                              "line_id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "account_id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "account": {
                                "type": "string"
                              },
                              "entry_number": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "booking_date": {
                                "type": "string",
                                "format": "date"
                              },
                              "description": {
                                "type": "string"
                              },
                              "open_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              }
                            },
                            "required": [
                              "type",
                              "line_id",
                              "account_id",
                              "account",
                              "entry_number",
                              "booking_date",
                              "description",
                              "open_cents"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "beleg"
                                ]
                              },
                              "document_id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "issuer_name": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "invoice_number": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "account": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "account_number": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "account_name": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "account_reason": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "tax_key": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "issued_on": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "gross_cents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "description": "Ganzzahlige Cent"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "account_id": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "tax_key_id": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 1
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "type",
                              "document_id",
                              "name",
                              "issuer_name",
                              "invoice_number",
                              "account",
                              "account_number",
                              "account_name",
                              "account_reason",
                              "tax_key",
                              "issued_on",
                              "gross_cents",
                              "account_id",
                              "tax_key_id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "transactions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "booked_on": {
                                "type": "string",
                                "format": "date"
                              },
                              "amount_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              },
                              "counterparty_name": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "counterparty_iban": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "bank_account": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "purpose": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "booked_on",
                              "amount_cents",
                              "counterparty_name",
                              "counterparty_iban",
                              "bank_account",
                              "purpose"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "pairs",
                        "items",
                        "documents",
                        "transactions"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": ""
      }
    },
    "/api/v1/reconciliation/commit": {
      "post": {
        "operationId": "post_api_v1_reconciliation_commit",
        "summary": "Ausgewählte Abgleichspaare bewusst festschreiben",
        "tags": [
          "reconciliation"
        ],
        "responses": {
          "200": {
            "description": "Ausgewählte Abgleichspaare bewusst festschreiben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "committed": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "entry_number": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "entry_id": {
                                "type": "integer",
                                "minimum": 1
                              }
                            },
                            "required": [
                              "key",
                              "entry_number",
                              "entry_id"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "failed": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "committed",
                        "failed"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "committed": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "entry_number": {
                                    "anyOf": [
                                      {
                                        "type": "integer"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "entry_id": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                },
                                "required": [
                                  "key",
                                  "entry_number",
                                  "entry_id"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "failed": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "key",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "committed",
                            "failed"
                          ],
                          "additionalProperties": false
                        },
                        "setup": {
                          "type": "object",
                          "properties": {
                            "complete": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "missing": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "complete",
                            "message",
                            "missing"
                          ],
                          "additionalProperties": false
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "overdue",
                                "payment_failed"
                              ]
                            },
                            "can_write": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "due_by": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "amount_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reference": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "transfer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "status",
                            "can_write",
                            "message",
                            "due_by",
                            "amount_cents",
                            "reference",
                            "transfer"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Jedes Paar eigene Transaktion; Teilfortschritt möglich. 422 nur wenn committed leer und failed nicht leer, dann data-Hülle statt message. REST nimmt keinen zusätzlichen Vorschau-Fingerprint entgegen. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "keys": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "minItems": 1,
                    "maxItems": 500
                  },
                  "certain_only": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "keys"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/command": {
      "post": {
        "operationId": "post_api_v1_command",
        "summary": "Freitext deuten, ohne etwas auszuführen",
        "tags": [
          "command"
        ],
        "responses": {
          "200": {
            "description": "Freitext deuten, ohne etwas auszuführen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "booking",
                        "question",
                        "unknown",
                        "action"
                      ]
                    },
                    "say": {
                      "type": "string"
                    },
                    "amount_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tax_key_id": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "account_id": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "account_options": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "note": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "key",
                          "name",
                          "note"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "counter_account_id": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "direction": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "needs_account_choice": {
                      "type": "boolean"
                    },
                    "bookable": {
                      "type": "boolean"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "regeln",
                        "ki"
                      ]
                    },
                    "model": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "action": {
                      "type": "string",
                      "enum": [
                        "buchung",
                        "abgleich_festschreiben",
                        "entwuerfe_festschreiben",
                        "frage"
                      ]
                    },
                    "params": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/components/schemas/SourceJson"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "kind",
                    "say",
                    "amount_cents",
                    "tax_key_id",
                    "account_id",
                    "account_options",
                    "counter_account_id",
                    "direction",
                    "needs_account_choice",
                    "bookable",
                    "source",
                    "model",
                    "action",
                    "params"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "action/params beschreiben verstandene Absicht. Selbst action=Festschreiben stellt nichts aus und bucht nichts; separate explizite Endpunkte verwenden. Idempotency-Key wird auf dieser nicht unterstützten Schreibaktion mit 400 idempotency_unsupported abgewiesen; kein allgemeiner Replayschutz.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "text"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/vat": {
      "get": {
        "operationId": "get_api_v1_reports_vat",
        "summary": "Periodisierte Umsatzsteuer-Vorbereitung mit Vollständigkeitsgrenzen lesen",
        "tags": [
          "reports"
        ],
        "responses": {
          "200": {
            "description": "Periodisierte Umsatzsteuer-Vorbereitung mit Vollständigkeitsgrenzen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VatReport"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "to ab from, gleicher Kalenderjahrgang. 2026-Formbezug; andere Jahre ungeprüft/keine amtlichen Kennziffern. filing_ready/export_allowed immer false; keine Meldung oder ELSTER-Übermittlung.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ]
      }
    },
    "/api/v1/idempotent/articles": {
      "post": {
        "operationId": "post_api_v1_idempotent_articles",
        "summary": "Artikel anlegen (Pflichtschlüssel)",
        "tags": [
          "articles"
        ],
        "responses": {
          "201": {
            "description": "Artikel anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Article"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3
                  },
                  "tax_key_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "revenue_account_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "closing_text_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Artikel anlegen. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "x-idempotency": {
          "operation": "article.create",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/bank/transactions/{id}/book": {
      "post": {
        "operationId": "post_api_v1_idempotent_bank_transactions_id_book",
        "summary": "Umsatz ausdrücklich auf Sachkonto buchen (Pflichtschlüssel)",
        "tags": [
          "bank"
        ],
        "responses": {
          "201": {
            "description": "Umsatz ausdrücklich auf Sachkonto buchen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "entry_number": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "description": {
                          "type": "string"
                        },
                        "booking_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "lines": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "account": {
                                "type": "string"
                              },
                              "debit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              },
                              "credit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              }
                            },
                            "required": [
                              "account",
                              "debit_cents",
                              "credit_cents"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "entry_number",
                        "description",
                        "booking_date",
                        "lines"
                      ],
                      "additionalProperties": false
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Umsatz ausdrücklich auf Sachkonto buchen. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "tax_key_id": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 250
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "document_ids": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "account_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "x-idempotency": {
          "operation": "transaction.book",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/bank/transactions/{id}/settle": {
      "post": {
        "operationId": "post_api_v1_idempotent_bank_transactions_id_settle",
        "summary": "Umsatz mit offenen Posten ausgleichen (Pflichtschlüssel)",
        "tags": [
          "bank"
        ],
        "responses": {
          "200": {
            "description": "Skonto-Vorschau ohne Buchung",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "rule": {
                          "type": "string"
                        },
                        "tenant_id": {
                          "type": "string"
                        },
                        "actor_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transaction_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "statement_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "description": {
                          "type": "string"
                        },
                        "bank_account_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "bank_ledger_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "booking_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "payment_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "allocations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line_id": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "amount_cents": {
                                "type": "integer",
                                "minimum": 1
                              }
                            },
                            "required": [
                              "line_id",
                              "amount_cents"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "skonto_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "groups": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SettlementSkontoGroup"
                          }
                        },
                        "remaining_cents": {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        "confirmation": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "rule",
                        "tenant_id",
                        "actor_id",
                        "transaction_id",
                        "statement_id",
                        "description",
                        "bank_account_id",
                        "bank_ledger_id",
                        "booking_date",
                        "currency",
                        "payment_cents",
                        "allocations",
                        "skonto_cents",
                        "groups",
                        "remaining_cents",
                        "confirmation"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "201": {
            "description": "Umsatz mit offenen Posten ausgleichen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "skonto_groups": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string"
                              },
                              "group": {
                                "$ref": "#/components/schemas/SettlementSkontoGroup"
                              }
                            },
                            "required": [
                              "rule",
                              "group"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "entry_number": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "description": {
                          "type": "string"
                        },
                        "booking_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "lines": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "account": {
                                "type": "string"
                              },
                              "debit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              },
                              "credit_cents": {
                                "type": "integer",
                                "description": "Ganzzahlige Cent"
                              }
                            },
                            "required": [
                              "account",
                              "debit_cents",
                              "credit_cents"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "skonto_groups",
                        "entry_number",
                        "description",
                        "booking_date",
                        "lines"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Umsatz mit offenen Posten ausgleichen. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "allocations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "line_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "line_id",
                        "amount_cents"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1
                  },
                  "skonto_percent": {
                    "anyOf": [
                      {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "exclusiveMaximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "skonto_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "confirmation": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "allocations"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "x-idempotency": {
          "operation": "transaction.settle",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/entries": {
      "post": {
        "operationId": "post_api_v1_idempotent_entries",
        "summary": "Buchung erfassen; post=true schreibt unmittelbar fest (Pflichtschlüssel)",
        "tags": [
          "entries"
        ],
        "responses": {
          "201": {
            "description": "Buchung erfassen; post=true schreibt unmittelbar fest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Ungültig, nicht eingerichtet oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 200
                  },
                  "document_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "booking_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "post": {
                    "type": "boolean"
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "account_id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "tax_key_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "side": {
                          "type": "string",
                          "enum": [
                            "debit",
                            "credit"
                          ]
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "description": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cost_center_id": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1
                        },
                        "cost_splits": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 100,
                          "items": {
                            "$ref": "#/components/schemas/CostSplit89"
                          }
                        }
                      },
                      "required": [
                        "account_id",
                        "side",
                        "amount_cents"
                      ],
                      "additionalProperties": false,
                      "description": "Optional cost_center_id OR cost_splits on net revenue/expense only. Splits total calculated net cents; tax and contra remain unassigned."
                    },
                    "minItems": 1
                  },
                  "document_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                },
                "required": [
                  "description",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Buchung erfassen; post=true schreibt unmittelbar fest. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "x-idempotency": {
          "operation": "entry.create",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/entries/{id}/post": {
      "post": {
        "operationId": "post_api_v1_idempotent_entries_id_post",
        "summary": "Buchungsentwurf endgültig festschreiben (Pflichtschlüssel)",
        "tags": [
          "entries"
        ],
        "responses": {
          "200": {
            "description": "Buchungsentwurf endgültig festschreiben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Fachregel, auch eine fehlende ID ergibt 422",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Buchungsentwurf endgültig festschreiben. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "x-idempotency": {
          "operation": "entry.post",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/entries/{id}/reverse": {
      "post": {
        "operationId": "post_api_v1_idempotent_entries_id_reverse",
        "summary": "Buchung durch neue Umkehrbuchung korrigieren (Pflichtschlüssel)",
        "tags": [
          "entries"
        ],
        "responses": {
          "201": {
            "description": "Buchung durch neue Umkehrbuchung korrigieren",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Entry"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung/Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 200
                  },
                  "returned_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Nur bei einer zugeordneten Zahlung: Tag, an dem das Geld tatsächlich zurückgeflossen ist, bei einer Bankzahlung der Buchungstag des Rückgabe-Umsatzes. Der Storno liegt an diesem Tag."
                  },
                  "misallocated": {
                    "type": "boolean",
                    "description": "Nur bei einer zugeordneten Zahlung aus einem vergangenen Jahr: Das Geld kam an und wurde nur falsch zugeordnet."
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Buchung durch neue Umkehrbuchung korrigieren. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "x-idempotency": {
          "operation": "entry.reverse",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/invoices": {
      "post": {
        "operationId": "post_api_v1_idempotent_invoices",
        "summary": "Unnummerierten Rechnungsentwurf anlegen (Pflichtschlüssel)",
        "tags": [
          "invoices"
        ],
        "responses": {
          "201": {
            "description": "Unnummerierten Rechnungsentwurf anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Unnummerierten Rechnungsentwurf anlegen. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "x-idempotency": {
          "operation": "invoice.create",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/invoices/{id}/issue": {
      "post": {
        "operationId": "post_api_v1_idempotent_invoices_id_issue",
        "summary": "Bewusst endgültig ausstellen: Nummer, Original und Buchung (Pflichtschlüssel)",
        "tags": [
          "invoices"
        ],
        "responses": {
          "200": {
            "description": "Bewusst endgültig ausstellen: Nummer, Original und Buchung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Pflichtangaben, veralteter Entwurf, geschlossener Zeitraum oder period-Bestätigung erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Bewusst endgültig ausstellen: Nummer, Original und Buchung. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirm_past_period": {
                    "type": "boolean"
                  },
                  "expected_draft_hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "x-idempotency": {
          "operation": "invoice.issue",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/invoices/{id}/mail": {
      "post": {
        "operationId": "post_api_v1_idempotent_invoices_id_mail",
        "summary": "Geprüften Versand verbindlich beauftragen (Pflichtschlüssel)",
        "tags": [
          "invoices"
        ],
        "responses": {
          "202": {
            "description": "Geprüften Versand verbindlich beauftragen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "delivery_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "delivery_id"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Geprüften Versand verbindlich beauftragen. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmation": {
                    "type": "string"
                  },
                  "confirmed": {
                    "enum": [
                      true,
                      1,
                      "1",
                      "yes",
                      "on",
                      "true"
                    ]
                  }
                },
                "required": [
                  "confirmation",
                  "confirmed"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "x-idempotency": {
          "operation": "invoice.mail",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/invoices/{id}/reverse": {
      "post": {
        "operationId": "post_api_v1_idempotent_invoices_id_reverse",
        "summary": "Korrekturrechnung zur ausgestellten Rechnung erzeugen (Pflichtschlüssel)",
        "tags": [
          "invoices"
        ],
        "responses": {
          "201": {
            "description": "Korrekturrechnung zur ausgestellten Rechnung erzeugen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Korrektur nicht zulässig",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Korrekturrechnung zur ausgestellten Rechnung erzeugen. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad. Die Korrektur mindert die Voranmeldung sofort. Wurde die Leistung gar nicht ausgeführt, kann die Steuer geschuldet bleiben, bis das Finanzamt dem schriftlichen Antrag zugestimmt hat (§ 14c Abs. 2 UStG).",
        "x-idempotency": {
          "operation": "invoice.reverse",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/invoices/{id}/settle": {
      "post": {
        "operationId": "post_api_v1_idempotent_invoices_id_settle",
        "summary": "Laut Rechnung bezahlte Forderung bewusst nachbuchen (Pflichtschlüssel)",
        "tags": [
          "invoices"
        ],
        "responses": {
          "201": {
            "description": "Laut Rechnung bezahlte Forderung bewusst nachbuchen",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Invoice"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "settlement": {
                          "type": "object",
                          "properties": {
                            "journal_entry_id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "entry_number": {
                              "type": "string"
                            },
                            "booking_date": {
                              "type": "string",
                              "format": "date"
                            },
                            "amount_cents": {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            "clearing_account_id": {
                              "type": "integer",
                              "minimum": 1
                            }
                          },
                          "required": [
                            "journal_entry_id",
                            "entry_number",
                            "booking_date",
                            "amount_cents",
                            "clearing_account_id"
                          ],
                          "additionalProperties": false
                        },
                        "setup": {
                          "type": "object",
                          "properties": {
                            "complete": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "missing": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "complete",
                            "message",
                            "missing"
                          ],
                          "additionalProperties": false
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "overdue",
                                "payment_failed"
                              ]
                            },
                            "can_write": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "due_by": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "amount_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reference": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "transfer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "status",
                            "can_write",
                            "message",
                            "due_by",
                            "amount_cents",
                            "reference",
                            "transfer"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "settlement"
                      ]
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Periodenbestätigung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clearing_account_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "booking_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "confirm_past_period": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "clearing_account_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Laut Rechnung bezahlte Forderung bewusst nachbuchen. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "x-idempotency": {
          "operation": "invoice.settle",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/idempotent/partners": {
      "post": {
        "operationId": "post_api_v1_idempotent_partners",
        "summary": "Personenkonto und damit Kontakt anlegen (Pflichtschlüssel)",
        "tags": [
          "partners"
        ],
        "responses": {
          "201": {
            "description": "Personenkonto und damit Kontakt anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Partner"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              },
              "Idempotency-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Nur bei schlüssellosem Legacyaufruf."
              }
            }
          },
          "400": {
            "description": "Ungültiges JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "409": {
            "description": "Schlüssel-/Transportkonflikt oder ungeklärter processing-Zustand; keine neue Wirkung.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyConflict"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "415": {
            "description": "Content-Type application/json mit Schlüssel erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyMediaError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben oder Kontonummer",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/IdempotencyExecutionError"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "428": {
            "description": "Auftragsschlüssel fehlt; keine Wirkung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyRequired"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          },
          "503": {
            "description": "Sicher zurückgerollte Ausnahme; identischen Auftrag wiederholen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyExecutionError"
                }
              }
            },
            "headers": {
              "Idempotency-Receipt": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Unveränderliche Quittung, auch bei Konflikt dieselbe reservierte Quittung."
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                "description": "true bei terminalem Replay; Konflikte false."
              },
              "Idempotency-State": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "processing",
                    "succeeded",
                    "rejected",
                    "rolled_back",
                    "operational_error"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "Nach reserviertem Auftrag: private, no-store. Vorgeschaltete Auth-/Schlüssel-/Medienfehler besitzen keine Quittung und behalten die jeweilige HTTP-Cacheantwort."
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 200
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "debtor",
                      "creditor"
                    ]
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 10000,
                        "maximum": 99999
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "kind"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Identität: Mandant + unveränderliche Benutzer-ID + Operation + Schlüsselhash, unabhängig von Tokenrotation und Pflicht-/Legacypfad. Body, Pfadparameter und Query sind typgetreu kanonisiert (Objektschlüssel sortiert, Arrayreihenfolge erhalten). Mit Schlüssel gehören Wirkung, Nummern, Ereignisse und Quittung zusammen, eine Wiederholung löst nichts erneut aus. Erfolg und terminale 4xx wiederholen ursprünglichen Status/Fach-Body; äußere Setup-/Billinghinweise bleiben aktuell. Historische Antwort, kein aktueller Ressourcenstand. Anderer Payload: 409 idempotency_conflict; anderer REST/MCP-Kanal: 409 idempotency_transport_conflict. Ungeklärtes processing: 409 ohne TTL-Neuausführung. rolled_back/operational_error erlauben identischen Wiederholungsauftrag. Keine automatische Retentionlöschung, kein Ablauf reservierter Schlüssel. Aktive Anmeldung, Mandantenzugang, write und Owner/Accountant werden vor jedem Replay geprüft. MCP nutzt optional idempotency_key und result._meta.idempotency; kein Transportwechsel für eine reservierte Operation. Pflichtpfad: ohne Idempotency-Key 428 vor Wirkung. Personenkonto und damit Kontakt anlegen. Fachfelder und Erfolgsantwort entsprechen dem Legacypfad.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{16,200}$"
            },
            "description": "Zufälliger Auftragsschlüssel; gleicher Benutzer/Operation/Mandant. Keine TTL und keine automatische Löschung. Identischen Auftrag nach Transportunsicherheit mit demselben Schlüssel wiederholen."
          }
        ],
        "x-idempotency": {
          "operation": "partner.create",
          "key_required": true,
          "contract": "summator-idempotency/1"
        }
      }
    },
    "/api/v1/sync": {
      "get": {
        "operationId": "get_api_v1_sync",
        "summary": "Eingefrorenes Bootstrap-/Deltafenster lesen",
        "tags": [
          "sync"
        ],
        "description": "Ohne Cursor konsistenter Bootstrap der sieben öffentlichen Projektionen; resources[] beschränkt den gesamten Folgevertrag. limit 1–500, Standard 100. Cursor bindet Tenant/Benutzer/Rolle/read, Ressourcen, Vertrag, Grenzen, Seitengröße und Frist. Bei Fortsetzung bestimmt der Cursor die Größe; zusätzliches gültiges limit wird ignoriert. Gleiches Eingangscheckpoint findet dasselbe Fenster; ein cursorloser neuer Bootstrap erstellt ein neues Fenster. Alle Seiten eines Fensters werden zusammen eingefroren, es gilt die Reihenfolge, in der Änderungen wirksam wurden, nicht die Zeitstempel. Sperrwartezeit 10s, bei Konflikt 503, später bewusster Abruf mit demselben Cursor. Offene Seiten 86400 Sekunden, abgeschlossener Checkpoint 30×86400 Sekunden ab Fenstererstellung; bei Ablauf >= Frist 410, keine Verlängerung durch Wiederholung. Kein physischer Cleanup. hasMore/windowComplete und leere Fenster atomar mit nextCursor übernehmen; bei Bootstrap erst vollständigen lokalen Bestand ersetzen. Mehrere Events können denselben letzten eingefrorenen Stand abbilden. Deaktiviert bleibt Datensatz mit is_active=false; rechtmäßiges Verwerfen liefert Tombstone. Storno ist Gegenbuchung/reverses-ID, keine Löschung. Historische Zuordnung kann effective=false sein. Kein Original/PDF/XML/Auditdump, keine neue Archivierungsaktion. Bei 401/403/409/410 lokalen Bestand verbergen, nach erneut autorisiertem Bootstrap vollständig ersetzen; keine Fernlöschung fremder Geräte. MCP delta-sync nutzt dieselben Cursor; action=page/resolve, MCP-Fehlerhülle bleibt eigenes Protokoll. Projekte und Projektzeiten ergänzen die bisherigen sieben Ressourcen. Projektmitgliedschaft/Verantwortung ist in Cursorautorisation gebunden; Änderung erfordert 409/Resync. Neue Projektionen und Kommentare werden nach Projektverantwortung/eigener Zeit gefiltert, auch im eingefrorenen Fenster. Keine personenbezogenen Kommentare anderer Mitarbeitender für reine Mitglieder.",
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Definierte Projektion; Cache-Control private, no-store",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeltaPage"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store (Transport darf Reihenfolge normalisieren)"
              }
            }
          },
          "400": {
            "description": "delta_invalid_cursor (Manipulation oder falscher Mandant)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Ungültiger Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang/Benutzer/read entzogen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "delta_contract_resync_required, delta_authorization_changed_resync_required, delta_scope_changed_resync_required, delta_window_mismatch, delta_history_changed_resync_required oder delta_requires_independent_transaction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "delta_expired_resync_required oder delta_window_missing_resync_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Eingabe oder delta_invalid_resources/delta_invalid_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120/min je Tenant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "delta_busy_retry_same_cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 8192
            }
          },
          {
            "name": "resources",
            "in": "query",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "allocations",
                  "articles",
                  "contacts",
                  "documents",
                  "entries",
                  "invoices",
                  "payments",
                  "projects",
                  "project-time-entries",
                  "cost-centers"
                ]
              },
              "minItems": 1
            },
            "description": "Schreibweise resources[]=invoices. Sortiert/dedupliziert; bei Folgeseite weglassen oder exakt denselben Scope verwenden."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ]
      }
    },
    "/api/v1/sync/resources/{resource}/{id}": {
      "get": {
        "operationId": "get_api_v1_sync_resources_resource_id",
        "summary": "Aktuelle autorisierte Ressourcenprojektion auflösen",
        "tags": [
          "sync"
        ],
        "description": "Aktueller Stand der definierten Projektion, kein historischer Fensterabruf. Unbekannte Ressource oder verschwundene Quelle: 404. Ohne Cursor konsistenter Bootstrap der sieben öffentlichen Projektionen; resources[] beschränkt den gesamten Folgevertrag. limit 1–500, Standard 100. Cursor bindet Tenant/Benutzer/Rolle/read, Ressourcen, Vertrag, Grenzen, Seitengröße und Frist. Bei Fortsetzung bestimmt der Cursor die Größe; zusätzliches gültiges limit wird ignoriert. Gleiches Eingangscheckpoint findet dasselbe Fenster; ein cursorloser neuer Bootstrap erstellt ein neues Fenster. Alle Seiten eines Fensters werden zusammen eingefroren, es gilt die Reihenfolge, in der Änderungen wirksam wurden, nicht die Zeitstempel. Sperrwartezeit 10s, bei Konflikt 503, später bewusster Abruf mit demselben Cursor. Offene Seiten 86400 Sekunden, abgeschlossener Checkpoint 30×86400 Sekunden ab Fenstererstellung; bei Ablauf >= Frist 410, keine Verlängerung durch Wiederholung. Kein physischer Cleanup. hasMore/windowComplete und leere Fenster atomar mit nextCursor übernehmen; bei Bootstrap erst vollständigen lokalen Bestand ersetzen. Mehrere Events können denselben letzten eingefrorenen Stand abbilden. Deaktiviert bleibt Datensatz mit is_active=false; rechtmäßiges Verwerfen liefert Tombstone. Storno ist Gegenbuchung/reverses-ID, keine Löschung. Historische Zuordnung kann effective=false sein. Kein Original/PDF/XML/Auditdump, keine neue Archivierungsaktion. Bei 401/403/409/410 lokalen Bestand verbergen, nach erneut autorisiertem Bootstrap vollständig ersetzen; keine Fernlöschung fremder Geräte. MCP delta-sync nutzt dieselben Cursor; action=page/resolve, MCP-Fehlerhülle bleibt eigenes Protokoll. Projekte und Projektzeiten ergänzen die bisherigen sieben Ressourcen. Projektmitgliedschaft/Verantwortung ist in Cursorautorisation gebunden; Änderung erfordert 409/Resync. Neue Projektionen und Kommentare werden nach Projektverantwortung/eigener Zeit gefiltert, auch im eingefrorenen Fenster. Keine personenbezogenen Kommentare anderer Mitarbeitender für reine Mitglieder.",
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Definierte Projektion; Cache-Control private, no-store",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeltaResolved"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store (Transport darf Reihenfolge normalisieren)"
              }
            }
          },
          "401": {
            "description": "Ungültiger Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang/Benutzer/read entzogen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ressource oder Quelle nicht vorhanden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120/min je Tenant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "allocations",
                "articles",
                "contacts",
                "documents",
                "entries",
                "invoices",
                "payments",
                "projects",
                "project-time-entries",
                "cost-centers"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Numerischer Pfad; unbekannte/0-ID ergibt 404. Projektionen haben positive Quell-IDs."
          }
        ]
      }
    },
    "/api/v1/sales-orders": {
      "get": {
        "operationId": "get_api_v1_sales_orders",
        "summary": "Auftragsbestätigungen · index",
        "tags": [
          "sales-orders"
        ],
        "responses": {
          "200": {
            "description": "Angebote seitenweise lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "current_page": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SalesOrder"
                          }
                        },
                        "first_page_url": {
                          "type": "string"
                        },
                        "from": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "last_page": {
                          "type": "integer"
                        },
                        "last_page_url": {
                          "type": "string"
                        },
                        "links": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "label": {
                                "type": "string"
                              },
                              "active": {
                                "type": "boolean"
                              },
                              "page": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "url",
                              "label",
                              "active",
                              "page"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "next_page_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "path": {
                          "type": "string"
                        },
                        "per_page": {
                          "type": "integer"
                        },
                        "prev_page_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "to": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "current_page",
                        "data",
                        "first_page_url",
                        "from",
                        "last_page",
                        "last_page_url",
                        "links",
                        "next_page_url",
                        "path",
                        "per_page",
                        "prev_page_url",
                        "to",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Genau eine aktive Auftragsbestätigung aus einer angenommenen Angebotsfassung. Freigabe dokumentiert die bewusste Nutzerentscheidung. Keine Zahlungsaufforderung, Forderung oder Buchung. convert bereitet genau einen vollständigen gebundenen Rechnungsentwurf vor; identische Wiederholung liefert denselben Beleg. Preise, Anschrift und Leistungsdaten bleiben gebunden; Ausstellung ist separat. Änderungen zuerst speichern und expected_hash aus show prüfen. Abweichungen ausdrücklich bestätigen. Keine Teilabrechnung.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "post": {
        "operationId": "post_api_v1_sales_orders",
        "summary": "Auftragsbestätigungen · store",
        "tags": [
          "sales-orders"
        ],
        "responses": {
          "201": {
            "description": "Angebotsentwurf speichern; Positionen vollständig ersetzen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesOrder"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Genau eine aktive Auftragsbestätigung aus einer angenommenen Angebotsfassung. Freigabe dokumentiert die bewusste Nutzerentscheidung. Keine Zahlungsaufforderung, Forderung oder Buchung. convert bereitet genau einen vollständigen gebundenen Rechnungsentwurf vor; identische Wiederholung liefert denselben Beleg. Preise, Anschrift und Leistungsdaten bleiben gebunden; Ausstellung ist separat. Änderungen zuerst speichern und expected_hash aus show prüfen. Abweichungen ausdrücklich bestätigen. Keine Teilabrechnung.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "quote_id": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "quote_id"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/sales-orders/{id}": {
      "get": {
        "operationId": "get_api_v1_sales_orders_id",
        "summary": "Auftragsbestätigungen · show",
        "tags": [
          "sales-orders"
        ],
        "responses": {
          "200": {
            "description": "Angebotsfassung mit Positionen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesOrder"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Genau eine aktive Auftragsbestätigung aus einer angenommenen Angebotsfassung. Freigabe dokumentiert die bewusste Nutzerentscheidung. Keine Zahlungsaufforderung, Forderung oder Buchung. convert bereitet genau einen vollständigen gebundenen Rechnungsentwurf vor; identische Wiederholung liefert denselben Beleg. Preise, Anschrift und Leistungsdaten bleiben gebunden; Ausstellung ist separat. Änderungen zuerst speichern und expected_hash aus show prüfen. Abweichungen ausdrücklich bestätigen. Keine Teilabrechnung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_api_v1_sales_orders_id",
        "summary": "Auftragsbestätigungen · update",
        "tags": [
          "sales-orders"
        ],
        "responses": {
          "200": {
            "description": "Angebotsentwurf speichern; Positionen vollständig ersetzen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesOrder"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Genau eine aktive Auftragsbestätigung aus einer angenommenen Angebotsfassung. Freigabe dokumentiert die bewusste Nutzerentscheidung. Keine Zahlungsaufforderung, Forderung oder Buchung. convert bereitet genau einen vollständigen gebundenen Rechnungsentwurf vor; identische Wiederholung liefert denselben Beleg. Preise, Anschrift und Leistungsdaten bleiben gebunden; Ausstellung ist separat. Änderungen zuerst speichern und expected_hash aus show prüfen. Abweichungen ausdrücklich bestätigen. Keine Teilabrechnung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_hash": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "order_reference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "service_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "agreed_schedule": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "conditions": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "lines": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "source_position": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "description": {
                          "type": "string"
                        },
                        "detail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quantity": {
                          "anyOf": [
                            {
                              "type": "number",
                              "exclusiveMinimum": 0,
                              "maximum": 1000000
                            },
                            {
                              "type": "string",
                              "pattern": "^\\d+(\\.\\d{1,6})?$"
                            }
                          ]
                        },
                        "unit": {
                          "type": "string",
                          "maxLength": 3
                        },
                        "unit_price_cents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000000000
                        }
                      },
                      "required": [
                        "source_position",
                        "description",
                        "quantity",
                        "unit",
                        "unit_price_cents"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "expected_hash",
                  "order_reference",
                  "conditions",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/sales-orders/{id}/release": {
      "post": {
        "operationId": "post_api_v1_sales_orders_id_release",
        "summary": "Auftragsbestätigungen · release",
        "tags": [
          "sales-orders"
        ],
        "responses": {
          "200": {
            "description": "Angebotsfassung endgültig freigeben und Original speichern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesOrder"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Genau eine aktive Auftragsbestätigung aus einer angenommenen Angebotsfassung. Freigabe dokumentiert die bewusste Nutzerentscheidung. Keine Zahlungsaufforderung, Forderung oder Buchung. convert bereitet genau einen vollständigen gebundenen Rechnungsentwurf vor; identische Wiederholung liefert denselben Beleg. Preise, Anschrift und Leistungsdaten bleiben gebunden; Ausstellung ist separat. Änderungen zuerst speichern und expected_hash aus show prüfen. Abweichungen ausdrücklich bestätigen. Keine Teilabrechnung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_hash": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "confirmed": {
                    "const": true
                  },
                  "accept_differences": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "expected_hash",
                  "confirmed"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/sales-orders/{id}/cancel": {
      "post": {
        "operationId": "post_api_v1_sales_orders_id_cancel",
        "summary": "Auftragsbestätigungen · cancel",
        "tags": [
          "sales-orders"
        ],
        "responses": {
          "200": {
            "description": "Belegte Angebotsentscheidung erfassen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesOrder"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Genau eine aktive Auftragsbestätigung aus einer angenommenen Angebotsfassung. Freigabe dokumentiert die bewusste Nutzerentscheidung. Keine Zahlungsaufforderung, Forderung oder Buchung. convert bereitet genau einen vollständigen gebundenen Rechnungsentwurf vor; identische Wiederholung liefert denselben Beleg. Preise, Anschrift und Leistungsdaten bleiben gebunden; Ausstellung ist separat. Änderungen zuerst speichern und expected_hash aus show prüfen. Abweichungen ausdrücklich bestätigen. Keine Teilabrechnung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "const": true
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "confirmed",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/sales-orders/{id}/revision": {
      "post": {
        "operationId": "post_api_v1_sales_orders_id_revision",
        "summary": "Auftragsbestätigungen · revise",
        "tags": [
          "sales-orders"
        ],
        "responses": {
          "201": {
            "description": "Offenes freigegebenes Angebot durch neue Entwurfsfassung ersetzen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesOrder"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Genau eine aktive Auftragsbestätigung aus einer angenommenen Angebotsfassung. Freigabe dokumentiert die bewusste Nutzerentscheidung. Keine Zahlungsaufforderung, Forderung oder Buchung. convert bereitet genau einen vollständigen gebundenen Rechnungsentwurf vor; identische Wiederholung liefert denselben Beleg. Preise, Anschrift und Leistungsdaten bleiben gebunden; Ausstellung ist separat. Änderungen zuerst speichern und expected_hash aus show prüfen. Abweichungen ausdrücklich bestätigen. Keine Teilabrechnung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "const": true
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "confirmed",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/sales-orders/{id}/convert": {
      "post": {
        "operationId": "post_api_v1_sales_orders_id_convert",
        "summary": "Auftragsbestätigungen · convert",
        "tags": [
          "sales-orders"
        ],
        "responses": {
          "200": {
            "description": "Angenommenes Angebot einmalig in Rechnungsentwurf überführen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceRecord"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    },
                    "sales_order_id": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "required": [
                    "data",
                    "sales_order_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Genau eine aktive Auftragsbestätigung aus einer angenommenen Angebotsfassung. Freigabe dokumentiert die bewusste Nutzerentscheidung. Keine Zahlungsaufforderung, Forderung oder Buchung. convert bereitet genau einen vollständigen gebundenen Rechnungsentwurf vor; identische Wiederholung liefert denselben Beleg. Preise, Anschrift und Leistungsdaten bleiben gebunden; Ausstellung ist separat. Änderungen zuerst speichern und expected_hash aus show prüfen. Abweichungen ausdrücklich bestätigen. Keine Teilabrechnung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_hash": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "confirmed": {
                    "const": true
                  },
                  "invoice_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "service_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "due_date": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date"
                  }
                },
                "required": [
                  "expected_hash",
                  "confirmed",
                  "invoice_date",
                  "service_date"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/sales-orders/{id}/file": {
      "get": {
        "operationId": "get_api_v1_sales_orders_id_file",
        "summary": "Auftragsbestätigungen · file",
        "tags": [
          "sales-orders"
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Angebots-PDF herunterladen",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Entwurf oder unbekannte Fassung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Originalprüfung fehlgeschlagen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Genau eine aktive Auftragsbestätigung aus einer angenommenen Angebotsfassung. Freigabe dokumentiert die bewusste Nutzerentscheidung. Keine Zahlungsaufforderung, Forderung oder Buchung. convert bereitet genau einen vollständigen gebundenen Rechnungsentwurf vor; identische Wiederholung liefert denselben Beleg. Preise, Anschrift und Leistungsdaten bleiben gebunden; Ausstellung ist separat. Änderungen zuerst speichern und expected_hash aus show prüfen. Abweichungen ausdrücklich bestätigen. Keine Teilabrechnung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/delivery-notes": {
      "get": {
        "operationId": "get_api_deliveries_index",
        "summary": "Lieferscheine · index",
        "tags": [
          "delivery-notes"
        ],
        "responses": {
          "200": {
            "description": "Angebote seitenweise lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "current_page": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DeliveryNote"
                          }
                        },
                        "first_page_url": {
                          "type": "string"
                        },
                        "from": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "last_page": {
                          "type": "integer"
                        },
                        "last_page_url": {
                          "type": "string"
                        },
                        "links": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "label": {
                                "type": "string"
                              },
                              "active": {
                                "type": "boolean"
                              },
                              "page": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "url",
                              "label",
                              "active",
                              "page"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "next_page_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "path": {
                          "type": "string"
                        },
                        "per_page": {
                          "type": "integer"
                        },
                        "prev_page_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "to": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "current_page",
                        "data",
                        "first_page_url",
                        "from",
                        "last_page",
                        "last_page_url",
                        "links",
                        "next_page_url",
                        "path",
                        "per_page",
                        "prev_page_url",
                        "to",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigenständige preislose Lieferungen oder Teilmengen aus genau einer Quelle: normaler Rechnungsentwurf, Auftragsbestätigung oder angenommenes Angebot. Freigabe hält eigene Originalmengen fest, ein Storno ohne Rechnungsbezug gibt sie frei. convert bindet vollständig und einmalig an den vorhandenen Entwurf, bereitet aus Lieferungen von Angebot oder Auftrag einen Entwurf zu den Preisen der Quelle vor oder aus ungebundenen Standalone-Lieferungen nach bewusster Preisprüfung einen gemeinsamen Entwurf. Ausstellung und Versand bleiben separat. Keine Delta-Cursor-/Resolver-Unterstützung für Order/Delivery zugesagt."
      },
      "post": {
        "operationId": "post_api_deliveries_store",
        "summary": "Lieferscheine · store",
        "tags": [
          "delivery-notes"
        ],
        "responses": {
          "201": {
            "description": "Angebotsfassung mit Positionen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeliveryNote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigenständige preislose Lieferungen oder Teilmengen aus genau einer Quelle: normaler Rechnungsentwurf, Auftragsbestätigung oder angenommenes Angebot. Freigabe hält eigene Originalmengen fest, ein Storno ohne Rechnungsbezug gibt sie frei. convert bindet vollständig und einmalig an den vorhandenen Entwurf, bereitet aus Lieferungen von Angebot oder Auftrag einen Entwurf zu den Preisen der Quelle vor oder aus ungebundenen Standalone-Lieferungen nach bewusster Preisprüfung einen gemeinsamen Entwurf. Ausstellung und Versand bleiben separat. Keine Delta-Cursor-/Resolver-Unterstützung für Order/Delivery zugesagt.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "type": "boolean"
                  },
                  "request_key": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "account_id": {
                    "type": "integer"
                  },
                  "delivery_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "handover_note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "source_invoice_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "source_sales_order_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "source_quote_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "source_hash": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "lines": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "article_id": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "detail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quantity": {
                          "type": "string",
                          "pattern": "^\\d+(\\.\\d{1,6})?$"
                        },
                        "unit": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "source_line_id": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "quantity"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "recipient_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipient_street": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipient_postal_code": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipient_city": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipient_country": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "request_key",
                  "account_id",
                  "delivery_date",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes/convert": {
      "post": {
        "operationId": "post_api_deliveries_convert",
        "summary": "Lieferscheine · convert",
        "tags": [
          "delivery-notes"
        ],
        "responses": {
          "200": {
            "description": "Angebotsfassung mit Positionen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceRecord"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigenständige preislose Lieferungen oder Teilmengen aus genau einer Quelle: normaler Rechnungsentwurf, Auftragsbestätigung oder angenommenes Angebot. Freigabe hält eigene Originalmengen fest, ein Storno ohne Rechnungsbezug gibt sie frei. convert bindet vollständig und einmalig an den vorhandenen Entwurf, bereitet aus Lieferungen von Angebot oder Auftrag einen Entwurf zu den Preisen der Quelle vor oder aus ungebundenen Standalone-Lieferungen nach bewusster Preisprüfung einen gemeinsamen Entwurf. Ausstellung und Versand bleiben separat. Keine Delta-Cursor-/Resolver-Unterstützung für Order/Delivery zugesagt. Lieferungen aus Angebot oder Auftrag brauchen keine Preise. Sie nehmen die Preise der Quelle, oder sie werden mit dem vorhandenen Rechnungsentwurf der Quelle verknüpft.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "type": "boolean"
                  },
                  "delivery_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "integer"
                    }
                  },
                  "invoice_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "service_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "due_date": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Nur für Lieferungen aus Angebot oder Auftrag."
                  },
                  "prices": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "delivery_note_line_id": {
                          "type": "integer"
                        },
                        "unit_price_cents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000000000
                        },
                        "tax_key_id": {
                          "type": "integer"
                        },
                        "revenue_account_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "delivery_note_line_id",
                        "unit_price_cents",
                        "tax_key_id",
                        "revenue_account_id"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "confirmed",
                  "delivery_ids",
                  "invoice_date",
                  "service_date"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes/sources/{id}": {
      "get": {
        "operationId": "get_api_deliveries_source",
        "summary": "Lieferscheine · source",
        "tags": [
          "delivery-notes"
        ],
        "responses": {
          "200": {
            "description": "Quellpositionen mit belegter und restlicher Menge. Stornierte Lieferungen ohne Rechnungsbezug belegen nichts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeliverySource"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigenständige preislose Lieferungen oder Teilmengen aus genau einer Quelle: normaler Rechnungsentwurf, Auftragsbestätigung oder angenommenes Angebot. Freigabe hält eigene Originalmengen fest, ein Storno ohne Rechnungsbezug gibt sie frei. convert bindet vollständig und einmalig an den vorhandenen Entwurf, bereitet aus Lieferungen von Angebot oder Auftrag einen Entwurf zu den Preisen der Quelle vor oder aus ungebundenen Standalone-Lieferungen nach bewusster Preisprüfung einen gemeinsamen Entwurf. Ausstellung und Versand bleiben separat. Keine Delta-Cursor-/Resolver-Unterstützung für Order/Delivery zugesagt.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Art der Quelle. id ist die Kennung dieser Quelle.",
            "schema": {
              "type": "string",
              "enum": [
                "invoice",
                "sales_order",
                "quote"
              ],
              "default": "invoice"
            }
          }
        ]
      }
    },
    "/api/v1/delivery-notes/{id}": {
      "get": {
        "operationId": "get_api_deliveries_show",
        "summary": "Lieferscheine · show",
        "tags": [
          "delivery-notes"
        ],
        "responses": {
          "200": {
            "description": "Angebotsfassung mit Positionen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeliveryNote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigenständige preislose Lieferungen oder Teilmengen aus genau einer Quelle: normaler Rechnungsentwurf, Auftragsbestätigung oder angenommenes Angebot. Freigabe hält eigene Originalmengen fest, ein Storno ohne Rechnungsbezug gibt sie frei. convert bindet vollständig und einmalig an den vorhandenen Entwurf, bereitet aus Lieferungen von Angebot oder Auftrag einen Entwurf zu den Preisen der Quelle vor oder aus ungebundenen Standalone-Lieferungen nach bewusster Preisprüfung einen gemeinsamen Entwurf. Ausstellung und Versand bleiben separat. Keine Delta-Cursor-/Resolver-Unterstützung für Order/Delivery zugesagt.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_api_deliveries_update",
        "summary": "Lieferscheine · update",
        "tags": [
          "delivery-notes"
        ],
        "responses": {
          "200": {
            "description": "Angebotsfassung mit Positionen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeliveryNote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigenständige preislose Lieferungen oder Teilmengen aus genau einer Quelle: normaler Rechnungsentwurf, Auftragsbestätigung oder angenommenes Angebot. Freigabe hält eigene Originalmengen fest, ein Storno ohne Rechnungsbezug gibt sie frei. convert bindet vollständig und einmalig an den vorhandenen Entwurf, bereitet aus Lieferungen von Angebot oder Auftrag einen Entwurf zu den Preisen der Quelle vor oder aus ungebundenen Standalone-Lieferungen nach bewusster Preisprüfung einen gemeinsamen Entwurf. Ausstellung und Versand bleiben separat. Keine Delta-Cursor-/Resolver-Unterstützung für Order/Delivery zugesagt.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "type": "boolean"
                  },
                  "request_key": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "account_id": {
                    "type": "integer"
                  },
                  "delivery_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "handover_note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "source_invoice_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "source_sales_order_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "source_quote_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "source_hash": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "lines": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "article_id": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "detail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "quantity": {
                          "type": "string",
                          "pattern": "^\\d+(\\.\\d{1,6})?$"
                        },
                        "unit": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "source_line_id": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "quantity"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "recipient_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipient_street": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipient_postal_code": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipient_city": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recipient_country": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "request_key",
                  "account_id",
                  "delivery_date",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes/{id}/cancel": {
      "post": {
        "operationId": "post_api_deliveries_cancel",
        "summary": "Lieferscheine · cancel",
        "tags": [
          "delivery-notes"
        ],
        "responses": {
          "200": {
            "description": "Angebotsfassung mit Positionen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeliveryNote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigenständige preislose Lieferungen oder Teilmengen aus genau einer Quelle: normaler Rechnungsentwurf, Auftragsbestätigung oder angenommenes Angebot. Freigabe hält eigene Originalmengen fest, ein Storno ohne Rechnungsbezug gibt sie frei. convert bindet vollständig und einmalig an den vorhandenen Entwurf, bereitet aus Lieferungen von Angebot oder Auftrag einen Entwurf zu den Preisen der Quelle vor oder aus ungebundenen Standalone-Lieferungen nach bewusster Preisprüfung einen gemeinsamen Entwurf. Ausstellung und Versand bleiben separat. Keine Delta-Cursor-/Resolver-Unterstützung für Order/Delivery zugesagt.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "confirmed",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/delivery-notes/{id}/file": {
      "get": {
        "operationId": "get_api_deliveries_file",
        "summary": "Lieferscheine · file",
        "tags": [
          "delivery-notes"
        ],
        "responses": {
          "200": {
            "description": "Unverändertes gespeichertes preisloses PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigenständige preislose Lieferungen oder Teilmengen aus genau einer Quelle: normaler Rechnungsentwurf, Auftragsbestätigung oder angenommenes Angebot. Freigabe hält eigene Originalmengen fest, ein Storno ohne Rechnungsbezug gibt sie frei. convert bindet vollständig und einmalig an den vorhandenen Entwurf, bereitet aus Lieferungen von Angebot oder Auftrag einen Entwurf zu den Preisen der Quelle vor oder aus ungebundenen Standalone-Lieferungen nach bewusster Preisprüfung einen gemeinsamen Entwurf. Ausstellung und Versand bleiben separat. Keine Delta-Cursor-/Resolver-Unterstützung für Order/Delivery zugesagt.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/delivery-notes/{id}/release": {
      "post": {
        "operationId": "post_api_deliveries_release",
        "summary": "Lieferscheine · release",
        "tags": [
          "delivery-notes"
        ],
        "responses": {
          "200": {
            "description": "Angebotsfassung mit Positionen lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeliveryNote"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fassung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigenständige preislose Lieferungen oder Teilmengen aus genau einer Quelle: normaler Rechnungsentwurf, Auftragsbestätigung oder angenommenes Angebot. Freigabe hält eigene Originalmengen fest, ein Storno ohne Rechnungsbezug gibt sie frei. convert bindet vollständig und einmalig an den vorhandenen Entwurf, bereitet aus Lieferungen von Angebot oder Auftrag einen Entwurf zu den Preisen der Quelle vor oder aus ungebundenen Standalone-Lieferungen nach bewusster Preisprüfung einen gemeinsamen Entwurf. Ausstellung und Versand bleiben separat. Keine Delta-Cursor-/Resolver-Unterstützung für Order/Delivery zugesagt.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "confirmed"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/bwa": {
      "get": {
        "operationId": "get_api_v1_bwa",
        "summary": "Summator Basis-BWA v1: Monat/Quartal, Jahreskumulation und expliziter Vergleich",
        "tags": [
          "BWA"
        ],
        "responses": {
          "200": {
            "description": "Snapshot und mandantengebundene Standbindung",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BwaResult"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültiger Monat/Zeitraum, kein eindeutiges angelegtes Geschäftsjahr oder unpassende eigene Zuordnung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Reine Auswertung ohne persistente BWA-Tabelle und ohne Finanzmutation/Delta. Alle Summen in EUR-Cent aus festgeschriebenen Journalen nach booking_date; fiscal_years Von/Bis bestimmt die Jahreskumulation. Eigene reportbezogene Zuordnung benötigt zusätzlich das Buchungsrecht (Inhaber oder Buchhaltung, schreibender Zugang), verändert keine Konten oder GuV-Zuordnungen. Nicht zugeordnete Ergebnisanteile bleiben abstimmbar; fehlende/Nullvergleichsbasis hat null percent mit reason. binding trägt den authentifizierten Mandanten-Snapshot samt eingefrorenen HTML/CSV/JSON-Bytes zum Aufrufer, nicht in eine Serverhistorie. Downloads gesondert aufbewahren; ein neuer GET erzeugt einen neuen Datenstand. Keine DATEV-/Steuerberaterkompatibilität, keine Vollständigkeitsfreigabe. Details zu Aussagegrenzen stehen im normalen BWA-Bildschirm und den Downloads.",
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}$"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "month",
                "quarter"
              ]
            }
          },
          {
            "name": "compare",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "previous_period",
                "previous_year"
              ]
            }
          },
          {
            "name": "mappings",
            "in": "query",
            "required": false,
            "description": "Klammerschreibweise mappings[0][account_id], mappings[0][row], mappings[0][reason]. Maximal 100, nur eigene passende Konten. Nur dieser Snapshot; gespeicherte geprüfte GuV-Zuordnungen werden bei unverändertem Konto wiederverwendet.",
            "schema": {
              "type": "object",
              "maxProperties": 100,
              "additionalProperties": {
                "$ref": "#/components/schemas/BwaMappingInput"
              }
            },
            "style": "deepObject",
            "explode": true
          }
        ]
      }
    },
    "/api/v1/bwa/download": {
      "post": {
        "operationId": "post_api_v1_bwa_download",
        "summary": "Eingefrorenen BWA-Stand vertraulich herunterladen",
        "tags": [
          "BWA"
        ],
        "responses": {
          "200": {
            "description": "Exakte Snapshot-Datei mit Content-Disposition, X-Content-SHA256 und private/no-store",
            "headers": {
              "X-Content-SHA256": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BwaSnapshot"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Idempotency-Key gehört nicht zum Vertrag dieser Leseaktion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Veraltet ohne historical oder Validierung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Owner/Accountant + write. Mandantenbindung aus binding wird vor Rückgabe geprüft (fremder Stand: 404); veränderte Bindung: 422. Keine Neuberechnung, kein Journal-/Nummern-/Deltaeffekt und keine neue Downloadtabelle. Identischer binding/format-Aufruf liefert identische Bytes, auch nach neuen Journalen. Natürliche Wiederholbarkeit, keine Idempotenzquittung: Idempotency-Key ist für diese reine Leseaktion nicht unterstützt (400 idempotency_unsupported). Der Umschlag benötigt den ursprünglichen Anwendungsschlüssel; heruntergeladene Formate sind davon unabhängig. Kein Ressourcen-ID-Verweis außerhalb des vorhandenen Mandanten/Journal/Original-Vertrags.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BwaDownloadRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/year-end": {
      "get": {
        "operationId": "get_api_v1_year_end_index",
        "summary": "Geschäftsjahre und Abschlussprotokolle",
        "tags": [
          "Jahresabschluss"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Year-end result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YearEndEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported Idempotency-Key on this route; use the bound preview for replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid/cross-tenant bearer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient role, scope, access or preview ownership",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Tenant-local review or closure not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation, stale source, invalid binding or blocking findings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Interner Kalenderjahreswechsel EUR SKR03/04. Keine steuerliche oder externe Freigabe. Vorschau enthält konkrete Blocker/Abhilfe und vollständigen Quellenstand; close/reopen verlangt persönliche bewusste Bestätigung genau dieses Standes. Replay desselben Prüfstands ist wiederholsicher, nicht eine neue Freigabe."
      }
    },
    "/api/v1/year-end/actions": {
      "post": {
        "operationId": "post_api_v1_year_end_actions",
        "summary": "Prüfen, gebunden bestätigen und kontrolliert früh korrigieren",
        "tags": [
          "Jahresabschluss"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Year-end result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YearEndEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported Idempotency-Key on this route; use the bound preview for replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid/cross-tenant bearer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient role, scope, access or preview ownership",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Tenant-local review or closure not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation, stale source, invalid binding or blocking findings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Interner Kalenderjahreswechsel EUR SKR03/04. Keine steuerliche oder externe Freigabe. Vorschau enthält konkrete Blocker/Abhilfe und vollständigen Quellenstand; close/reopen verlangt persönliche bewusste Bestätigung genau dieses Standes. Replay desselben Prüfstands ist wiederholsicher, nicht eine neue Freigabe.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YearEndRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/year-end/{uuid}": {
      "get": {
        "operationId": "get_api_v1_year_end_show",
        "summary": "Unveränderliches Abschlussprotokoll",
        "tags": [
          "Jahresabschluss"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Year-end result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YearEndEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported Idempotency-Key on this route; use the bound preview for replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid/cross-tenant bearer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient role, scope, access or preview ownership",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Tenant-local review or closure not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation, stale source, invalid binding or blocking findings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Interner Kalenderjahreswechsel EUR SKR03/04. Keine steuerliche oder externe Freigabe. Vorschau enthält konkrete Blocker/Abhilfe und vollständigen Quellenstand; close/reopen verlangt persönliche bewusste Bestätigung genau dieses Standes. Replay desselben Prüfstands ist wiederholsicher, nicht eine neue Freigabe.",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/project-time-entries/{id}/{transition}": {
      "post": {
        "operationId": "post_api_v1_api_projects_timer",
        "summary": "timer · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTime99"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "transition",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "pause",
                "resume",
                "stop"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ended_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/projects": {
      "get": {
        "operationId": "get_api_v1_api_projects_index",
        "summary": "index · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Project99"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      },
      "post": {
        "operationId": "post_api_v1_api_projects_store",
        "summary": "store · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "201": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project99"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreate99"
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/projects/{id}": {
      "get": {
        "operationId": "get_api_v1_api_projects_show",
        "summary": "show · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectWorkspace99"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/projects/{id}/approve": {
      "post": {
        "operationId": "post_api_v1_api_projects_approve",
        "summary": "approve · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "project_id": {
                          "type": "integer"
                        },
                        "approved": {
                          "const": true
                        }
                      },
                      "required": [
                        "project_id",
                        "approved"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entries": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "uniqueItems": true,
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                },
                "required": [
                  "entries"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/projects/{id}/archive": {
      "post": {
        "operationId": "post_api_v1_api_projects_archive",
        "summary": "archive · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "project_id": {
                          "type": "integer"
                        },
                        "archived": {
                          "const": true
                        }
                      },
                      "required": [
                        "project_id",
                        "archived"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/projects/{id}/invoice-draft": {
      "post": {
        "operationId": "post_api_v1_api_projects_prepare",
        "summary": "prepare · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectBoundInvoice99"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 200
            },
            "description": "Vorhandener optionaler Idempotenzvertrag; gleiche Auswahl/Vorschau ist zusätzlich fachlich einmalig gebunden. 200 auch bei identischem Replay. Neue Freigabe erst nach beendeter Bindung und bewusstem release/approve."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectInvoiceConfirm99"
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/projects/{id}/invoice-preview": {
      "post": {
        "operationId": "post_api_v1_api_projects_preview",
        "summary": "preview · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectInvoicePreview99"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectInvoiceInput99"
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/projects/{id}/members": {
      "post": {
        "operationId": "post_api_v1_api_projects_member",
        "summary": "member · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "project_id": {
                          "type": "integer"
                        },
                        "saved": {
                          "const": true
                        }
                      },
                      "required": [
                        "project_id",
                        "saved"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe; offener eigener Timer vor Mitgliedschaftsdeaktivierung zu beenden.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "integer"
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "user_id",
                  "is_active"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab. Deaktivierung verlangt, dass das Teammitglied seinen laufenden oder pausierten Timer in diesem Projekt zuerst beendet. Die Prüfung und der Timerstart sind durch dieselbe Transaktionssperre serialisiert. Bei offenem Timer: 422, errors[\"member.is_active\"], Mitgliedschaft und Rohzeiten unverändert. Nach eigenem Stop erneut deaktivieren; anschließend entfällt die Projektsichtbarkeit."
      }
    },
    "/api/v1/projects/{id}/release": {
      "post": {
        "operationId": "post_api_v1_api_projects_release",
        "summary": "release · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "project_id": {
                          "type": "integer"
                        },
                        "released": {
                          "const": true
                        },
                        "approval_required": {
                          "const": true
                        }
                      },
                      "required": [
                        "project_id",
                        "released",
                        "approval_required"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entries": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "uniqueItems": true,
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                },
                "required": [
                  "entries"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/projects/{id}/tasks": {
      "post": {
        "operationId": "post_api_v1_api_projects_task",
        "summary": "task · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "201": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTask99"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "article_id": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/projects/{id}/time-entries": {
      "post": {
        "operationId": "post_api_v1_api_projects_record",
        "summary": "record · Projekte, Zeiten und gebundene Entwürfe",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "201": {
            "description": "Ergebnis der Aktion, keine Buchung/Nummer/Mail bei Vorbereitung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectTime99"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder nicht sichtbare mandanten-/mitgliedschaftsgebundene Quelle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Archiviert, Bindung bereits aktiv, Vorschau geändert oder Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Dauer/Zeitzone/Überlappung/Freigabe/Preisquelle/Status oder Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectTimeInput99"
              }
            }
          }
        },
        "description": "Dauer sekundengenau; HALF_UP Stunden auf sechs Stellen. Eine Position pro Eintrag/Leistungstag. Echter gültiger HUR-Artikelpreis des Kunden am expliziten Leistungstag. Aktive/interne/unfreigegebene Zeiten nicht abrechenbar. prepare friert Preisentscheidung ein und erzeugt nur einen normalen Entwurf. discard/issued/reversed bleiben historisch gebunden; release nur nach verworfenem Draft oder ausgestellter Korrektur, danach neue approve. Archivierung erhält Historie. Nur prepare unterstützt Idempotency-Key; andere neue Schreibaktionen lehnen einen Schlüssel als unsupported ab."
      }
    },
    "/api/v1/balance-sheet": {
      "post": {
        "operationId": "post_api_v1_balance_show",
        "summary": "Interne Bilanz erstellen oder gebunden lesen",
        "tags": [
          "Interne Bilanz"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Internes Summator-Bilanzschema/2, EUR, UG/GmbH, SKR03/04, Kalenderjahr. Vergleich ist vorheriger Jahresstichtag. Kein Testat, E-Bilanz- oder Abgabeschein. Quellbindung enthält Rohjournale, Abschlussrevisionen und Reportzuordnungen. Historische Downloads nur bewusst; fremde oder manipulierte Bindungen werden abgewiesen.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalanceReadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Gebundener interner Stand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet oder deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "403": {
            "description": "Rolle/Zugang/Export verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "404": {
            "description": "Fremder Mandant/Stand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "409": {
            "description": "Manipulierte Standhashbindung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "422": {
            "description": "Profil, Eingabe, Bestätigung oder Quellstand ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/balance-sheet/mappings": {
      "post": {
        "operationId": "post_api_v1_balance_mapping",
        "summary": "Begründete neue Reportzuordnung",
        "tags": [
          "Interne Bilanz"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Internes Summator-Bilanzschema/2, EUR, UG/GmbH, SKR03/04, Kalenderjahr. Vergleich ist vorheriger Jahresstichtag. Kein Testat, E-Bilanz- oder Abgabeschein. Quellbindung enthält Rohjournale, Abschlussrevisionen und Reportzuordnungen. Historische Downloads nur bewusst; fremde oder manipulierte Bindungen werden abgewiesen.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalanceMapRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Gebundener interner Stand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet oder deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "403": {
            "description": "Rolle/Zugang/Export verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "404": {
            "description": "Fremder Mandant/Stand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "409": {
            "description": "Manipulierte Standhashbindung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "422": {
            "description": "Profil, Eingabe, Bestätigung oder Quellstand ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/balance-sheet/download": {
      "post": {
        "operationId": "post_api_v1_balance_download",
        "summary": "Bewusster reproduzierbarer interner Download",
        "tags": [
          "Interne Bilanz"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Internes Summator-Bilanzschema/2, EUR, UG/GmbH, SKR03/04, Kalenderjahr. Vergleich ist vorheriger Jahresstichtag. Kein Testat, E-Bilanz- oder Abgabeschein. Quellbindung enthält Rohjournale, Abschlussrevisionen und Reportzuordnungen. Historische Downloads nur bewusst; fremde oder manipulierte Bindungen werden abgewiesen.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalanceDownloadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Exakte eingefrorene Bytes; keine externe Übermittlung.",
            "headers": {
              "X-Content-SHA256": {
                "schema": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceSnapshot"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet oder deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "403": {
            "description": "Rolle/Zugang/Export verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "404": {
            "description": "Fremder Mandant/Stand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "409": {
            "description": "Manipulierte Standhashbindung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "422": {
            "description": "Profil, Eingabe, Bestätigung oder Quellstand ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cost-centers": {
      "get": {
        "operationId": "get_api_v1_cost_centers",
        "summary": "Kostenstellen · GET /api/v1/cost-centers",
        "tags": [
          "cost-centers"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchungsänderung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CostCenter89"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Werte, unbekannte/inaktive Kostenstelle oder unzulässiger Split",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_cost_centers",
        "summary": "Kostenstellen · POST /api/v1/cost-centers",
        "tags": [
          "cost-centers"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "201": {
            "description": "Ergebnis der Aktion, keine Buchungsänderung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CostCenter89"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Werte, unbekannte/inaktive Kostenstelle oder unzulässiger Split",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CostCenterInput89"
              }
            }
          }
        }
      }
    },
    "/api/v1/cost-centers/{id}": {
      "patch": {
        "operationId": "patch_api_v1_cost_centers_id",
        "summary": "Kostenstellen · PATCH /api/v1/cost-centers/{id}",
        "tags": [
          "cost-centers"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis der Aktion, keine Buchungsänderung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CostCenter89"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Werte, unbekannte/inaktive Kostenstelle oder unzulässiger Split",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "is_active"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/cost-center-reports": {
      "post": {
        "operationId": "post_api_v1_cost_center_reports",
        "summary": "Kostenstellen · POST /api/v1/cost-center-reports",
        "tags": [
          "cost-centers"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "201": {
            "description": "Gespeicherter Bericht, vorläufig und reproduzierbar, keine Buchungsänderung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CostCenterReport89"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Werte, unbekannte/inaktive Kostenstelle oder unzulässiger Split",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "format": "date"
                  },
                  "to": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "from",
                  "to"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/cost-center-reports/{id}": {
      "get": {
        "operationId": "get_api_v1_cost_center_reports_id",
        "summary": "Kostenstellen · GET /api/v1/cost-center-reports/{id}",
        "tags": [
          "cost-centers"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeicherter Bericht, vorläufig und reproduzierbar, keine Buchungsänderung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CostCenterReport89"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Werte, unbekannte/inaktive Kostenstelle oder unzulässiger Split",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/cost-center-reports/{id}/download": {
      "get": {
        "operationId": "get_api_v1_cost_center_reports_id_download",
        "summary": "Kostenstellen · GET /api/v1/cost-center-reports/{id}/download",
        "tags": [
          "cost-centers"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Unveränderte eingefrorene Quelle, SHA256 in X-Content-SHA256; gleicher Snapshot liefert gleiche Bytes.",
            "headers": {
              "X-Content-SHA256": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostCenterReport89"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Werte, unbekannte/inaktive Kostenstelle oder unzulässiger Split",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "html"
              ],
              "default": "json"
            }
          }
        ]
      }
    },
    "/api/v1/quotes/{id}/portal": {
      "get": {
        "operationId": "portal76_history",
        "summary": "Freigabe- und Entscheidungshistorie einer Angebotsfassung",
        "tags": [
          "quotes"
        ],
        "description": "Aktive Mandantenbenutzer; Schreiben nur mit Buchungsrecht und schreibendem Zugang. Fremde oder unbekannte Referenz: 404. Keine Rechnung/Buchung/Mail. Idempotency-Key ist auf diesem Pfad ausdrücklich nicht unterstützt (400); Ausgabe des neuen Roh-Links wird niemals persistiert. Widerruf ohne Schlüssel ist fachlich idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Freigabe- und Entscheidungshistorie einer Angebotsfassung",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store, max-age=0"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotePortalHistory"
                }
              }
            }
          },
          "400": {
            "description": "Idempotency-Key auf diesem Pfad nicht unterstützt"
          },
          "403": {
            "description": "Rolle oder Zugang verweigert"
          },
          "404": {
            "description": "Unbekannte oder fremde Referenz"
          },
          "409": {
            "description": "Fassung ist nicht aktuell freigegeben"
          }
        }
      },
      "post": {
        "operationId": "portal76_issue",
        "summary": "Bewusst neuen fassungsgebundenen Freigabelink erzeugen; ersetzt vorherigen Link",
        "tags": [
          "quotes"
        ],
        "description": "Aktive Mandantenbenutzer; Schreiben nur mit Buchungsrecht und schreibendem Zugang. Fremde oder unbekannte Referenz: 404. Keine Rechnung/Buchung/Mail. Idempotency-Key ist auf diesem Pfad ausdrücklich nicht unterstützt (400); Ausgabe des neuen Roh-Links wird niemals persistiert. Widerruf ohne Schlüssel ist fachlich idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Bewusst neuen fassungsgebundenen Freigabelink erzeugen; ersetzt vorherigen Link",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store, max-age=0"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotePortalIssued"
                }
              }
            }
          },
          "400": {
            "description": "Idempotency-Key auf diesem Pfad nicht unterstützt"
          },
          "403": {
            "description": "Rolle oder Zugang verweigert"
          },
          "404": {
            "description": "Unbekannte oder fremde Referenz"
          },
          "409": {
            "description": "Fassung ist nicht aktuell freigegeben"
          }
        }
      }
    },
    "/api/v1/quotes/{id}/portal/{uuid}/revoke": {
      "post": {
        "operationId": "portal76_revoke",
        "summary": "Portalzugang widerrufen, Historie unverändert erhalten",
        "tags": [
          "quotes"
        ],
        "description": "Aktive Mandantenbenutzer; Schreiben nur mit Buchungsrecht und schreibendem Zugang. Fremde oder unbekannte Referenz: 404. Keine Rechnung/Buchung/Mail. Idempotency-Key ist auf diesem Pfad ausdrücklich nicht unterstützt (400); Ausgabe des neuen Roh-Links wird niemals persistiert. Widerruf ohne Schlüssel ist fachlich idempotent.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Portalzugang widerrufen, Historie unverändert erhalten",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store, max-age=0"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotePortalHistory"
                }
              }
            }
          },
          "400": {
            "description": "Idempotency-Key auf diesem Pfad nicht unterstützt"
          },
          "403": {
            "description": "Rolle oder Zugang verweigert"
          },
          "404": {
            "description": "Unbekannte oder fremde Referenz"
          },
          "409": {
            "description": "Fassung ist nicht aktuell freigegeben"
          }
        }
      }
    },
    "/api/v1/self-billing-agreements": {
      "get": {
        "operationId": "self_billing_agreements",
        "summary": "Selbstabrechnung: agreements",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SelfBillingAgreement"
                          }
                        }
                      },
                      "required": [
                        "data"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage."
      },
      "post": {
        "operationId": "self_billing_agreement",
        "summary": "Selbstabrechnung: agreement",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "201": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SelfBillingAgreement"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "409": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "415": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "503": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage.",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelfBillingAgreementInput"
              }
            }
          }
        }
      }
    },
    "/api/v1/self-billings": {
      "get": {
        "operationId": "self_billing_index",
        "summary": "Selbstabrechnung: index",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SelfBilling"
                          }
                        }
                      },
                      "required": [
                        "data"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage."
      },
      "post": {
        "operationId": "self_billing_store",
        "summary": "Selbstabrechnung: store",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "201": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SelfBilling"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "409": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "415": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "503": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage.",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelfBillingInput"
              }
            }
          }
        }
      }
    },
    "/api/v1/self-billings/{id}": {
      "get": {
        "operationId": "self_billing_show",
        "summary": "Selbstabrechnung: show",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SelfBilling"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "patch": {
        "operationId": "self_billing_update",
        "summary": "Selbstabrechnung: update",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SelfBilling"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "409": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "415": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "503": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelfBillingInput"
              }
            }
          }
        }
      }
    },
    "/api/v1/self-billings/{id}/preview": {
      "post": {
        "operationId": "self_billing_preview",
        "summary": "Selbstabrechnung: preview",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "facts": {
                          "type": "object"
                        },
                        "confirmation": {
                          "type": "string"
                        },
                        "scope": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "facts",
                        "confirmation",
                        "scope"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "409": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "415": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "503": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        }
      }
    },
    "/api/v1/self-billings/{id}/issue": {
      "post": {
        "operationId": "self_billing_issue",
        "summary": "Selbstabrechnung: issue",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SelfBilling"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "409": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "415": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "503": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmation": {
                    "type": "string"
                  },
                  "output_profile": {
                    "const": "pdf"
                  }
                },
                "required": [
                  "confirmation"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/self-billings/{id}/correct": {
      "post": {
        "operationId": "self_billing_correct",
        "summary": "Selbstabrechnung: correct",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "201": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SelfBilling"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "409": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "415": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "503": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/self-billings/{id}/objection": {
      "post": {
        "operationId": "self_billing_objection",
        "summary": "Selbstabrechnung: objection",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes Fachresultat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SelfBilling"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "409": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "415": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "503": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 2000
                  },
                  "occurred_on": {
                    "type": "string",
                    "format": "date"
                  },
                  "document_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "reason",
                  "occurred_on",
                  "document_id"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/self-billings/{id}/file": {
      "get": {
        "operationId": "self_billing_file",
        "summary": "Selbstabrechnung: file",
        "description": "Getrennter Lieferantenweg. Im Betrieb noch nicht verfügbar, neue Vereinbarungen werden abgewiesen. Keine Zahlung/Mail/XML. Bezahlte, beanstandete oder jahresübergreifende Korrektur gesperrt. Kein neues Deltaresource; list/show verwenden. Ganzzahlige Cent; Ausstellaktion nur nach signierter Vorschau.",
        "tags": [
          "self-billing"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeichertes geprüftes Original PDF; no-store/nosniff",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "403": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "404": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "422": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          },
          "429": {
            "description": "Anmeldung/Recht/Mandant/Referenz/Validierung/Limit/Idempotenzkonflikt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfBillingError"
                }
              }
            }
          }
        },
        "x-idempotency": "Optional Idempotency-Key mit gesamtem Payload; Konflikt 409. Intrinsisch issue replay, unique Vollkorrektur und Widerspruch. Keine globale exactly-once Zusage.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/fx-settlements": {
      "post": {
        "operationId": "post_api_v1_fx_settlements",
        "summary": "USD-Original gegen belegten EUR-Bankeingang prüfen und bewusst ausgleichen",
        "tags": [
          "fx"
        ],
        "description": "Profil summator-fx/1, dieselbe Wirkung wie in Oberfläche und MCP. Nur EUR-Bankdatei, deutsches Soll-/Kalenderjahrprofil und USD-Teilbetrag. Datierter Kurs, Quellhash und UUID binden Vorschau/Bestätigung/Replay. Gebühren, Überzahlung, Skonto und Jahresgrenzen werden vor Mutation abgewiesen.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FxSettlementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Aktuelle gebundene Vorschau oder derselbe bestätigte Ausgleich; keine zweite Finanzwirkung beim Replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FxSettlementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "committed": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "entry_number": {
                                    "anyOf": [
                                      {
                                        "type": "integer"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "entry_id": {
                                    "type": "integer",
                                    "minimum": 1
                                  }
                                },
                                "required": [
                                  "key",
                                  "entry_number",
                                  "entry_id"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "failed": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "key",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "committed",
                            "failed"
                          ],
                          "additionalProperties": false
                        },
                        "setup": {
                          "type": "object",
                          "properties": {
                            "complete": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "missing": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "complete",
                            "message",
                            "missing"
                          ],
                          "additionalProperties": false
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "overdue",
                                "payment_failed"
                              ]
                            },
                            "can_write": {
                              "type": "boolean"
                            },
                            "message": {
                              "type": "string"
                            },
                            "due_by": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "amount_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reference": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "transfer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "status",
                            "can_write",
                            "message",
                            "due_by",
                            "amount_cents",
                            "reference",
                            "transfer"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "data"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{id}/validation": {
      "get": {
        "operationId": "get_api_v1_documents_validation_show",
        "summary": "Versionierten Normprüfstand lesen",
        "tags": [
          "documents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tatsächlicher aktueller Prüfstand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingValidationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Berechtigung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Beleg/Bericht im Mandanten nicht vorhanden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Eingabe oder Buchungsentscheidung abgewiesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Anfragelimit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_documents_validation_store",
        "summary": "Neuen Normprüfbericht anhängen",
        "tags": [
          "documents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Tatsächlicher aktueller Prüfstand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingValidationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Berechtigung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Beleg/Bericht im Mandanten nicht vorhanden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Eingabe oder Buchungsentscheidung abgewiesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Anfragelimit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ruleset": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{id}/validation/acknowledgements": {
      "post": {
        "operationId": "post_api_v1_documents_validation_acknowledge",
        "summary": "Aktuellen Prüfstand begründet bestätigen",
        "tags": [
          "documents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Tatsächlicher aktueller Prüfstand",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "acknowledgement_id": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "acknowledgement_id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Berechtigung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Beleg/Bericht im Mandanten nicht vorhanden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Eingabe oder Buchungsentscheidung abgewiesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Anfragelimit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "report_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "report_id",
                  "reason"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{id}/validation/{report}": {
      "get": {
        "operationId": "get_api_v1_documents_validation_report",
        "summary": "Unveränderten Prüfbericht herunterladen",
        "tags": [
          "documents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "report",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "enum": [
                "json",
                "xml",
                "embedded"
              ],
              "default": "json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tatsächlicher aktueller Prüfstand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingValidationRawReport"
                }
              },
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Anmeldung erforderlich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Berechtigung fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Beleg/Bericht im Mandanten nicht vorhanden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Eingabe oder Buchungsentscheidung abgewiesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Anfragelimit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/{id}/visibility": {
      "post": {
        "operationId": "post_api_v1_documents_id_visibility",
        "summary": "Fehlimport aus- oder einblenden",
        "tags": [
          "documents"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Nur ungebuchte, ungesperrte Fehlimporte mit Prüfbericht. Das Original bleibt erhalten, jede Änderung steht in der Historie. Schreibrecht und Rolle mit Buchungsrecht erforderlich.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hidden": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "hidden",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Neuer Stand mit Historie",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "hidden": {
                          "type": "boolean"
                        },
                        "history": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DocumentVisibilityEvent"
                          }
                        }
                      },
                      "required": [
                        "hidden",
                        "history"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Beleg gibt es nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Begründung ungültig oder Beleg nicht ausblendbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/vat/xml/preview": {
      "post": {
        "operationId": "post_api_v1_reports_vat_xml_preview",
        "summary": "UStVA-XML vorprüfen",
        "tags": [
          "reports"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Vorschau für den manuellen Import in Mein ELSTER. Liefert Werte, Sperren und den Fingerabdruck für die Bestätigung, aber keine XML-Bytes. Summator übermittelt nichts an ELSTER.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "period": {
                    "type": "string",
                    "maxLength": 7,
                    "description": "Abgeschlossener Monat oder Quartal 2026 gemäß den Einstellungen."
                  },
                  "corrected": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "period",
                  "corrected"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Vorschau",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VatXmlPreview"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Zeitraum nicht abgeschlossen oder nicht unterstützt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/vat/xml/exports": {
      "get": {
        "operationId": "get_api_v1_reports_vat_xml_exports",
        "summary": "Gespeicherte UStVA-XML-Dateien auflisten",
        "tags": [
          "reports"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Neueste zuerst, aus dem unveränderlichen Stand gelesen. „created“ ist der einzige Zustand.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Eine Seite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/VatXmlExport"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer"
                        },
                        "per_page": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "page",
                        "per_page",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Seite",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_reports_vat_xml_exports",
        "summary": "UStVA-XML erzeugen",
        "tags": [
          "reports"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Bindet den Fingerabdruck der Vorschau. Derselbe Stand liefert dieselbe Datei mit 200, neu entsteht sie mit 201.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "period": {
                    "type": "string",
                    "maxLength": 7,
                    "description": "Abgeschlossener Monat oder Quartal 2026 gemäß den Einstellungen."
                  },
                  "corrected": {
                    "type": "boolean"
                  },
                  "fingerprint": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "confirmed": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "period",
                  "corrected",
                  "fingerprint",
                  "confirmed"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dieselbe Datei bestand schon",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VatXmlExport"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "Datei erzeugt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VatXmlExport"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Nicht bestätigt, Sperre oder geänderter Stand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/vat/xml/exports/{id}": {
      "get": {
        "operationId": "get_api_v1_reports_vat_xml_exports_id",
        "summary": "Stand einer UStVA-XML-Datei",
        "tags": [
          "reports"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Ohne XML-Bytes.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stand",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VatXmlExport"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Datei gibt es nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/vat/xml/exports/{id}/download": {
      "get": {
        "operationId": "get_api_v1_reports_vat_xml_exports_id_download",
        "summary": "UStVA-XML herunterladen",
        "tags": [
          "reports"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Liefert die gespeicherten Bytes in ISO-8859-15.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "XML-Datei",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Datei gibt es nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Die gespeicherte Datei passt nicht mehr zu ihrer Prüfsumme",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notification-devices": {
      "get": {
        "operationId": "get_api_v1_notification_devices",
        "summary": "Eigene Geräte auflisten",
        "tags": [
          "notifications"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Nur mit dem App-Token der Summator-App, ein API-Schlüssel ergibt 403. Betrifft nur die Geräte dieses Tokens. Geräte des angemeldeten Benutzers für Mitteilungen.",
        "responses": {
          "200": {
            "description": "Geräte",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NotificationDevice"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Kein App-Token, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notification-devices/{id}/preferences": {
      "get": {
        "operationId": "get_api_v1_notification_devices_id_preferences",
        "summary": "Einstellungen eines Geräts lesen",
        "tags": [
          "notifications"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Gerät",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotificationDevice"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Kein App-Token, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Gerät gibt es nicht oder gehört einem anderen Benutzer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Nur mit dem App-Token der Summator-App, ein API-Schlüssel ergibt 403. Betrifft nur die Geräte dieses Tokens."
      },
      "patch": {
        "operationId": "patch_api_v1_notification_devices_id_preferences",
        "summary": "Einstellungen eines Geräts ändern",
        "tags": [
          "notifications"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Nur mit dem App-Token der Summator-App, ein API-Schlüssel ergibt 403. Betrifft nur die Geräte dieses Tokens. Mit `version` des zuletzt gelesenen Stands.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "preferences": {
                    "type": "object",
                    "properties": {
                      "document-review": {
                        "type": "boolean"
                      },
                      "bank-work": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1
                  }
                },
                "required": [
                  "version",
                  "preferences"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Gerät",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotificationDevice"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Kein App-Token, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Gerät gibt es nicht oder gehört einem anderen Benutzer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Versionskonflikt oder Gerät entzogen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notification-devices/{id}": {
      "delete": {
        "operationId": "delete_api_v1_notification_devices_id",
        "summary": "Gerät abmelden",
        "tags": [
          "notifications"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Nur mit dem App-Token der Summator-App, ein API-Schlüssel ergibt 403. Betrifft nur die Geräte dieses Tokens. Danach geht an dieses Gerät nichts mehr.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Abgemeldet"
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Kein App-Token, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Gerät gibt es nicht oder gehört einem anderen Benutzer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "put_api_v1_notification_devices_id",
        "summary": "Gerät anmelden oder aktualisieren",
        "tags": [
          "notifications"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Nur mit dem App-Token der Summator-App, ein API-Schlüssel ergibt 403. Betrifft nur die Geräte dieses Tokens. `version` ist 0 bei der ersten Anmeldung, danach der zuletzt gelesene Stand. Dieselbe `request_id` wiederholt die Anfrage ohne neue Wirkung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Zufällige Installationskennung der App (UUID v4). Die Antwort nennt die Kennung des Geräts für die anderen Aufrufe.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ios",
                      "android"
                    ]
                  },
                  "provider": {
                    "type": "string",
                    "enum": [
                      "apns",
                      "fcm"
                    ],
                    "description": "ios gehört zu apns, android zu fcm."
                  },
                  "token": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4096
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Pflicht, wenn permission granted ist."
                  },
                  "app_version": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "permission": {
                    "type": "string",
                    "enum": [
                      "granted",
                      "denied",
                      "undetermined"
                    ]
                  },
                  "preferences": {
                    "type": "object",
                    "properties": {
                      "document-review": {
                        "type": "boolean"
                      },
                      "bank-work": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "version": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "request_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "platform",
                  "provider",
                  "app_version",
                  "permission",
                  "version",
                  "request_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Gerät",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotificationDevice"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Kein App-Token, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Gerät gehört einem anderen Benutzer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Versionskonflikt, Gerät entzogen oder Token anderweitig belegt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications/resolve": {
      "post": {
        "operationId": "post_api_v1_notifications_resolve",
        "summary": "Ziel einer Mitteilung auflösen",
        "tags": [
          "notifications"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Liefert nur Zieltyp, Kennung und Zustand. Die Inhalte lädt die App danach mit ihrem Zugang. Eine Mitteilung gilt sieben Tage.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reference": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{32}$"
                  }
                },
                "required": [
                  "reference"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ziel",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotificationTarget"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Token fehlt, abgelaufen, widerrufen, falscher Mandant oder Benutzer deaktiviert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Zugang, Rolle oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte, abgelaufene oder fremde Mitteilung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 Anfragen je Minute, Mandant und Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payment-orders": {
      "get": {
        "operationId": "get_api_v1_payment_orders",
        "summary": "Zahlungsaufträge lesen",
        "tags": [
          "bank"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Die letzten 100 Zahlungsaufträge mit Zeilen und Zustand. Nur wo Zahlungen freigeschaltet sind, sonst 404.",
        "responses": {
          "200": {
            "description": "Zahlungsaufträge lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentOrder"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Zahlungen sind für dieses Unternehmen nicht freigeschaltet oder der Auftrag existiert nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_payment_orders",
        "summary": "Zahlungsauftrag vorbereiten",
        "tags": [
          "bank"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Bereitet eine Einzel- oder Sammelüberweisung offener Eingangsrechnungen in Euro vor. Empfänger, IBAN, Betrag und Zweck kommen aus dem Beleg, wenn sie fehlen. Mit instant=true wird die Einzelüberweisung als Sofortüberweisung (SCT Inst) vorbereitet; das geht nur mit genau einer Rechnung und nur von einem Konto, dessen Bankzugang über ein gekoppeltes Gerät läuft, sonst 422. Gesendet wird über die API nie. Was in der Oberfläche folgt, hängt vom Bankzugang des Kontos ab: Der Kunde gibt den Auftrag mit Passwort und Code für sein gekoppeltes Gerät frei und sendet ihn dort mit PIN und TAN, er reicht ihn über EBICS mit Passwort und Code ein und gibt ihn in der App seiner Bank frei, oder er sendet ihn (Installation beim Kunden) mit Passwort, Code, PIN und TAN. Eine Sofortüberweisung sendet nur die Summator-App.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bank_account_id": {
                    "type": "integer"
                  },
                  "instant": {
                    "type": "boolean",
                    "description": "true: Sofortüberweisung (SCT Inst). Ohne Angabe eine Standardüberweisung. Nur mit genau einer Rechnung und nur von einem Konto, dessen Bankzugang über ein gekoppeltes Gerät läuft."
                  },
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "line_id": {
                          "type": "integer",
                          "description": "Buchungszeile einer Eingangsrechnung der Buchhaltung (open-items). Genau eines von line_id oder dms_document_id."
                        },
                        "dms_document_id": {
                          "type": "integer",
                          "description": "Rechnungsdokument im Summator DMS (Eingangsrechnung mit bestätigten Rechnungsangaben, zahlbar nach der letzten Freigabestufe). Genau eines von line_id oder dms_document_id."
                        },
                        "recipient_name": {
                          "type": "string"
                        },
                        "iban": {
                          "type": "string"
                        },
                        "bic": {
                          "type": "string"
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "purpose": {
                          "type": "string"
                        }
                      },
                      "minProperties": 1
                    }
                  }
                },
                "required": [
                  "bank_account_id",
                  "items"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Vorbereitet",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/PaymentOrder"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/payment-orders/{id}": {
      "get": {
        "operationId": "get_api_v1_payment_orders_id",
        "summary": "Einen Zahlungsauftrag lesen",
        "tags": [
          "bank"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "description": "Ein Zahlungsauftrag mit Zeilen, Antwort der Bank und Empfängerprüfung.",
        "responses": {
          "200": {
            "description": "Einen Zahlungsauftrag lesen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentOrder"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Zahlungen sind für dieses Unternehmen nicht freigeschaltet oder der Auftrag existiert nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/geraet/koppeln": {
      "post": {
        "operationId": "post_api_geraet_koppeln",
        "summary": "Gerät mit Kopplungscode koppeln",
        "description": "Die App oder die Browser-Erweiterung löst den Kopplungscode aus Summator (Bank → Verbindungen, 15 Minuten gültig) genau einmal gegen einen Geräteschlüssel ein. Der Schlüssel steht nur in dieser Antwort.",
        "tags": [
          "geraet"
        ],
        "security": [
          {
            "geraeteschluessel": []
          }
        ],
        "responses": {
          "201": {
            "description": "Geräteschlüssel, Gerät und Bankverbindung",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "422": {
            "description": "Code unbekannt, abgelaufen oder schon eingelöst; oder Zugangsdaten im Körper",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "10 je Minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Acht Zeichen, mit oder ohne Bindestrich"
                  }
                },
                "required": [
                  "code"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/v1/geraet": {
      "get": {
        "operationId": "get_api_geraet_show",
        "summary": "Gerät, Bankverbindung und Abrufstand",
        "description": "Bankverbindung, ihre Konten mit dem Tag, bis zu dem abgerufen ist, letzter Kontostand und wie viele freigegebene Zahlungen warten. Daraus berechnet das Gerät, ab wann es bei der Bank abruft.",
        "tags": [
          "geraet"
        ],
        "security": [
          {
            "geraeteschluessel": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gerät und Bankverbindung",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Kein oder ein widerrufener Geräteschlüssel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_api_geraet_abmelden",
        "summary": "Gerät abmelden",
        "description": "Widerruft den eigenen Geräteschlüssel endgültig.",
        "tags": [
          "geraet"
        ],
        "security": [
          {
            "geraeteschluessel": []
          }
        ],
        "responses": {
          "200": {
            "description": "Widerrufen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Kein oder ein widerrufener Geräteschlüssel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/geraet/umsaetze": {
      "post": {
        "operationId": "post_api_geraet_umsaetze",
        "summary": "Abgerufene Umsätze und Kontostand abliefern",
        "description": "Auszüge so, wie die Bank sie liefert (MT940 oder CAMT.053), und je Konto der abgerufene Tag und der Kontostand in Cent. Sie laufen durch denselben Import wie jede Auszugsdatei: Beleg, Prüfung auf Dubletten, Saldenkette, Abgleich der Zahlungsaufträge. Nur Konten der eigenen Bankverbindung. PIN, TAN und Anmeldename nimmt die Schnittstelle nicht an.",
        "tags": [
          "geraet"
        ],
        "security": [
          {
            "geraeteschluessel": []
          }
        ],
        "responses": {
          "200": {
            "description": "Eingelesen: Auszüge, neue Umsätze, Dubletten, Hinweise",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Kein oder ein widerrufener Geräteschlüssel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Kein Schreibzugang (Abo)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ein Feld heißt wie Zugangsdaten (PIN, TAN, Passwort, Anmeldename) oder ist unbekannt — nichts wird angenommen.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "auszuege": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "format",
                        "inhalt"
                      ],
                      "properties": {
                        "format": {
                          "type": "string",
                          "enum": [
                            "mt940",
                            "camt053"
                          ]
                        },
                        "inhalt": {
                          "type": "string",
                          "description": "Der Auszug unverändert, wie von der Bank geliefert"
                        }
                      }
                    }
                  },
                  "konten": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "iban"
                      ],
                      "properties": {
                        "iban": {
                          "type": "string"
                        },
                        "abgerufen_bis": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date"
                        },
                        "kontostand_cents": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                        },
                        "kontostand_am": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/geraet/institute": {
      "get": {
        "operationId": "get_api_geraet_institute",
        "summary": "Bankenverzeichnis für die Einrichtung auf dem Gerät",
        "description": "Suche nach Name, Ort, Bankleitzahl oder BIC (Parameter suche, mindestens zwei Zeichen). Geliefert werden nur Banken mit FinTS-Adresse: blz, name, city, bic, url. Vom Gerät kommt nur der Suchtext.",
        "tags": [
          "geraet"
        ],
        "security": [
          {
            "geraeteschluessel": []
          }
        ],
        "responses": {
          "200": {
            "description": "Höchstens 20 Banken mit FinTS-Adresse",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Kein oder ein widerrufener Geräteschlüssel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Suchtext fehlt, ist zu kurz oder ein Feld ist unbekannt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "suche",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            }
          }
        ]
      }
    },
    "/api/v1/geraet/hinweis": {
      "post": {
        "operationId": "post_api_geraet_hinweis",
        "summary": "Hinweis zum Bankzugang melden",
        "description": "Das Gerät meldet, dass die Bank eine neue Freigabe verlangt (freigabe_noetig) oder die gespeicherte PIN abgelehnt hat (pin_abgelehnt); null hebt den Hinweis auf. Summator zeigt ihn unter Bank → Verbindungen. Nur diese festen Werte, kein Text.",
        "tags": [
          "geraet"
        ],
        "security": [
          {
            "geraeteschluessel": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gespeichert",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Kein oder ein widerrufener Geräteschlüssel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unbekannter Wert oder unbekanntes Feld.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "hinweis"
                ],
                "properties": {
                  "hinweis": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "freigabe_noetig",
                      "pin_abgelehnt",
                      null
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/geraet/zahlungen": {
      "get": {
        "operationId": "get_api_geraet_zahlungen",
        "summary": "Freigegebene Zahlungsaufträge",
        "description": "Aufträge der eigenen Bankverbindung, die in Summator vorbereitet und mit Passwort und Code freigegeben, aber noch nicht abgeholt sind. Je Auftrag sagt instant, ob er als Sofortüberweisung (SCT Inst) zu senden ist.",
        "tags": [
          "geraet"
        ],
        "security": [
          {
            "geraeteschluessel": []
          }
        ],
        "responses": {
          "200": {
            "description": "Liste der Aufträge mit Zeilen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Kein oder ein widerrufener Geräteschlüssel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/geraet/zahlungen/{id}/abholen": {
      "post": {
        "operationId": "post_api_geraet_zahlungen_abholen",
        "summary": "Zahlungsauftrag abholen",
        "description": "Holt einen freigegebenen Auftrag genau einmal ab; danach steht er auf „gesendet“ und gehört diesem Gerät. Die Antwort enthält Zeilen, SEPA-Datei (pain.001) und Fingerabdruck. Meldet das Gerät innerhalb der Frist kein Ergebnis, steht der Auftrag auf „unbekannt“ und wird nie wiederholt. Eine Sofortüberweisung (instant=true) gibt Summator nur der Summator-App heraus, und nur, wenn die Anfrage instant=true nennt; damit sagt sie zu, den Auftrag dem Kunden als Sofortüberweisung gezeigt zu haben, ihn als solche zu senden und keine Umwandlung in eine Standardüberweisung zuzulassen. Sonst 422, auch für die Browser-Erweiterung mit instant=true, und der Auftrag bleibt freigegeben. Die SEPA-Datei trägt dann das Local Instrument INST.",
        "tags": [
          "geraet"
        ],
        "security": [
          {
            "geraeteschluessel": []
          }
        ],
        "responses": {
          "200": {
            "description": "Auftrag zum Senden an die Bank",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Kein oder ein widerrufener Geräteschlüssel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Kein Auftrag dieser Bankverbindung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Nicht freigegeben oder schon abgeholt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ein Feld heißt wie Zugangsdaten (PIN, TAN, Passwort, Anmeldename) oder ist unbekannt — nichts wird angenommen. Oder der Auftrag ist eine Sofortüberweisung und die Anfrage nennt nicht instant=true — dann bleibt er freigegeben, und die Meldung sagt dem Kunden, was zu tun ist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "schema": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "pain.001-Fassung, die die Bank annimmt"
                  },
                  "instant": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "true: Das Gerät sendet diesen Auftrag als Sofortüberweisung (HKIPZ) und erlaubt der Bank keine Umwandlung in eine Standardüberweisung. Nötig bei einem Auftrag mit instant = true, sonst weglassen."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/api/v1/geraet/zahlungen/{id}/ergebnis": {
      "post": {
        "operationId": "post_api_geraet_zahlungen_ergebnis",
        "summary": "Ergebnis der Bank melden",
        "description": "Nur das Gerät, das abgeholt hat: angenommen, abgelehnt, nicht_gesendet oder unbekannt, dazu der Text der Bank und die Empfängerprüfung. Ausgeglichen wird die Rechnung erst mit der Abbuchung im Kontoabruf.",
        "tags": [
          "geraet"
        ],
        "security": [
          {
            "geraeteschluessel": []
          }
        ],
        "responses": {
          "200": {
            "description": "Auftrag im neuen Zustand",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Kein oder ein widerrufener Geräteschlüssel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht von diesem Gerät abgeholt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Schon abgeschlossen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ein Feld heißt wie Zugangsdaten (PIN, TAN, Passwort, Anmeldename) oder ist unbekannt — nichts wird angenommen.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "ergebnis"
                ],
                "properties": {
                  "ergebnis": {
                    "type": "string",
                    "enum": [
                      "angenommen",
                      "abgelehnt",
                      "nicht_gesendet",
                      "unbekannt"
                    ]
                  },
                  "bank_antwort": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000
                  },
                  "empfaenger_pruefung": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 32
                  },
                  "empfaenger_text": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/api/v1/accounts/{number}/semantics": {
      "get": {
        "operationId": "get_api_v1_accounts_number_semantics",
        "summary": "Bedeutung eines Kontos lesen",
        "tags": [
          "accounts"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Geltende Bedeutung des Sachkontos (Zweck, Standard-Steuerschlüssel, Beispiele, Ausschlüsse, typische Lieferanten) und alle Fassungen, die jüngste zuerst. data ist null, wenn keine Bedeutung hinterlegt oder sie entfernt ist. Die Bedeutung ist kein Teil einer Buchung.",
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bedeutung eines Kontos lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "account": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "number": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "number",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/AccountSemantics"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountSemantics"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "account",
                    "data",
                    "history"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "put_api_v1_accounts_number_semantics",
        "summary": "Bedeutung eines Kontos pflegen",
        "tags": [
          "accounts"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Legt eine neue Fassung der Bedeutung an; die vorige bleibt in history. Nur genannte Felder ändern sich, eine Liste ersetzt die bisherige ganz, null oder leer entfernt ein Feld. Ohne Änderung entsteht keine Fassung. default_tax_key ist der Code eines aktiven Steuerschlüssels passender Richtung (Vorsteuer für Aufwand, Umsatzsteuer für Erlös) und nur ein Vorschlag: ein Satz aus Eingabe oder Beleg geht vor. Nur Sachkonten, keine Personenkonten. Idempotency-Key wird mit 400 idempotency_unsupported abgewiesen.",
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "purpose": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "default_tax_key": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 32
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "examples": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 200
                    }
                  },
                  "exclusions": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 200
                            },
                            "account": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[0-9]{3,9}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "text"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "vendors": {
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 80
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bedeutung eines Kontos pflegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "account": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "number": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "number",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/AccountSemantics"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "account",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Mit Idempotency-Key: idempotency_unsupported, keine Ausführung",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdempotencyBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validierung oder Fachregel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents": {
      "get": {
        "operationId": "get_api_v1_dms_documents",
        "summary": "Dokumente des DMS seitenweise lesen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Dokumente der Dokumentenablage, die zuletzt abgelegten zuerst; Filter wie die Suche.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Eingang ab (JJJJ-MM-TT)."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Eingang bis (JJJJ-MM-TT)."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pdf",
                "bild",
                "office",
                "text",
                "xml",
                "mail"
              ]
            },
            "description": "Nur diese Dateiart."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "document_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Nur diese Dokumentart (Kennung)."
          },
          {
            "name": "folder_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Nur dieser Ordner samt Unterordnern."
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Nur Dokumente mit diesem Schlagwort."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "suggested",
                "confirmed"
              ]
            },
            "description": "suggested: Zuordnung noch offen."
          },
          {
            "name": "payment_status",
            "in": "query",
            "description": "Nur Rechnungen mit diesem Zahlstatus (Mandanten mit DMS ohne Buchhaltung).",
            "schema": {
              "type": "string",
              "enum": [
                "offen",
                "teilweise",
                "bezahlt",
                "skonto"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dokumente des DMS seitenweise lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DmsDocument"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "page": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "per_page": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        }
                      },
                      "required": [
                        "total",
                        "page",
                        "per_page"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Filter ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_dms_documents",
        "summary": "Dokument im DMS ablegen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Legt eine Datei unverändert ab (PDF, Bilder, Office-Dateien, Text, XML; bis 32 MB). Das Dokument wird beim Ablegen gesiegelt und bleibt aufbewahrt; sein Text wird für die Suche gelesen. Vorher wird die Datei auf Viren geprüft (ClamAV): Schadsoftware gibt 422 mit code file_rejected, reason virus und finding; ist die Prüfung nicht möglich, 503 mit reason pruefung_gescheitert, nichts wird abgelegt. Ein Scan ohne Textebene wird danach im Hintergrund vom eigenen KI-Server gelesen (text_recognition). Derselbe Inhalt wird nie zweimal abgelegt: dann 409 mit code duplicate und duplicate_of. Recht: Dokumente ablegen (Inhaber oder Buchhaltung, Zugang mit write, nicht im Lesemodus). Ein Inhalt, dessen Dokument endgültig gelöscht ist, wird mit 409 code deleted_content (deleted_at) abgewiesen.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "document_type": {
                    "type": "string",
                    "description": "Kennung der Dokumentart; ohne Angabe ein Vorschlag."
                  },
                  "folder_id": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Ordner; ohne Angabe ein Vorschlag."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 60
                    },
                    "maxItems": 30
                  }
                },
                "required": [
                  "file"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Dokument abgelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsDocument"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Derselbe Inhalt liegt schon vor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "duplicate"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "duplicate_of": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "document_id": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "duplicate_of",
                    "document_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Datei fehlt, ist zu groß, hat einen nicht zugelassenen Typ oder enthält Schadsoftware (code file_rejected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich, etwa die Virenprüfung (code file_rejected, reason pruefung_gescheitert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents/{id}": {
      "get": {
        "operationId": "get_api_v1_dms_documents_id",
        "summary": "Ein Dokument des DMS lesen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Ein Dokument samt gewonnenem Text und Prüfung der Datei gegen ihren Fingerabdruck. Die Datei selbst liefert file_url.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ein Dokument des DMS lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsDocument"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Dokument nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch_api_v1_dms_documents_id",
        "summary": "Art, Ordner und Schlagworte eines Dokuments bestätigen oder ändern",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Ohne Felder wird der Vorschlag angenommen. Was fehlt, bleibt; tags ersetzt alle Schlagworte. Danach ist die Zuordnung bestätigt, und das DMS merkt sich das Ziel für den Absender. Jede Änderung steht im Protokoll.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "document_type": {
                    "type": "string",
                    "description": "Kennung der Dokumentart, etwa vertrag."
                  },
                  "folder_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 60
                    },
                    "maxItems": 30
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Art, Ordner und Schlagworte eines Dokuments bestätigen oder ändern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsDocument"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      },
      "delete": {
        "operationId": "delete_api_v1_dms_documents_id",
        "summary": "Dokument in den Papierkorb",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Legt ein nicht festgeschriebenes Dokument in den Papierkorb; nach 30 Tagen kann der Inhaber es in der Oberfläche endgültig löschen. Ein festgeschriebenes Dokument wird abgewiesen (409 retention_locked), der Versuch steht im Protokoll. Endgültig gelöscht wird nie über die API.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dokument in den Papierkorb",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsDocument"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Festgeschrieben, vor Fristende nicht löschbar",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "retention_locked"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/dms/search": {
      "get": {
        "operationId": "get_api_v1_dms_search",
        "summary": "Dokumente im DMS suchen (Volltext und Bedeutung)",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Sucht Wörter aus Inhalt und Titel, Rechnungsnummern und IBAN (mit oder ohne Leerzeichen) und zugleich nach Bedeutung: „Miete Halle“ findet auch den Mietvertrag über die Lagerhalle. Dokumente, die eine gesuchte Rechnungsnummer oder IBAN wörtlich tragen, stehen vorn. Treffer nach Rang mit Ausschnitt; match sagt, ob ein Treffer die Wörter trägt oder nur inhaltlich passt. meta.semantic: active (Volltext und Bedeutung), unavailable (Bedeutung gerade nicht erreichbar, nur Volltext), rebuilding (wird neu aufgebaut, nur Volltext), pending (noch nicht berechnet), literal (Wortfolge oder Ausschluss in q oder q nur aus Rechnungsnummern und IBAN, nur Volltext), off (nicht eingerichtet). Scans und Fotos ohne Textebene sind nur über den Titel zu finden.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 500
            },
            "description": "Suchwörter oder eine Umschreibung; \"…\" für eine Wortfolge, - vor einem Wort schließt es aus (beides sucht nur im Volltext)."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Eingang ab (JJJJ-MM-TT)."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Eingang bis (JJJJ-MM-TT)."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pdf",
                "bild",
                "office",
                "text",
                "xml",
                "mail"
              ]
            },
            "description": "Nur diese Dateiart."
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "document_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Nur diese Dokumentart (Kennung)."
          },
          {
            "name": "folder_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Nur dieser Ordner samt Unterordnern."
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Nur Dokumente mit diesem Schlagwort."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "suggested",
                "confirmed"
              ]
            },
            "description": "suggested: Zuordnung noch offen."
          },
          {
            "name": "payment_status",
            "in": "query",
            "description": "Nur Rechnungen mit diesem Zahlstatus (Mandanten mit DMS ohne Buchhaltung).",
            "schema": {
              "type": "string",
              "enum": [
                "offen",
                "teilweise",
                "bezahlt",
                "skonto"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dokumente im DMS suchen (Volltext und Bedeutung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DmsDocument"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "page": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "per_page": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        },
                        "semantic": {
                          "type": "string",
                          "enum": [
                            "active",
                            "unavailable",
                            "rebuilding",
                            "pending",
                            "literal",
                            "off"
                          ],
                          "description": "Stand der Suche nach Bedeutung für diese Anfrage."
                        },
                        "notice": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Hinweis für den Nutzer, wenn kein KI-Server eingetragen ist und deshalb nur im Volltext gesucht wird; sonst null."
                        }
                      },
                      "required": [
                        "total",
                        "page",
                        "per_page",
                        "semantic",
                        "notice"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Suchwort fehlt oder Filter ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/imports": {
      "get": {
        "operationId": "get_api_v1_dms_imports",
        "summary": "Altbestände auflisten",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Die letzten 50 als ZIP eingespielten Altbestände, neueste zuerst, mit Stand und Zählern (Fahrplan D3b).",
        "responses": {
          "200": {
            "description": "Altbestände",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DmsImport"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_dms_imports",
        "summary": "Altbestand als ZIP einspielen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Nimmt ein ZIP mit Ordnern und Dateien an und legt jede Datei im Hintergrund ab: Virenprüfung, Siegel, Texterkennung wie beim einzelnen Ablegen; die Ordner des ZIP werden Ordner im DMS, Dubletten werden erkannt und nicht doppelt abgelegt. Fortschritt und Meldungen je Datei über GET /api/v1/dms/imports/{id}. Ein ZIP über den Grenzen (Größe, Zahl der Dateien, entpackte Größe) wird als Ganzes mit 422 import_rejected abgewiesen.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "ZIP-Datei; über die Uploadgrenze des Servers hinaus (64 MB) mit dms:altbestand vom Betrieb."
                  }
                },
                "required": [
                  "file"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Eingeplant, läuft im Hintergrund",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsImport"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Kein lesbares ZIP, über den Grenzen oder ohne Dateien (code import_rejected)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/imports/{id}": {
      "get": {
        "operationId": "get_api_v1_dms_imports_id",
        "summary": "Altbestand mit Meldungen je Datei",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Fortschritt eines Altbestands und je Datei, die nicht abgelegt wurde, Pfad im ZIP, Ergebnis (dublette oder abgewiesen) und Meldung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Altbestand",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsImport"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Diesen Altbestand gibt es nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/structure": {
      "get": {
        "operationId": "get_api_v1_dms_structure",
        "summary": "Ordnung des DMS lesen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Dokumentarten mit Aufbewahrungsfrist und gesetzlicher Mindestfrist, Ordner, Schlagworte, Regeln für Vorschläge und ob die Einrichtung erledigt ist.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Ordnung des DMS lesen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsStructure"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/folders": {
      "post": {
        "operationId": "post_api_v1_dms_folders",
        "summary": "Ordner anlegen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Legt einen Ordner oben oder unter einem anderen an; by_year legt Dokumente in einen Unterordner je Eingangsjahr. Ordner werden nicht gelöscht.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "parent_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "by_year": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ordner anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsFolder"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/v1/dms/document-types/{key}": {
      "patch": {
        "operationId": "patch_api_v1_dms_document_types_key",
        "summary": "Aufbewahrungsfrist einer Dokumentart ändern",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Verlängert oder ändert die Frist einer Dokumentart mit Grund; nie unter die gesetzliche Mindestfrist der Art (422).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "retention_years": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "retention_years",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Aufbewahrungsfrist einer Dokumentart ändern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsDocumentType"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Kennung der Dokumentart, etwa vertrag."
          }
        ]
      }
    },
    "/api/v1/dms/rules": {
      "post": {
        "operationId": "post_api_v1_dms_rules",
        "summary": "Regel für Vorschläge anlegen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Enthält Absender, Titel oder Text das Wort contains, schlägt die Regel Art, Ordner und Schlagworte vor; automatic übernimmt sie ohne Bestätigung. Regeln gehen dem Gedächtnis vor.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "field": {
                    "type": "string",
                    "enum": [
                      "sender",
                      "title",
                      "text"
                    ]
                  },
                  "contains": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "document_type": {
                    "type": "string"
                  },
                  "folder_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 60
                    },
                    "maxItems": 30
                  },
                  "automatic": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "field",
                  "contains"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Regel für Vorschläge anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsRule"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/v1/dms/rules/{id}/deactivate": {
      "post": {
        "operationId": "post_api_v1_dms_rules_id_deactivate",
        "summary": "Regel deaktivieren",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eine Regel wird nie gelöscht, nur deaktiviert.",
        "responses": {
          "200": {
            "description": "Regel deaktivieren",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsRule"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/dms/setup": {
      "post": {
        "operationId": "post_api_v1_dms_setup",
        "summary": "Einrichtung des DMS beantworten",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Einmal je Firma: Ist sie eine Bank oder Versicherung, gelten für alle Dokumentarten mit gesetzlicher Frist zehn Jahre. Ein zweiter Aufruf gibt 422.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bank_or_insurance": {
                    "type": "boolean"
                  },
                  "retention_enabled": {
                    "type": "boolean",
                    "description": "GoBD-Teil einschalten, Vorgabe true."
                  }
                },
                "required": [
                  "bank_or_insurance"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Einrichtung des DMS beantworten",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsStructure"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/v1/dms/inbox": {
      "get": {
        "operationId": "get_api_v1_dms_inbox",
        "summary": "Mail-Eingang des DMS lesen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Empfangsadresse (nur mit Recht Dokumente ablegen), Regeln, abgerufene Postfächer ohne Zugangsgeheimnis und die letzten 25 Mails mit Absender, Betreff, Eingangszeit, Status und Ergebnis je Anhang. before_id blättert zu älteren Mails.",
        "parameters": [
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Nur Mails mit kleinerer id (next_before_id)."
          }
        ],
        "responses": {
          "200": {
            "description": "Mail-Eingang",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsInbox"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Filter ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/inbox/address": {
      "post": {
        "operationId": "post_api_v1_dms_inbox_address",
        "summary": "Empfangsadresse einrichten, erneuern oder abschalten",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "setup richtet die Empfangsadresse ein oder erneuert sie (die alte gilt sofort nicht mehr), disable schaltet sie ab. Recht: Verwalten (Inhaber, Zugang mit admin) und Dokumente ablegen.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "setup",
                      "disable"
                    ]
                  }
                },
                "required": [
                  "action"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stand der Empfangsadresse",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "available": {
                          "type": "boolean"
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "email"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "since": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "available",
                        "active",
                        "email",
                        "since"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Filter ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/inbox/rules": {
      "post": {
        "operationId": "post_api_v1_dms_inbox_rules",
        "summary": "Regel des Mail-Eingangs anlegen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Mails eines Absenders annehmen: sender ist eine Adresse, eine Domain mit @ davor oder * für alle; wahlweise Betreff und Anhangname (Muster wie *.pdf) und ob die Mail selbst als .eml abgelegt wird. Ohne passende Regel gilt eine Mail als fremder Absender und wird nicht abgelegt. Recht: Verwalten.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "sender": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "subject_contains": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "attachment_pattern": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "store_eml": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "sender"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Regel angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "sender": {
                          "type": "string"
                        },
                        "active": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "sender",
                        "active"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Filter ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/inbox/rules/{id}/deactivate": {
      "post": {
        "operationId": "post_api_v1_dms_inbox_rules_id_deactivate",
        "summary": "Regel des Mail-Eingangs ausschalten",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Die Regel gilt danach nicht mehr; gelöscht wird sie nie. Recht: Verwalten.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Regel aus",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "active": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "active"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Dokument nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/inbox/mailboxes/{id}/fetch": {
      "post": {
        "operationId": "post_api_v1_dms_inbox_mailboxes_id_fetch",
        "summary": "IMAP-Postfach jetzt abrufen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Ruft das Postfach ab (sonst alle fünf Minuten): neue Mails ab der letzten UID, Anhänge werden nach den Regeln abgelegt, am Postfach wird nichts verändert. Scheitert der Abruf (etwa Anmeldung abgelehnt), 422 mit code mailbox_<kennung>; der Fehler steht danach auch am Postfach. Recht: Dokumente ablegen.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Abgerufen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsMailbox"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Dokument nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Abruf gescheitert",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "mailbox_verbindung",
                        "mailbox_tls",
                        "mailbox_anmeldung",
                        "mailbox_ordner",
                        "mailbox_protokoll",
                        "mailbox_unverschluesselt",
                        "mailbox_nicht_berechtigt"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DmsMailbox"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "data"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/inbox/mailboxes/{id}/deactivate": {
      "post": {
        "operationId": "post_api_v1_dms_inbox_mailboxes_id_deactivate",
        "summary": "IMAP-Postfach nicht mehr abrufen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Schaltet den Abruf ab; Postfach, Mails und Dokumente bleiben. Anlegen und Zugangsdaten ändern geht nur in der Oberfläche. Recht: Verwalten.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Postfach aus",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsMailbox"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Dokument nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/weclapp": {
      "get": {
        "operationId": "get_api_v1_dms_weclapp",
        "summary": "weclapp-Anbindung des DMS lesen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Verbindung zu weclapp (Konto, Benutzer, Abholen ab, letzter Abruf, Fehler, Benachrichtigungsadresse nur mit Recht Dokumente ablegen; nie das Token) und die zuletzt abgeholten Ausgangsrechnungen mit Ergebnis je Datei (Beleg, E-Rechnung, Stornobeleg).",
        "responses": {
          "200": {
            "description": "weclapp-Anbindung",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsWeclapp"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/weclapp/fetch": {
      "post": {
        "operationId": "post_api_v1_dms_weclapp_fetch",
        "summary": "weclapp jetzt abrufen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Fragt weclapp jetzt ab (sonst alle 15 Minuten und bei jeder Benachrichtigung): neue und geänderte Ausgangsrechnungen ab DOCUMENT_CREATED werden mit Beleg, E-Rechnung und Stornobeleg abgelegt, nichts doppelt. Scheitert der Abruf (Token abgelehnt, keine Rechte, Abrufgrenze), 422 mit code weclapp_<kennung>; der Fehler steht danach auch an der Verbindung.",
        "responses": {
          "200": {
            "description": "Abgerufen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsWeclappConnection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "weclapp ist nicht verbunden (code weclapp_not_connected) oder der Abruf ist gescheitert (code weclapp_<kennung>)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "weclapp_not_connected",
                        "weclapp_anmeldung",
                        "weclapp_rechte",
                        "weclapp_grenze",
                        "weclapp_verbindung",
                        "weclapp_antwort",
                        "weclapp_nicht_berechtigt",
                        "weclapp_pruefung",
                        "weclapp_nicht_gefunden",
                        "weclapp_leer",
                        "weclapp_zu_gross",
                        "weclapp_ablage"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DmsWeclappConnection"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/weclapp/deactivate": {
      "post": {
        "operationId": "post_api_v1_dms_weclapp_deactivate",
        "summary": "weclapp-Anbindung abschalten",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Schaltet die Anbindung ab: nichts wird mehr abgeholt, die Benachrichtigungsadresse antwortet 404. Abgelegte Dokumente bleiben. Verbinden und Token ersetzen geht nur in der Oberfläche.",
        "responses": {
          "200": {
            "description": "Abgeschaltet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsWeclappConnection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "weclapp ist nicht verbunden (code weclapp_not_connected) oder der Abruf ist gescheitert (code weclapp_<kennung>)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "weclapp_not_connected",
                        "weclapp_anmeldung",
                        "weclapp_rechte",
                        "weclapp_grenze",
                        "weclapp_verbindung",
                        "weclapp_antwort",
                        "weclapp_nicht_berechtigt",
                        "weclapp_pruefung",
                        "weclapp_nicht_gefunden",
                        "weclapp_leer",
                        "weclapp_zu_gross",
                        "weclapp_ablage"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DmsWeclappConnection"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/weclapp/webhook/{geheimnis}": {
      "get": {
        "operationId": "get_api_v1_dms_weclapp_webhook_geheimnis",
        "summary": "Benachrichtigung von weclapp",
        "tags": [
          "dms"
        ],
        "security": [],
        "description": "Benachrichtigung von weclapp (Webhook für salesInvoice bei Anlage und Änderung). Geschützt durch das Geheimnis in der Adresse, weil weclapp nicht signiert. Die Nutzlast nennt nur entityId, entityName und type und wird nie geglaubt: die Rechnung wird über die weclapp-API nachgeladen, nach der Antwort. Ohne entityId wird die Abfrage angestoßen.",
        "parameters": [
          {
            "name": "geheimnis",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Zufallsteil der Adresse aus der Oberfläche."
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityName",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Angenommen (status accepted) oder übergangen (status ignored: andere Entität oder DELETE)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "accepted",
                        "ignored"
                      ]
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Leistung dms nicht gebucht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder abgeschaltete Adresse",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "60 je Minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_dms_weclapp_webhook_geheimnis",
        "summary": "Benachrichtigung von weclapp",
        "tags": [
          "dms"
        ],
        "security": [],
        "description": "Benachrichtigung von weclapp (Webhook für salesInvoice bei Anlage und Änderung). Geschützt durch das Geheimnis in der Adresse, weil weclapp nicht signiert. Die Nutzlast nennt nur entityId, entityName und type und wird nie geglaubt: die Rechnung wird über die weclapp-API nachgeladen, nach der Antwort. Ohne entityId wird die Abfrage angestoßen.",
        "parameters": [
          {
            "name": "geheimnis",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Zufallsteil der Adresse aus der Oberfläche."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string"
                  },
                  "entityName": {
                    "type": "string",
                    "examples": [
                      "salesInvoice"
                    ]
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "CREATE",
                      "UPDATE",
                      "DELETE"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Angenommen (status accepted) oder übergangen (status ignored: andere Entität oder DELETE)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "accepted",
                        "ignored"
                      ]
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Leistung dms nicht gebucht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unbekannte oder abgeschaltete Adresse",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "60 je Minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents/{id}/lock": {
      "post": {
        "operationId": "post_api_v1_dms_documents_id_lock",
        "summary": "Dokument festschreiben",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Schreibt ein Dokument nach der Frist seiner Art fest, wenn der GoBD-Teil an ist. Danach sind Inhalt, Art und Frist gesperrt; vor Fristende lässt es sich nicht löschen. Bei Verträgen ist event_date das Vertragsende.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "event_date": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dokument festschreiben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsDocument"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/dms/documents/{id}/restore": {
      "post": {
        "operationId": "post_api_v1_dms_documents_id_restore",
        "summary": "Dokument aus dem Papierkorb zurückholen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Holt ein Dokument aus dem Papierkorb zurück, solange es nicht endgültig gelöscht ist.",
        "responses": {
          "200": {
            "description": "Dokument aus dem Papierkorb zurückholen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsDocument"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/dms/documents/{id}/history": {
      "get": {
        "operationId": "get_api_v1_dms_documents_id_history",
        "summary": "Verlauf eines Dokuments",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Der Verlauf aus dem unveränderlichen Protokoll: Ablage, Siegel, Zuordnung, Festschreibung, Papierkorb, Löschung und abgewiesene Löschversuche, älteste zuerst. Bleibt nach der Löschung vollständig erhalten.",
        "responses": {
          "200": {
            "description": "Verlauf eines Dokuments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "at": {
                            "type": "string"
                          },
                          "by": {
                            "type": "string"
                          },
                          "event": {
                            "type": "string"
                          },
                          "detail": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "at",
                          "by",
                          "event",
                          "detail"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/dms/deletion-proposals": {
      "get": {
        "operationId": "get_api_v1_dms_deletion_proposals",
        "summary": "Löschvorschläge",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Dokumente, deren Frist abgelaufen ist, und Dokumente, die seit 30 Tagen im Papierkorb liegen. Gelöscht wird nur in der Oberfläche nach Bestätigung des Inhabers.",
        "responses": {
          "200": {
            "description": "Löschvorschläge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DmsDocument"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/v1/dms/bank/transactions": {
      "get": {
        "operationId": "get_api_v1_dms_bank_transactions",
        "summary": "Bankumsätze mit Stand des Abgleichs",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Bankumsätze des Mandanten, neueste zuerst, mit Stand: open (nicht zugeordnet), assigned (einer Rechnung zugeordnet, mit allocation_id und document_id) oder used. Filter status = open (Vorgabe), assigned, all. Nur für Mandanten mit DMS ohne Buchhaltung.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "assigned",
                "all"
              ]
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Umsätze",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/DmsUmsatz"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "enum": [
                                  "open",
                                  "assigned",
                                  "used"
                                ]
                              },
                              "allocation_id": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "document_id": {
                                "anyOf": [
                                  {
                                    "type": "integer"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          }
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "per_page": {
                          "type": "integer"
                        }
                      }
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gleicht die Buchhaltung ab (code abgleich_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "abgleich_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/bank/transactions/{id}/suggestions": {
      "get": {
        "operationId": "get_api_v1_dms_bank_transactions_id_suggestions",
        "summary": "Vorschläge aus den Rechnungsdokumenten zu einem Umsatz",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Bewertete Kandidaten aus den offenen Eingangs- und Ausgangsrechnungen mit Gründen: kind full (Betrag stimmt), partial (Teilzahlung) oder discount (Betrag stimmt mit Skonto innerhalb der Frist). Entschieden wird nichts; zugeordnet wird erst mit POST /api/v1/dms/payments.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vorschläge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "document_id": {
                            "type": "integer"
                          },
                          "title": {
                            "type": "string"
                          },
                          "invoice_number": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "partner": {
                            "type": "string"
                          },
                          "open_cents": {
                            "type": "integer",
                            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                          },
                          "amount_cents": {
                            "type": "integer",
                            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                          },
                          "discount_cents": {
                            "type": "integer",
                            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "full",
                              "partial",
                              "discount"
                            ]
                          },
                          "score": {
                            "type": "integer"
                          },
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "document_id",
                          "kind",
                          "score",
                          "reasons"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Umsatz unbekannt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gleicht die Buchhaltung ab (code abgleich_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "abgleich_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents/{id}/invoice": {
      "put": {
        "operationId": "put_api_v1_dms_documents_id_invoice",
        "summary": "Rechnungsangaben erfassen oder berichtigen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Betrag, Partner, Rechnungsnummer, IBAN, Datum, Fälligkeit und Skonto einer Eingangs- oder Ausgangsrechnung. Eine Berichtigung ist eine neue Fassung; die frühere bleibt im Protokoll. Danach hat die Rechnung einen Zahlstatus.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount_cents": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "partner": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "invoice_number": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "iban": {
                    "type": "string"
                  },
                  "invoice_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "due_on": {
                    "type": "string",
                    "format": "date"
                  },
                  "discount_percent": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "exclusiveMaximum": 100
                  },
                  "discount_until": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "amount_cents",
                  "partner"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Zahlstatus der Rechnung",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsZahlung"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gleicht die Buchhaltung ab (code abgleich_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "abgleich_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "weclapp ist nicht verbunden (code weclapp_not_connected) oder der Abruf ist gescheitert (code weclapp_<kennung>)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "weclapp_not_connected",
                        "weclapp_anmeldung",
                        "weclapp_rechte",
                        "weclapp_grenze",
                        "weclapp_verbindung",
                        "weclapp_antwort",
                        "weclapp_nicht_berechtigt",
                        "weclapp_pruefung",
                        "weclapp_nicht_gefunden",
                        "weclapp_leer",
                        "weclapp_zu_gross",
                        "weclapp_ablage"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DmsWeclappConnection"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/payments": {
      "post": {
        "operationId": "post_api_v1_dms_payments",
        "summary": "Umsatz einer Rechnung zuordnen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Ordnet einen Bankumsatz einer Rechnung zu, ganz oder als Teilzahlung; discount schließt den Rest als Skonto ab (nur mit Skonto der Rechnung). Nur auf ausdrückliche Bestätigung. Es entsteht keine Buchung; der Zahlstatus ergibt sich aus den Zuordnungen.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transaction_id": {
                    "type": "integer"
                  },
                  "document_id": {
                    "type": "integer"
                  },
                  "discount": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "transaction_id",
                  "document_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Zugeordnet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/DmsZuordnung"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "payment": {
                              "anyOf": [
                                {
                                  "$ref": "#/components/schemas/DmsZahlung"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gleicht die Buchhaltung ab (code abgleich_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "abgleich_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "weclapp ist nicht verbunden (code weclapp_not_connected) oder der Abruf ist gescheitert (code weclapp_<kennung>)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "weclapp_not_connected",
                        "weclapp_anmeldung",
                        "weclapp_rechte",
                        "weclapp_grenze",
                        "weclapp_verbindung",
                        "weclapp_antwort",
                        "weclapp_nicht_berechtigt",
                        "weclapp_pruefung",
                        "weclapp_nicht_gefunden",
                        "weclapp_leer",
                        "weclapp_zu_gross",
                        "weclapp_ablage"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DmsWeclappConnection"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/payments/{id}/cancel": {
      "post": {
        "operationId": "post_api_v1_dms_payments_id_cancel",
        "summary": "Zuordnung aufheben",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Hebt eine Zuordnung mit Grund auf. Gelöscht wird nichts: die Aufhebung ist ein neues Ereignis, der Umsatz ist danach wieder offen.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Aufgehoben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/DmsZuordnung"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "payment": {
                              "anyOf": [
                                {
                                  "$ref": "#/components/schemas/DmsZahlung"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gleicht die Buchhaltung ab (code abgleich_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "abgleich_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "weclapp ist nicht verbunden (code weclapp_not_connected) oder der Abruf ist gescheitert (code weclapp_<kennung>)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "weclapp_not_connected",
                        "weclapp_anmeldung",
                        "weclapp_rechte",
                        "weclapp_grenze",
                        "weclapp_verbindung",
                        "weclapp_antwort",
                        "weclapp_nicht_berechtigt",
                        "weclapp_pruefung",
                        "weclapp_nicht_gefunden",
                        "weclapp_leer",
                        "weclapp_zu_gross",
                        "weclapp_ablage"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DmsWeclappConnection"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/pre-postings": {
      "get": {
        "operationId": "get_api_v1_dms_pre_postings",
        "summary": "Vorbuchungen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Vorbuchungen des DMS (Fahrplan D6a), die jüngsten zuerst; status=draft, confirmed oder handed_over filtert. Nur für Mandanten ohne Buchhaltung.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "confirmed",
                "handed_over"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vorbuchungen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DmsPrePosting"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Leistung reicht nicht; ein Mandant mit Buchhaltung bekommt vorbuchen_nicht_verfuegbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Zu viele Anfragen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents/{id}/pre-posting": {
      "get": {
        "operationId": "get_api_v1_dms_documents_id_pre_posting",
        "summary": "Vorbuchung eines Dokuments",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Die Vorbuchung einer Eingangs- oder Ausgangsrechnung mit Kontierungsvorschlag (Herkunft und Begründung) und offenen Fragen. Gibt es noch keine, legt der erste Aufruf mit Schreibrecht einen Entwurf an.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vorbuchung eines Dokuments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsPrePosting"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Leistung reicht nicht; ein Mandant mit Buchhaltung bekommt vorbuchen_nicht_verfuegbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Zu viele Anfragen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "put_api_v1_dms_documents_id_pre_posting",
        "summary": "Vorbuchung ändern",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Ändert einen Entwurf: Geschäftspartner, Rechnungsdatum, Rechnungsnummer, Buchungstext, Leistungsdatum und Zeilen (ersetzt alle). remember_rule=true legt eine Kontierungsregel für den Geschäftspartner an. Bestätigte Vorbuchungen zuerst in der Oberfläche wieder öffnen; übergebene sind festgeschrieben.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "partner_id": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "document_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "invoice_number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 36
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "text": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 60
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "service_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "properties": {
                        "account_id": {
                          "type": "integer"
                        },
                        "tax_key_id": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "required": [
                        "account_id",
                        "amount_cents"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "remember_rule": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vorbuchung ändern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsPrePosting"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Leistung reicht nicht; ein Mandant mit Buchhaltung bekommt vorbuchen_nicht_verfuegbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Zu viele Anfragen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents/{id}/pre-posting/confirm": {
      "post": {
        "operationId": "post_api_v1_dms_documents_id_pre_posting_confirm",
        "summary": "Vorbuchung bestätigen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Bestätigt einen Entwurf, wenn keine Frage offen ist. Bestätigte Vorbuchungen gehen mit der nächsten Übergabe an DATEV; übergeben wird nur in der Oberfläche nach frischer Bestätigung.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vorbuchung bestätigen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsPrePosting"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Leistung reicht nicht; ein Mandant mit Buchhaltung bekommt vorbuchen_nicht_verfuegbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Zu viele Anfragen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/datev/preview": {
      "get": {
        "operationId": "get_api_v1_dms_datev_preview",
        "summary": "Vorschau der DATEV-Übergabe",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Was eine Übergabe an DATEV enthielte: Anzahl, Summe, Warnungen und Hindernisse für Beraternummer, Mandantennummer, Sachkontenlänge, Wirtschaftsjahr und Stichtag. Die Übergabe selbst schreibt fest und geht nur in der Oberfläche.",
        "parameters": [
          {
            "name": "advisor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "client",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "account_length",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 4,
              "maximum": 8
            }
          },
          {
            "name": "fiscal_year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vorschau der DATEV-Übergabe",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer"
                        },
                        "total_cents": {
                          "type": "integer"
                        },
                        "warnings": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "obstacles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "fingerprint": {
                          "type": "string"
                        },
                        "pre_postings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "document_id": {
                                "type": "integer"
                              },
                              "invoice_number": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "document_date": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "total_cents": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "id",
                              "document_id",
                              "invoice_number",
                              "document_date",
                              "total_cents"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "count",
                        "total_cents",
                        "warnings",
                        "obstacles",
                        "fingerprint",
                        "pre_postings",
                        "note"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Leistung reicht nicht; ein Mandant mit Buchhaltung bekommt vorbuchen_nicht_verfuegbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Zu viele Anfragen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/datev/handovers": {
      "get": {
        "operationId": "get_api_v1_dms_datev_handovers",
        "summary": "DATEV-Übergaben",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Die bisherigen Übergaben an DATEV mit Nummer, Anzahl, Summe, Frist und Prüfsumme des Manifests.",
        "responses": {
          "200": {
            "description": "DATEV-Übergaben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DmsDatevHandover"
                      }
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Leistung reicht nicht; ein Mandant mit Buchhaltung bekommt vorbuchen_nicht_verfuegbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Zu viele Anfragen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/datev/handovers/{id}/package": {
      "get": {
        "operationId": "get_api_v1_dms_datev_handovers_id_package",
        "summary": "Paket einer DATEV-Übergabe",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Lädt das Paket (ZIP mit Buchungsstapel im DATEV-Format, Festschreibung 0, Personenkonten, Belegen und Manifest) byte-gleich herunter, solange es zu seiner Prüfsumme passt.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paket einer DATEV-Übergabe",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang oder Leistung reicht nicht; ein Mandant mit Buchhaltung bekommt vorbuchen_nicht_verfuegbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Paket nicht unverändert vorhanden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Zu viele Anfragen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents/{id}/file": {
      "get": {
        "operationId": "get_api_v1_dms_documents_id_file",
        "summary": "Datei eines Dokuments",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Liefert die Datei, wenn der Benutzer des Zugangs das Dokument sieht (Rechte je Ordner, D5); passt sie nicht mehr zu ihrem Fingerabdruck, 404. Lesen gesperrter oder eingeschränkter Dokumente steht im Protokoll.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Die Datei des Dokuments, unverändert",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/access": {
      "get": {
        "operationId": "get_api_v1_dms_access",
        "summary": "Ordner, Sperren und Leserechte",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Alle Ordner mit Pfad, ob gesperrt (selbst oder über einen Ordner darüber) und den gültigen Leserechten. Nur der Inhaber.",
        "responses": {
          "200": {
            "description": "Ordner, Sperren und Leserechte",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/folders/{id}/lock": {
      "post": {
        "operationId": "post_api_v1_dms_folders_id_lock",
        "summary": "Ordner sperren oder freigeben",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Einen gesperrten Ordner samt Unterordnern sehen nur der Inhaber und wer ein Leserecht daran hat. Steht im Protokoll.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locked": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "locked"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ordner sperren oder freigeben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/folders/{id}/rights": {
      "post": {
        "operationId": "post_api_v1_dms_folders_id_rights",
        "summary": "Leserecht am Ordner erteilen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Erteilt einer Person ein Leserecht am Ordner (vererbt auf Unterordner). Nie gelöscht, nur entzogen; steht im Protokoll.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "user_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Leserecht am Ordner erteilen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/folder-rights/{id}/revoke": {
      "post": {
        "operationId": "post_api_v1_dms_folder_rights_id_revoke",
        "summary": "Leserecht entziehen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Entzieht ein Leserecht; das Recht bleibt mit Zeitpunkt des Entzugs im Protokoll.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Entzogen"
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents/{id}/restriction": {
      "post": {
        "operationId": "post_api_v1_dms_documents_id_restriction",
        "summary": "Nach Art. 18 DSGVO einschränken",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Das Dokument sehen danach nur Inhaber und Prüfer; Suchtext, Abschnitte und Vektoren werden gelöscht, Original, Siegel und Frist bleiben.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Nach Art. 18 DSGVO einschränken",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents/{id}/restriction/lift": {
      "post": {
        "operationId": "post_api_v1_dms_documents_id_restriction_lift",
        "summary": "Einschränkung aufheben",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Hebt die Einschränkung auf und gewinnt den Suchtext aus dem Original neu.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Einschränkung aufheben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/exports": {
      "get": {
        "operationId": "get_api_v1_dms_exports",
        "summary": "Eigene Exporte",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Die letzten 50 Exporte des Benutzers mit Stand, Anzahl, Fingerabdruck und Ablauf.",
        "responses": {
          "200": {
            "description": "Eigene Exporte",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_dms_exports",
        "summary": "Export anfordern",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Packt im Hintergrund alle Dokumente, die der Zugang sehen darf, als ZIP mit Ordnerstruktur, Index (CSV, XML mit DTD), Prüfsummen, Protokoll und Prüfskript. scope: all, folder (mit folder_id) oder audit (from, to). Auch mit einem Schlüssel „nur lesen“.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "enum": [
                      "all",
                      "folder",
                      "audit"
                    ]
                  },
                  "folder_id": {
                    "type": "integer"
                  },
                  "from": {
                    "type": "string",
                    "format": "date"
                  },
                  "to": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "scope"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Export anfordern",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/exports/{id}": {
      "get": {
        "operationId": "get_api_v1_dms_exports_id",
        "summary": "Stand eines Exports",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Stand (queued, running, ready, failed, deleted), Anzahl, Größe, Fingerabdruck und file_url, solange die Datei da ist.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stand eines Exports",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/exports/{id}/file": {
      "get": {
        "operationId": "get_api_v1_dms_exports_id_file",
        "summary": "Export herunterladen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Das ZIP des Exports, 30 Tage lang, nur für den, der ihn angefordert hat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ZIP-Datei",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/ask": {
      "post": {
        "operationId": "post_api_v1_dms_ask",
        "summary": "Frage an die Dokumente",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Beantwortet eine Frage in Alltagssprache nur aus Dokumenten, die der Zugang sehen darf (höchstens fünf), mit nummerierten Quellen; gerechnet wird nur auf dem eigenen KI-Server. status: answered, not_found (answer ist dann der feste Satz), read_only (die Frage verlangt eine Änderung; answer nennt den Weg), no_server (kein KI-Server erreichbar; notice und die gefundenen documents), busy. previous: vorige Fragen derselben Sitzung für den Abruf, document_ids grenzt auf diese Dokumente ein. Ändert nichts, auch mit einem Schlüssel „nur lesen“.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "previous": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "maxItems": 20
                  },
                  "document_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "maxItems": 100
                  }
                },
                "required": [
                  "question"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Antwort mit Quellen oder Hinweis",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "answered",
                            "not_found",
                            "read_only",
                            "no_server",
                            "busy"
                          ]
                        },
                        "answer": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "number": {
                                "type": "integer"
                              },
                              "id": {
                                "type": "integer"
                              },
                              "title": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              },
                              "excerpt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "number",
                              "id",
                              "title",
                              "url",
                              "excerpt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "title": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              },
                              "excerpt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "title",
                              "url",
                              "excerpt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "notice": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "model": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "status",
                        "answer",
                        "sources",
                        "documents",
                        "notice",
                        "model"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/approvals": {
      "get": {
        "operationId": "get_api_v1_dms_approvals",
        "summary": "Laufende Rechnungsfreigaben",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eingangsrechnungen, deren Freigabe offen oder in Klärung ist, die der Benutzer sehen darf. Mit mine=1 nur die, bei denen er jetzt entscheiden oder eine Rückfrage beantworten soll.",
        "parameters": [
          {
            "name": "mine",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DmsFreigabe"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gibt die Buchhaltung frei, nicht das DMS (code freigabe_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "freigabe_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Abgewiesen, mit Grund (etwa vier Augen, Grenze, nicht zuständig, Klärung offen)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/documents/{id}/approval": {
      "get": {
        "operationId": "get_api_v1_dms_documents_id_approval",
        "summary": "Stand der Rechnungsfreigabe",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Stand, Stufe, Zuständige, Verlauf und was der Benutzer jetzt tun kann. status none, wenn das Dokument keine Freigabe braucht.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsFreigabe"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Dokument gibt es nicht oder es ist nicht sichtbar"
          },
          "409": {
            "description": "Bei diesem Mandanten gibt die Buchhaltung frei, nicht das DMS (code freigabe_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "freigabe_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_dms_documents_id_approval",
        "summary": "In der Rechnungsfreigabe entscheiden",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Freigeben (approve), ablehnen mit Grund (reject, text), Klärung anfordern (clarify, user_id und text) oder die Klärung beantworten bzw. beenden (answer, text). Jede Entscheidung ist ein neues Ereignis im Protokoll; vier Augen ab der zweiten Stufe.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "reject",
                      "clarify",
                      "answer"
                    ]
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "user_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "action"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsFreigabe"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Dokument gibt es nicht oder es ist nicht sichtbar"
          },
          "409": {
            "description": "Bei diesem Mandanten gibt die Buchhaltung frei, nicht das DMS (code freigabe_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "freigabe_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Abgewiesen, mit Grund (etwa vier Augen, Grenze, nicht zuständig, Klärung offen)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/approval-settings": {
      "get": {
        "operationId": "get_api_v1_dms_approval_settings",
        "summary": "Regeln und Freigeber der Rechnungsfreigabe",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Ob die Freigabe an ist, die aktiven Regeln (ab Betrag, Stufen, benannte Freigeber), die Freigeber (Grenzen anderer nur für den Inhaber) und die Erinnerungsfristen in Werktagen. Vergeben wird nur in der Oberfläche.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "rules": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "from_cents": {
                                "type": "integer"
                              },
                              "stages": {
                                "type": "integer"
                              },
                              "stage1_user_id": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "stage2_user_id": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            }
                          }
                        },
                        "approvers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "user_id": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "limit_cents": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            }
                          }
                        },
                        "reminders": {
                          "type": "object",
                          "properties": {
                            "after_working_days": {
                              "type": "integer"
                            },
                            "owner_after_working_days": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gibt die Buchhaltung frei, nicht das DMS (code freigabe_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "freigabe_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/absences": {
      "get": {
        "operationId": "get_api_v1_dms_absences",
        "summary": "Abwesenheiten der Freigeber",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Laufende und kommende Abwesenheiten mit Vertreter: für den Inhaber alle, sonst die eigenen und die, in denen man vertritt.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "user_id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "from": {
                            "type": "string",
                            "format": "date"
                          },
                          "until": {
                            "type": "string",
                            "format": "date"
                          },
                          "deputy_id": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "deputy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gibt die Buchhaltung frei, nicht das DMS (code freigabe_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "freigabe_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_v1_dms_absences",
        "summary": "Abwesenheit eintragen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Eigene Abwesenheit (der Inhaber auch für andere, user_id) mit Vertreter. In der Zeit entscheidet der Vertreter die zugeordneten Stufen „in Vertretung für“.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "format": "date"
                  },
                  "until": {
                    "type": "string",
                    "format": "date"
                  },
                  "deputy_id": {
                    "type": "integer"
                  },
                  "user_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "from",
                  "until"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Eingetragen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gibt die Buchhaltung frei, nicht das DMS (code freigabe_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "freigabe_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Abgewiesen, mit Grund (etwa vier Augen, Grenze, nicht zuständig, Klärung offen)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/absences/{id}/end": {
      "post": {
        "operationId": "post_api_v1_dms_absences_id_end",
        "summary": "Abwesenheit aufheben",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Hebt eine Abwesenheit auf; gelöscht wird nichts.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "ended": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Bei diesem Mandanten gibt die Buchhaltung frei, nicht das DMS (code freigabe_buchhaltung)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "freigabe_buchhaltung"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Abgewiesen, mit Grund (etwa vier Augen, Grenze, nicht zuständig, Klärung offen)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dms/folders/{id}": {
      "patch": {
        "operationId": "patch_api_v1_dms_folders_id",
        "summary": "Ordner umbenennen oder verschieben",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Benennt einen Ordner um (name) und/oder verschiebt ihn (parent_id; null = oberste Ebene). Nur der Inhaber. Jahresordner bleiben, kein Ordner kommt unter sich selbst, ein Verschieben, das jemandem mehr zeigen würde, wird mit 422 abgewiesen. Beides steht im Protokoll.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "parent_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ordner umbenennen oder verschieben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "parent_id": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "path": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "parent_id",
                        "path"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Kennung des Ordners."
          }
        ]
      }
    },
    "/api/v1/dms/document-types": {
      "post": {
        "operationId": "post_api_v1_dms_document_types",
        "summary": "Eigene Dokumentart anlegen",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Legt eine eigene Dokumentart an. based_on ist die Kennung einer vorgegebenen Art (nicht datev_uebergabe); von ihr erbt die eigene Art Mindestfrist, Ereignis, buchungsrelevant und Festschreiben. retention_years nie unter der Mindestfrist des Vorbilds, danach nur verlängerbar. Nur der Inhaber; nie gelöscht.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "based_on": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "folder_id": {
                    "type": "integer"
                  },
                  "retention_years": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "name",
                  "based_on",
                  "folder_id",
                  "retention_years",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Eigene Dokumentart anlegen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DmsDocumentType"
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/v1/dms/deletions/proposal": {
      "post": {
        "operationId": "post_api_v1_dms_deletions_proposal",
        "summary": "Löschvorschlag mit Bestätigung",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Schritt 1 des endgültigen Löschens: nennt von ids die löschbaren (Frist abgelaufen oder 30 Tage im Papierkorb) und die übrigen mit Grund, dazu eine Bestätigungskennung (15 Minuten, nur für diesen Benutzer, einmal verwendbar). Löscht nichts. Nur der Inhaber mit Zugang „Verwalten“.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "minItems": 1,
                    "maxItems": 500
                  }
                },
                "required": [
                  "ids"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Löschvorschlag mit Bestätigung",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletable": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DmsDocument"
                          }
                        },
                        "rejected": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "confirmation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valid_until": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "notice": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "deletable",
                        "rejected",
                        "confirmation",
                        "valid_until",
                        "notice"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/v1/dms/deletions": {
      "post": {
        "operationId": "post_api_v1_dms_deletions",
        "summary": "Endgültig löschen mit Bestätigung",
        "tags": [
          "dms"
        ],
        "security": [
          {
            "sanctum": []
          }
        ],
        "description": "Schritt 2: löscht genau die Dokumente der Bestätigungskennung aus Schritt 1, mit Grund; Datei und Suchtext gehen, Zeile, Siegel, Löschnachweis und Protokoll bleiben. Eine Kennung gilt nur einmal, nur für denselben Benutzer und 15 Minuten (sonst 422). Nur der Inhaber mit Zugang „Verwalten“.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmation": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "confirmation",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Endgültig löschen mit Bestätigung",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "rejected": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "deleted",
                        "rejected"
                      ],
                      "additionalProperties": false
                    },
                    "setup": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "message",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "billing": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "payment_failed"
                          ]
                        },
                        "can_write": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "due_by": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reference": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "transfer": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "status",
                        "can_write",
                        "message",
                        "due_by",
                        "amount_cents",
                        "reference",
                        "transfer"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Bearer fehlt/ungültig/widerrufen oder falscher Mandant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Rolle, Zugang, Leistung oder Mandantenstatus verweigert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Ungültige Angaben",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "120 je Minute und Mandant/Zugang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Vorübergehend nicht möglich",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": []
      }
    }
  },
  "components": {
    "securitySchemes": {
      "sanctum": {
        "type": "http",
        "scheme": "bearer",
        "description": "API-Schlüssel oder App-Token des Mandanten. MCP-OAuth wird hier nicht akzeptiert."
      },
      "geraeteschluessel": {
        "type": "http",
        "scheme": "bearer",
        "description": "Geräteschlüssel (smg_…) aus der Kopplung, nur für /api/v1/geraet"
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "problem": {
            "type": "string"
          },
          "law": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "problem",
          "law"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "missing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Problem"
            }
          },
          "error": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "eingerichtet": {
            "type": "boolean"
          },
          "period": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "key",
              "label",
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": false
      },
      "AccountIdentity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "name"
        ],
        "additionalProperties": false
      },
      "PageMeta": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer"
          },
          "per_page": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "page",
          "per_page",
          "total"
        ],
        "additionalProperties": false
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "debtor",
              "creditor"
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "buyer_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": "string"
          },
          "intro_text_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "closing_text_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "kind",
          "is_active",
          "street",
          "postal_code",
          "city",
          "email",
          "vat_id",
          "buyer_reference",
          "note",
          "country",
          "intro_text_id",
          "closing_text_id"
        ],
        "additionalProperties": false
      },
      "Partner": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "personal_kind": {
            "type": "string",
            "enum": [
              "debtor",
              "creditor"
            ]
          },
          "type": {
            "type": "string"
          },
          "chart": {
            "type": "string",
            "enum": [
              "SKR03",
              "SKR04"
            ]
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "personal_kind",
          "type",
          "chart"
        ],
        "additionalProperties": false
      },
      "Discount": {
        "anyOf": [
          {
            "type": "null"
          },
          {
            "type": "object",
            "properties": {
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9]{1,12}$"
                  }
                ]
              }
            },
            "required": [
              "amount_cents"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "percent_bp": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9]{1,12}$"
                  }
                ]
              }
            },
            "required": [
              "percent_bp"
            ],
            "additionalProperties": false
          }
        ],
        "description": "Genau ein Schlüssel; Centbetrag darf die Nettobasis nicht überschreiten. Prozent in Basispunkten (10000 = 100 %). Laufzeit akzeptiert auch ganzzahlige Ziffernstrings."
      },
      "ProfileSnapshot": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "profile": {
                "type": "string"
              },
              "specification": {
                "type": "string"
              },
              "guideline": {
                "type": "string"
              },
              "specification_sha256": {
                "type": "string"
              },
              "configuration": {
                "type": "string"
              },
              "configuration_sha256": {
                "type": "string"
              },
              "scenario": {
                "type": "string"
              },
              "validator": {
                "type": "string"
              },
              "cen_rules": {
                "type": "string"
              },
              "xrechnung_rules": {
                "type": "string"
              },
              "strategy": {
                "type": "string"
              },
              "fields": {
                "type": "object",
                "properties": {
                  "invoice_profile": {
                    "type": "string",
                    "enum": [
                      "en16931",
                      "xrechnung_3_0_2"
                    ]
                  },
                  "business_process": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "seller_endpoint": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "seller_endpoint_scheme": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "buyer_endpoint": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "buyer_endpoint_scheme": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "seller_contact_name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "seller_contact_phone": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "seller_contact_email": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "buyer_reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "invoice_profile",
                  "business_process",
                  "seller_endpoint",
                  "seller_endpoint_scheme",
                  "buyer_endpoint",
                  "buyer_endpoint_scheme",
                  "seller_contact_name",
                  "seller_contact_phone",
                  "seller_contact_email",
                  "buyer_reference"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "profile",
              "specification",
              "guideline",
              "specification_sha256",
              "configuration",
              "configuration_sha256",
              "scenario",
              "validator",
              "cen_rules",
              "xrechnung_rules",
              "strategy",
              "fields"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "PriceLine": {
        "type": "object",
        "properties": {
          "position": {
            "type": "integer"
          },
          "base_cents": {
            "type": "integer"
          },
          "line_discount_cents": {
            "type": "integer"
          },
          "after_line_cents": {
            "type": "integer"
          },
          "document_discount_cents": {
            "type": "integer"
          },
          "net_cents": {
            "type": "integer"
          },
          "tax_cents": {
            "type": "integer"
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "position",
          "base_cents",
          "line_discount_cents",
          "after_line_cents",
          "document_discount_cents",
          "net_cents",
          "tax_cents",
          "tax_key_id"
        ],
        "additionalProperties": false
      },
      "TaxGroup": {
        "type": "object",
        "properties": {
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "code": {
            "type": "string"
          },
          "rate_bp": {
            "type": "integer"
          },
          "net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "reverse_charge": {
            "type": "boolean"
          },
          "not_taxable": {
            "type": "boolean"
          },
          "category": {
            "type": "string"
          },
          "exemption": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "before_document_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "discount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          }
        },
        "required": [
          "tax_key_id",
          "code",
          "rate_bp",
          "net_cents",
          "tax_cents",
          "reverse_charge",
          "not_taxable",
          "category",
          "exemption"
        ],
        "additionalProperties": false
      },
      "PricingSnapshot": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "rule": {
                "type": "string"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "net"
                ]
              },
              "base_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
              },
              "line_discount_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
              },
              "document_discount_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
              },
              "net_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
              },
              "tax_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
              },
              "lines": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PriceLine"
                }
              },
              "groups": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TaxGroup"
                }
              }
            },
            "required": [
              "rule",
              "basis",
              "base_cents",
              "line_discount_cents",
              "document_discount_cents",
              "net_cents",
              "tax_cents",
              "lines",
              "groups"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "PaymentTermsSnapshot": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "rule": {
                "type": "string"
              },
              "due_date": {
                "type": "string",
                "format": "date"
              },
              "skonto_date": {
                "type": "string",
                "format": "date"
              },
              "skonto_days": {
                "type": "integer"
              },
              "skonto_percent_bp": {
                "type": "integer"
              },
              "basis_cents": {
                "type": "integer"
              },
              "skonto_cents": {
                "type": "integer"
              }
            },
            "required": [
              "rule",
              "due_date",
              "skonto_date",
              "skonto_days",
              "skonto_percent_bp",
              "basis_cents",
              "skonto_cents"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "InvoiceLineInput": {
        "type": "object",
        "properties": {
          "article_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "detail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^-?(?:[0-9]+)(?:\\.[0-9]+)?$"
              }
            ],
            "not": {
              "enum": [
                0,
                "0"
              ]
            }
          },
          "unit": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "unit_price_cents": {
            "type": "integer"
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "revenue_account_id": {
            "type": "integer",
            "minimum": 1
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "quantity"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "not": {
                "properties": {
                  "article_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "article_id"
                ]
              }
            },
            "then": {
              "required": [
                "description",
                "unit_price_cents",
                "revenue_account_id"
              ]
            }
          }
        ]
      },
      "InvoiceLine": {
        "type": "object",
        "properties": {
          "position": {
            "type": "integer"
          },
          "article_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": "string"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "number"
          },
          "unit": {
            "type": "string"
          },
          "unit_price_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "revenue_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "position",
          "article_id",
          "description",
          "detail",
          "quantity",
          "unit",
          "unit_price_cents",
          "discount",
          "net_cents",
          "tax_cents",
          "tax_key_id",
          "revenue_account_id"
        ],
        "additionalProperties": false
      },
      "InvoiceSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "issued"
            ],
            "readOnly": true
          },
          "draft_hash": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_profile": {
            "type": "string",
            "enum": [
              "en16931",
              "xrechnung_3_0_2"
            ]
          },
          "profile_label": {
            "type": "string"
          },
          "profile_fields": {
            "type": "object",
            "properties": {
              "invoice_profile": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "en16931",
                      "xrechnung_3_0_2"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "business_process": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_endpoint": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_endpoint_scheme": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "buyer_endpoint": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "buyer_endpoint_scheme": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_contact_name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_contact_phone": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_contact_email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "invoice_profile",
              "business_process",
              "seller_endpoint",
              "seller_endpoint_scheme",
              "buyer_endpoint",
              "buyer_endpoint_scheme",
              "seller_contact_name",
              "seller_contact_phone",
              "seller_contact_email"
            ],
            "additionalProperties": false
          },
          "profile_snapshot": {
            "$ref": "#/components/schemas/ProfileSnapshot"
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "pricing_snapshot": {
            "$ref": "#/components/schemas/PricingSnapshot"
          },
          "skonto_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "skonto_percent_bp": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_terms_snapshot": {
            "$ref": "#/components/schemas/PaymentTermsSnapshot"
          },
          "payment_terms": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "invoice",
              "credit_note"
            ]
          },
          "invoice_type": {
            "type": "string",
            "enum": [
              "standard",
              "advance",
              "final"
            ]
          },
          "advance_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_means": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "online"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_via": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "clearing_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_name": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR",
              "USD"
            ]
          },
          "language": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ]
          },
          "net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "gross_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "prepaid_net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "prepaid_tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "prepaid_gross_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "payable_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "settlement_entry_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "reverses_invoice_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          },
          "sales_order": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1,
                    "readOnly": true
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "readOnly": true
                  },
                  "revision": {
                    "type": "integer",
                    "readOnly": true
                  },
                  "quote_id": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "released",
                      "superseded",
                      "cancelled",
                      "converted"
                    ]
                  }
                },
                "required": [
                  "id",
                  "number",
                  "revision",
                  "quote_id",
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "project_time_origin": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProjectInvoiceOrigin99"
              },
              {
                "type": "null"
              }
            ]
          },
          "fx_terms": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FxDraftTerms"
              },
              {
                "type": "null"
              }
            ]
          },
          "fx_snapshot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FxSnapshot"
              },
              {
                "type": "null"
              }
            ]
          },
          "fx_preview": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FxSnapshot"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "number",
          "status",
          "draft_hash",
          "invoice_profile",
          "profile_label",
          "profile_fields",
          "profile_snapshot",
          "discount",
          "pricing_snapshot",
          "skonto_days",
          "skonto_percent_bp",
          "payment_terms_snapshot",
          "payment_terms",
          "kind",
          "invoice_type",
          "advance_account_id",
          "invoice_date",
          "service_date",
          "service_period_from",
          "service_period_to",
          "due_date",
          "paid_means",
          "paid_via",
          "clearing_account_id",
          "recipient_name",
          "currency",
          "language",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "prepaid_net_cents",
          "prepaid_tax_cents",
          "prepaid_gross_cents",
          "payable_cents",
          "document_id",
          "journal_entry_id",
          "settlement_entry_id",
          "reverses_invoice_id",
          "project_time_origin",
          "fx_terms",
          "fx_snapshot",
          "fx_preview"
        ],
        "additionalProperties": false
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "issued"
            ],
            "readOnly": true
          },
          "draft_hash": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_profile": {
            "type": "string",
            "enum": [
              "en16931",
              "xrechnung_3_0_2"
            ]
          },
          "profile_label": {
            "type": "string"
          },
          "profile_fields": {
            "type": "object",
            "properties": {
              "invoice_profile": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "en16931",
                      "xrechnung_3_0_2"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "business_process": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_endpoint": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_endpoint_scheme": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "buyer_endpoint": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "buyer_endpoint_scheme": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_contact_name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_contact_phone": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "seller_contact_email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "invoice_profile",
              "business_process",
              "seller_endpoint",
              "seller_endpoint_scheme",
              "buyer_endpoint",
              "buyer_endpoint_scheme",
              "seller_contact_name",
              "seller_contact_phone",
              "seller_contact_email"
            ],
            "additionalProperties": false
          },
          "profile_snapshot": {
            "$ref": "#/components/schemas/ProfileSnapshot"
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "pricing_snapshot": {
            "$ref": "#/components/schemas/PricingSnapshot"
          },
          "skonto_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "skonto_percent_bp": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_terms_snapshot": {
            "$ref": "#/components/schemas/PaymentTermsSnapshot"
          },
          "payment_terms": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "invoice",
              "credit_note"
            ]
          },
          "invoice_type": {
            "type": "string",
            "enum": [
              "standard",
              "advance",
              "final"
            ]
          },
          "advance_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_means": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "online"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_via": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "clearing_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_name": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR",
              "USD"
            ]
          },
          "language": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ]
          },
          "net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "gross_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "prepaid_net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "prepaid_tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "prepaid_gross_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "payable_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl.",
            "readOnly": true
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "settlement_entry_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "reverses_invoice_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "street": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postal_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "vat_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "street",
              "postal_code",
              "city",
              "vat_id",
              "email",
              "country"
            ],
            "additionalProperties": false
          },
          "buyer_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "clearing_account": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AccountIdentity"
              },
              {
                "type": "null"
              }
            ]
          },
          "intro": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "closing": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLine"
            }
          },
          "tax_breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxGroup"
            }
          },
          "unavailable_advances": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "number": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "advance_invoice_ids"
                  ]
                },
                "reason": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "number",
                "field",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "advance_invoice_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "advance_invoices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "number": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "invoice_date": {
                  "type": "string",
                  "format": "date"
                },
                "net_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                },
                "tax_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                },
                "gross_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                }
              },
              "required": [
                "id",
                "number",
                "invoice_date",
                "net_cents",
                "tax_cents",
                "gross_cents"
              ],
              "additionalProperties": false
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "missing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Problem"
            }
          },
          "e_invoice": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string"
                  },
                  "sha256": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                },
                "required": [
                  "format",
                  "sha256",
                  "url"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          },
          "settlement": {
            "type": "object",
            "properties": {
              "journal_entry_id": {
                "type": "integer",
                "minimum": 1
              },
              "entry_number": {
                "type": "string"
              },
              "booking_date": {
                "type": "string",
                "format": "date"
              },
              "amount_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
              },
              "clearing_account_id": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "journal_entry_id",
              "entry_number",
              "booking_date",
              "amount_cents",
              "clearing_account_id"
            ],
            "additionalProperties": false
          },
          "sales_order": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1,
                    "readOnly": true
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "readOnly": true
                  },
                  "revision": {
                    "type": "integer",
                    "readOnly": true
                  },
                  "quote_id": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "released",
                      "superseded",
                      "cancelled",
                      "converted"
                    ]
                  }
                },
                "required": [
                  "id",
                  "number",
                  "revision",
                  "quote_id",
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "project_time_origin": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProjectInvoiceOrigin99"
              },
              {
                "type": "null"
              }
            ]
          },
          "fx_terms": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FxDraftTerms"
              },
              {
                "type": "null"
              }
            ]
          },
          "fx_snapshot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FxSnapshot"
              },
              {
                "type": "null"
              }
            ]
          },
          "fx_preview": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FxSnapshot"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "number",
          "status",
          "draft_hash",
          "invoice_profile",
          "profile_label",
          "profile_fields",
          "profile_snapshot",
          "discount",
          "pricing_snapshot",
          "skonto_days",
          "skonto_percent_bp",
          "payment_terms_snapshot",
          "payment_terms",
          "kind",
          "invoice_type",
          "advance_account_id",
          "invoice_date",
          "service_date",
          "service_period_from",
          "service_period_to",
          "due_date",
          "paid_means",
          "paid_via",
          "clearing_account_id",
          "recipient_name",
          "currency",
          "language",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "prepaid_net_cents",
          "prepaid_tax_cents",
          "prepaid_gross_cents",
          "payable_cents",
          "document_id",
          "journal_entry_id",
          "settlement_entry_id",
          "reverses_invoice_id",
          "recipient",
          "buyer_reference",
          "account_id",
          "clearing_account",
          "intro",
          "closing",
          "lines",
          "tax_breakdown",
          "advance_invoice_ids",
          "advance_invoices",
          "notes",
          "hints",
          "missing",
          "e_invoice",
          "project_time_origin",
          "fx_terms",
          "fx_snapshot",
          "fx_preview"
        ],
        "additionalProperties": false
      },
      "InvoiceCreate": {
        "type": "object",
        "properties": {
          "business_process": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_endpoint_scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "buyer_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "buyer_endpoint_scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_contact_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "invoice_profile": {
            "type": "string",
            "enum": [
              "en16931",
              "xrechnung_3_0_2"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "invoice",
              "credit_note"
            ]
          },
          "invoice_type": {
            "type": "string",
            "enum": [
              "standard",
              "advance",
              "final"
            ]
          },
          "advance_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "advance_invoice_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "uniqueItems": true
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "service_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "skonto_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              },
              {
                "type": "null"
              }
            ]
          },
          "skonto_percent_bp": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 9999
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_name": {
            "type": "string",
            "maxLength": 200
          },
          "recipient_street": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "buyer_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "recipient_vat_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR",
              "USD"
            ]
          },
          "language": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ]
          },
          "intro": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "closing": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "intro_text_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "closing_text_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "clearing_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "ohne_einleitung": {
            "type": "boolean"
          },
          "ohne_schlusstext": {
            "type": "boolean"
          },
          "ohne_vorgabe": {
            "type": "boolean"
          },
          "paid_means": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "online"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_via": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineInput"
            },
            "minItems": 1
          },
          "fx_terms": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FxTerms"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [],
        "additionalProperties": false,
        "anyOf": [
          {
            "required": [
              "recipient_name"
            ]
          },
          {
            "properties": {
              "account_id": {
                "type": "integer"
              }
            },
            "required": [
              "account_id"
            ]
          }
        ]
      },
      "InvoiceUpdate": {
        "type": "object",
        "properties": {
          "business_process": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_endpoint_scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "buyer_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "buyer_endpoint_scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "seller_contact_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "maxLength": 200
          },
          "invoice_profile": {
            "type": "string",
            "enum": [
              "en16931",
              "xrechnung_3_0_2"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "invoice",
              "credit_note"
            ]
          },
          "invoice_type": {
            "type": "string",
            "enum": [
              "standard",
              "advance",
              "final"
            ]
          },
          "advance_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "advance_invoice_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "uniqueItems": true
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "service_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "skonto_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              },
              {
                "type": "null"
              }
            ]
          },
          "skonto_percent_bp": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 9999
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_name": {
            "type": "string",
            "maxLength": 200
          },
          "recipient_street": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "buyer_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "recipient_vat_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR",
              "USD"
            ]
          },
          "language": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ]
          },
          "intro": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "closing": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "intro_text_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "closing_text_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "clearing_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "ohne_einleitung": {
            "type": "boolean"
          },
          "ohne_schlusstext": {
            "type": "boolean"
          },
          "ohne_vorgabe": {
            "type": "boolean"
          },
          "paid_means": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "online"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_via": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineInput"
            },
            "minItems": 1
          },
          "fx_terms": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FxTerms"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "personal_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "chart": {
            "type": "string",
            "enum": [
              "SKR03",
              "SKR04"
            ]
          },
          "vat_box": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_reportable": {
            "type": "boolean"
          },
          "common": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "type",
          "personal_kind",
          "category",
          "chart",
          "vat_box",
          "vat_reportable",
          "common"
        ],
        "additionalProperties": false
      },
      "TaxKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "rate_percent": {
            "type": "number"
          },
          "direction": {
            "type": "string"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "rate_percent",
          "direction",
          "account_id"
        ],
        "additionalProperties": false
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "recht": {
            "type": "string",
            "enum": [
              "read",
              "write",
              "admin"
            ]
          },
          "art": {
            "type": "string",
            "enum": [
              "app",
              "schluessel"
            ]
          },
          "user": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "current": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "recht",
          "art",
          "user",
          "created_at",
          "last_used_at",
          "expires_at",
          "current"
        ],
        "additionalProperties": false
      },
      "Rate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "account": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "number": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "number",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "article_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "unit": {
            "type": "string"
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "valid_from": {
            "type": "string",
            "format": "date"
          },
          "display": {
            "type": "string"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "account_id",
          "account",
          "article_id",
          "label",
          "unit",
          "amount_cents",
          "valid_from",
          "display",
          "note"
        ],
        "additionalProperties": false
      },
      "Article": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "unit": {
            "type": "string"
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "revenue_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "closing_text_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "description",
          "unit",
          "tax_key_id",
          "revenue_account_id",
          "is_active",
          "closing_text_id"
        ],
        "additionalProperties": false
      },
      "ClosingText": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "closing",
              "intro"
            ]
          },
          "name": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "paid_means": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "online"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_via": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "clearing_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "clearing_account": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AccountIdentity"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_default": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "deactivated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "references": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "text",
          "paid_means",
          "paid_via",
          "clearing_account_id",
          "clearing_account",
          "is_default",
          "is_active",
          "deactivated_at",
          "references"
        ],
        "additionalProperties": false
      },
      "IntroText": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "closing",
              "intro"
            ]
          },
          "name": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "deactivated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "references": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "text",
          "is_default",
          "is_active",
          "deactivated_at",
          "references"
        ],
        "additionalProperties": false
      },
      "JournalLine": {
        "type": "object",
        "properties": {
          "position": {
            "type": "integer"
          },
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "minimum": 1
              },
              "number": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "number",
              "name"
            ],
            "additionalProperties": false
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "debit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "credit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "cost_center_source_line_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "cost_center": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "number": {
                    "type": "string",
                    "pattern": "^[0-9]{1,8}$"
                  },
                  "name": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "id",
                  "number",
                  "name",
                  "is_active"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "position",
          "account",
          "tax_key_id",
          "debit_cents",
          "credit_cents",
          "description"
        ],
        "additionalProperties": false
      },
      "EntryForeignCurrency": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "amount_cents": {
            "type": "integer",
            "description": "Originalbetrag in Cent der Fremdwährung, beim Storno mit dem Wert des Originals."
          },
          "units_per_eur": {
            "type": "string",
            "description": "Einheiten der Fremdwährung je Euro als Dezimalzahl.",
            "pattern": "^[0-9]+(\\.[0-9]+)?$"
          },
          "rate_date": {
            "type": "string",
            "format": "date"
          },
          "source": {
            "type": "string",
            "enum": [
              "ECB"
            ]
          },
          "rate_id": {
            "type": "integer",
            "minimum": 1
          },
          "source_sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "groups": {
            "type": "array",
            "description": "Steuergruppen des Belegs in Originalwährung und EUR.",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "service_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "currency",
          "amount_cents",
          "units_per_eur",
          "rate_date",
          "source",
          "rate_id",
          "source_sha256",
          "groups",
          "service_date"
        ],
        "additionalProperties": false
      },
      "Entry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "posted"
            ]
          },
          "description": {
            "type": "string"
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "booking_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "recorded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reverses_entry_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "fx": {
            "description": "Herkunft einer Buchung aus einem Eingangsbeleg in Fremdwährung. Bei jeder anderen Buchung null, auch bei einer USD-Ausgangsrechnung, deren Herkunft an der Rechnung steht. Die Zeilen der Buchung stehen immer in EUR.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/EntryForeignCurrency"
              },
              {
                "type": "null"
              }
            ]
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "name": {
                  "type": "string"
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "locked": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "sha256",
                "locked"
              ],
              "additionalProperties": false
            }
          },
          "total_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "total": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalLine"
            }
          }
        },
        "required": [
          "id",
          "entry_number",
          "status",
          "description",
          "document_date",
          "booking_date",
          "recorded_at",
          "posted_at",
          "reverses_entry_id",
          "fx",
          "documents",
          "total_cents",
          "total",
          "lines"
        ],
        "additionalProperties": false
      },
      "McpConnection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "client": {
            "type": "string"
          },
          "recht": {
            "type": "string",
            "enum": [
              "read",
              "write"
            ]
          },
          "user": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "erteilt_am": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "client",
          "recht",
          "user",
          "erteilt_am"
        ],
        "additionalProperties": false
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "accountant",
              "viewer"
            ]
          },
          "role_label": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "two_factor": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "role",
          "role_label",
          "active",
          "two_factor"
        ],
        "additionalProperties": false
      },
      "AssistantImprovement": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "since": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "text_version": {
            "type": "string"
          },
          "text": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "available",
          "enabled",
          "since",
          "text_version",
          "text"
        ],
        "additionalProperties": false
      },
      "Task": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "document",
              "transaction",
              "entry",
              "invoice",
              "quote"
            ]
          },
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "title": {
            "type": "string"
          },
          "subtitle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "amount_cents": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
              },
              {
                "type": "null"
              }
            ]
          },
          "date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "age_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "overdue": {
            "type": "boolean"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "web_url": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "kind",
          "id",
          "title",
          "subtitle",
          "amount_cents",
          "date",
          "age_days",
          "overdue",
          "reasons",
          "web_url"
        ],
        "additionalProperties": false
      },
      "Message": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": false
      },
      "OpenItem": {
        "type": "object",
        "properties": {
          "line_id": {
            "type": "integer",
            "minimum": 1
          },
          "account_id": {
            "type": "integer",
            "minimum": 1
          },
          "account_number": {
            "type": "string"
          },
          "account_name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "debtor",
              "creditor"
            ]
          },
          "entry_number": {
            "type": "string"
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "allocated_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "open_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          }
        },
        "required": [
          "line_id",
          "account_id",
          "account_number",
          "account_name",
          "kind",
          "entry_number",
          "booking_date",
          "description",
          "amount_cents",
          "allocated_cents",
          "open_cents"
        ],
        "additionalProperties": false
      },
      "WebhookSubscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "invoice.issued",
                "invoice.corrected",
                "journal.posted"
              ]
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "revoked"
            ]
          },
          "generation": {
            "type": "integer",
            "minimum": 1
          },
          "key_id": {
            "type": "string",
            "format": "uuid"
          },
          "previous_key_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "previous_until": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset, nicht ISO-normalisiert."
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset, nicht ISO-normalisiert."
          }
        },
        "required": [
          "id",
          "types",
          "state",
          "generation",
          "key_id",
          "previous_key_id",
          "previous_until",
          "created_at"
        ],
        "additionalProperties": false
      },
      "WebhookEvent": {
        "type": "object",
        "properties": {
          "version": {
            "const": 1
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "invoice.issued",
              "invoice.corrected",
              "journal.posted"
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "resource": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invoice",
                  "journal_entry"
                ]
              },
              "id": {
                "type": "integer",
                "minimum": 1
              },
              "path": {
                "type": "string",
                "pattern": "^/api/v1/(invoices|entries)/[0-9]+$"
              }
            },
            "required": [
              "type",
              "id",
              "path"
            ],
            "additionalProperties": false
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "id",
          "tenant",
          "type",
          "occurred_at",
          "resource"
        ],
        "additionalProperties": false
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "subscription_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "generation": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "succeeded",
              "failed",
              "canceled",
              "expired"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 24
          },
          "replays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2
          },
          "next_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset, nicht ISO-normalisiert."
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset, nicht ISO-normalisiert."
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset, nicht ISO-normalisiert."
          }
        },
        "required": [
          "id",
          "subscription_id",
          "event_id",
          "generation",
          "state",
          "attempts",
          "replays",
          "next_at",
          "expires_at",
          "created_at"
        ],
        "additionalProperties": false
      },
      "WebhookSecret": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key_id": {
            "type": "string",
            "format": "uuid"
          },
          "secret": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "Einmal ausgegebene ASCII-Zeichenfolge; für HMAC nicht hex-dekodieren."
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "key_id",
          "secret"
        ],
        "additionalProperties": false
      },
      "MailAttachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "size_bytes": {
            "type": "integer"
          },
          "mime_type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5
          },
          "retry_revision": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "retryable": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "sha256",
          "size_bytes",
          "mime_type",
          "status",
          "error_code",
          "document_id",
          "attempts",
          "retry_revision",
          "retryable"
        ],
        "additionalProperties": false
      },
      "MailInbox": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean",
            "description": "Ob ein Empfangsweg eingerichtet ist. Ohne ihn bleibt ein aktiver Eingang wirkungslos, und rotate wird abgewiesen."
          },
          "active": {
            "type": "boolean"
          },
          "inbox_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "next_before_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "received_at": {
                  "type": "string",
                  "description": "Zeitstempel als Text mit Zeitzonenoffset, nicht ISO-normalisiert."
                },
                "raw_sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "no_attachments",
                    "complete",
                    "partial",
                    "needs_attention"
                  ]
                },
                "attachments": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MailAttachment"
                  }
                }
              },
              "required": [
                "id",
                "received_at",
                "raw_sha256",
                "status",
                "attachments"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "available",
          "active",
          "inbox_id",
          "revision",
          "next_before_id",
          "deliveries"
        ],
        "additionalProperties": false
      },
      "SourceJson": {
        "anyOf": [
          {
            "type": [
              "string",
              "number",
              "boolean",
              "null"
            ]
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceJson"
            }
          },
          {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SourceJson"
            }
          }
        ]
      },
      "SetupStatus": {
        "type": "object",
        "properties": {
          "complete": {
            "type": "boolean"
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "step": {
                  "type": "string"
                },
                "why": {
                  "type": "string"
                },
                "how": {
                  "type": "string"
                }
              },
              "required": [
                "step",
                "why",
                "how"
              ],
              "additionalProperties": false
            }
          },
          "settings": {
            "type": "object",
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "chart": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxation": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxation_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxation_basis": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxation_basis_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "vat_filing": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tax_number": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "vat_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "legal_form": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "legal_form_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "iban": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxation_history": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "valid_from": {
                      "type": "string",
                      "format": "date"
                    },
                    "taxation": {
                      "type": "string",
                      "enum": [
                        "soll",
                        "ist"
                      ]
                    },
                    "basis": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "automatic": {
                      "type": "boolean"
                    },
                    "note": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "valid_from",
                    "taxation",
                    "basis",
                    "automatic",
                    "note"
                  ],
                  "additionalProperties": false
                }
              },
              "vat_filing_history": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "valid_from": {
                      "type": "string",
                      "format": "date"
                    },
                    "frequency": {
                      "type": "string",
                      "enum": [
                        "month",
                        "quarter"
                      ]
                    },
                    "note": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "valid_from",
                    "frequency",
                    "note"
                  ],
                  "additionalProperties": false
                }
              },
              "address": {
                "type": "object",
                "properties": {
                  "street": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postal_code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "type": "string"
                  },
                  "complete": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "street",
                  "postal_code",
                  "city",
                  "country",
                  "complete"
                ],
                "additionalProperties": false
              },
              "small_business": {
                "type": "boolean"
              },
              "receivables_account_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "invoicing_ready": {
                "type": "boolean"
              },
              "invoice_number": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string"
                  },
                  "credit_note_format": {
                    "type": "string"
                  },
                  "next_formatted": {
                    "type": "string"
                  },
                  "notice": {
                    "type": "string"
                  },
                  "year": {
                    "type": "integer"
                  },
                  "next": {
                    "type": "integer"
                  },
                  "next_settable": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "format",
                  "credit_note_format",
                  "next_formatted",
                  "notice",
                  "year",
                  "next",
                  "next_settable"
                ],
                "additionalProperties": false
              },
              "accounts": {
                "type": "integer"
              },
              "tax_keys": {
                "type": "integer"
              },
              "open_fiscal_years": {
                "type": "integer"
              }
            },
            "required": [
              "name",
              "chart",
              "taxation",
              "taxation_label",
              "taxation_basis",
              "taxation_basis_label",
              "vat_filing",
              "tax_number",
              "vat_id",
              "legal_form",
              "legal_form_label",
              "iban",
              "taxation_history",
              "vat_filing_history",
              "address",
              "small_business",
              "receivables_account_id",
              "invoicing_ready",
              "invoice_number",
              "accounts",
              "tax_keys",
              "open_fiscal_years"
            ],
            "additionalProperties": false
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "complete",
          "missing",
          "settings"
        ],
        "additionalProperties": false
      },
      "DocumentExtractSummary": {
        "type": "object",
        "properties": {
          "issuer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "profile": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "net_cents": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_cents": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_cents": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "source": {
            "type": "string"
          },
          "tax_breakdown": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "rate": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "net_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tax_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "category": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "scheme": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "rate",
                    "net_cents",
                    "tax_cents"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "problems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "ocr_request_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "provenance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SourceJson"
              },
              {
                "type": "null"
              }
            ]
          },
          "issued_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "extracted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "issuer_name",
          "invoice_number",
          "currency",
          "profile",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "id",
          "source",
          "tax_breakdown",
          "problems",
          "ocr_request_id",
          "provenance",
          "issued_on",
          "extracted_at"
        ],
        "additionalProperties": false
      },
      "Recognition": {
        "type": "object",
        "properties": {
          "new_reading_available": {
            "type": "boolean"
          },
          "latest_ocr_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "latest_ocr_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "needs_review",
              "structured",
              "failed",
              "unsupported",
              "pending",
              "running",
              "not_requested"
            ]
          },
          "message": {
            "type": "string"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "request_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "attempt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 5
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "extract_is_previous": {
            "type": "boolean"
          },
          "extract": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentExtractSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "limits": {
            "type": "object",
            "properties": {
              "upload_bytes": {
                "type": "integer"
              },
              "ocr_bytes": {
                "type": "integer"
              },
              "image_pixels": {
                "type": "integer"
              },
              "pages": {
                "type": "integer"
              },
              "timeout_seconds": {
                "type": "integer"
              },
              "max_attempts": {
                "type": "integer"
              },
              "formats": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "upload_bytes",
              "ocr_bytes",
              "image_pixels",
              "pages",
              "timeout_seconds",
              "max_attempts",
              "formats"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "new_reading_available",
          "latest_ocr_status",
          "latest_ocr_message",
          "status",
          "message",
          "error_code",
          "request_id",
          "attempt",
          "started_at",
          "finished_at",
          "retryable",
          "extract_is_previous",
          "extract",
          "limits"
        ],
        "additionalProperties": false
      },
      "DocumentDuplicate": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "issuer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "issued_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_cents": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              {
                "type": "null"
              }
            ]
          },
          "e_invoice": {
            "type": "boolean"
          },
          "state": {
            "type": "string",
            "enum": [
              "posted",
              "draft",
              "reversed",
              "open"
            ]
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "matches": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "supplier",
                "invoice_number",
                "amount",
                "date"
              ]
            }
          },
          "strong": {
            "type": "boolean"
          }
        },
        "required": [
          "document_id",
          "name",
          "issuer_name",
          "invoice_number",
          "issued_on",
          "gross_cents",
          "e_invoice",
          "state",
          "entry_number",
          "matches",
          "strong"
        ],
        "additionalProperties": false
      },
      "Document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "recognition": {
            "$ref": "#/components/schemas/Recognition"
          },
          "name": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "received_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "locked": {
            "type": "boolean"
          },
          "discardable": {
            "type": "boolean"
          },
          "locked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "entry_number": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "entry_number",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "duplicates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentDuplicate"
            }
          },
          "validation": {
            "$ref": "#/components/schemas/IncomingValidationState"
          },
          "hidden": {
            "type": "boolean",
            "description": "Ausgeblendeter Fehlimport. Original und Historie bleiben erhalten."
          },
          "visibility_history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentVisibilityEvent"
            }
          }
        },
        "required": [
          "id",
          "recognition",
          "name",
          "mime_type",
          "size_bytes",
          "sha256",
          "document_date",
          "note",
          "received_at",
          "locked",
          "discardable",
          "locked_at",
          "entries",
          "duplicates",
          "validation",
          "hidden",
          "visibility_history"
        ],
        "additionalProperties": false
      },
      "ReviewValues": {
        "type": "object",
        "properties": {
          "issuer_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "issuer_vat_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "issuer_iban": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "issued_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "due_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "net_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -1000000000000,
                "maximum": 1000000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -1000000000000,
                "maximum": 1000000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -1000000000000,
                "maximum": 1000000000000
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "AED",
                  "AFN",
                  "ALL",
                  "AMD",
                  "ANG",
                  "AOA",
                  "ARS",
                  "AUD",
                  "AWG",
                  "AZN",
                  "BAM",
                  "BBD",
                  "BDT",
                  "BGN",
                  "BHD",
                  "BIF",
                  "BMD",
                  "BND",
                  "BOB",
                  "BOV",
                  "BRL",
                  "BSD",
                  "BTN",
                  "BWP",
                  "BYN",
                  "BZD",
                  "CAD",
                  "CDF",
                  "CHE",
                  "CHF",
                  "CHW",
                  "CLF",
                  "CLP",
                  "CNY",
                  "COP",
                  "COU",
                  "CRC",
                  "CUP",
                  "CVE",
                  "CZK",
                  "DJF",
                  "DKK",
                  "DOP",
                  "DZD",
                  "EGP",
                  "ERN",
                  "ETB",
                  "EUR",
                  "FJD",
                  "FKP",
                  "GBP",
                  "GEL",
                  "GHS",
                  "GIP",
                  "GMD",
                  "GNF",
                  "GTQ",
                  "GYD",
                  "HKD",
                  "HNL",
                  "HTG",
                  "HUF",
                  "IDR",
                  "ILS",
                  "INR",
                  "IQD",
                  "IRR",
                  "ISK",
                  "JMD",
                  "JOD",
                  "JPY",
                  "KES",
                  "KGS",
                  "KHR",
                  "KMF",
                  "KPW",
                  "KRW",
                  "KWD",
                  "KYD",
                  "KZT",
                  "LAK",
                  "LBP",
                  "LKR",
                  "LRD",
                  "LSL",
                  "LYD",
                  "MAD",
                  "MDL",
                  "MGA",
                  "MKD",
                  "MMK",
                  "MNT",
                  "MOP",
                  "MRU",
                  "MUR",
                  "MVR",
                  "MWK",
                  "MXN",
                  "MXV",
                  "MYR",
                  "MZN",
                  "NAD",
                  "NGN",
                  "NIO",
                  "NOK",
                  "NPR",
                  "NZD",
                  "OMR",
                  "PAB",
                  "PEN",
                  "PGK",
                  "PHP",
                  "PKR",
                  "PLN",
                  "PYG",
                  "QAR",
                  "RON",
                  "RSD",
                  "RUB",
                  "RWF",
                  "SAR",
                  "SBD",
                  "SCR",
                  "SDG",
                  "SEK",
                  "SGD",
                  "SHP",
                  "SLE",
                  "SOS",
                  "SRD",
                  "SSP",
                  "STN",
                  "SVC",
                  "SYP",
                  "SZL",
                  "THB",
                  "TJS",
                  "TMT",
                  "TND",
                  "TOP",
                  "TRY",
                  "TTD",
                  "TWD",
                  "TZS",
                  "UAH",
                  "UGX",
                  "USD",
                  "USN",
                  "UYI",
                  "UYU",
                  "UYW",
                  "UZS",
                  "VED",
                  "VES",
                  "VND",
                  "VUV",
                  "WST",
                  "XAF",
                  "XCD",
                  "XCG",
                  "XDR",
                  "XOF",
                  "XPF",
                  "XSU",
                  "XUA",
                  "YER",
                  "ZAR",
                  "ZMW",
                  "ZWG"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_breakdown": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "rate": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "net_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tax_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "category": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "scheme": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "rate",
                    "net_cents",
                    "tax_cents"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 12
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_details": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "document_type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "buyer_reference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "order_reference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "contract_reference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "service_date": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "service_start": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "service_end": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "rounding_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -1000000000000,
                        "maximum": 1000000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "prepaid_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -1000000000000,
                        "maximum": 1000000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "payable_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -1000000000000,
                        "maximum": 1000000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "issuer_address": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "line_one": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "line_two": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "line_three": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "city": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "postcode": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "country": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "subdivision": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "recipient_address": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "line_one": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "line_two": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "line_three": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "city": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "postcode": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "country": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "subdivision": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "positions": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 255
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 255
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "unit": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 255
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "category": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 255
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "scheme": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 255
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "quantity": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?[0-9]{1,12}(?:\\.[0-9]{1,12})?$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "unit_price": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?[0-9]{1,12}(?:\\.[0-9]{1,12})?$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "price_base_quantity": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?[0-9]{1,12}(?:\\.[0-9]{1,12})?$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "rate": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?[0-9]{1,12}(?:\\.[0-9]{1,12})?$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "net_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -1000000000000,
                                  "maximum": 1000000000000
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "service_start": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "date"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "service_end": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "date"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [],
                          "additionalProperties": false
                        },
                        "maxItems": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "adjustments": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "charge": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 20
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "amount_cents": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -1000000000000,
                                  "maximum": 1000000000000
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reason": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 255
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [],
                          "additionalProperties": false
                        },
                        "maxItems": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "non_cent_amounts": {
                    "type": "boolean"
                  },
                  "currency_mismatch": {
                    "type": "boolean"
                  },
                  "is_credit_note": {
                    "type": "boolean"
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "issuer_name",
          "invoice_number",
          "issuer_vat_id",
          "issuer_iban",
          "issued_on",
          "service_date",
          "due_on",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "currency",
          "tax_breakdown",
          "invoice_details"
        ],
        "additionalProperties": false
      },
      "DocumentReview": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "integer",
            "minimum": 1
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "version": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "extract_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "values": {
            "$ref": "#/components/schemas/ReviewValues"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "provenance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SourceJson"
              },
              {
                "type": "null"
              }
            ]
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentExtractRecord"
            }
          },
          "duplicates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "beleg_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "name": {
                  "type": "string"
                },
                "aussteller": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "rechnungsnummer": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "datum": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "brutto_cents": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "description": "Ganzzahlige Cent"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "e_rechnung": {
                  "type": "boolean"
                },
                "stand": {
                  "type": "string"
                },
                "buchung": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "merkmale": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "gleich": {
                  "type": "boolean"
                }
              },
              "required": [
                "beleg_id",
                "name",
                "aussteller",
                "rechnungsnummer",
                "datum",
                "brutto_cents",
                "e_rechnung",
                "stand",
                "buchung",
                "merkmale",
                "gleich"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "document_id",
          "original_sha256",
          "version",
          "extract_id",
          "values",
          "source",
          "provenance",
          "history",
          "duplicates"
        ],
        "additionalProperties": false
      },
      "BankConnection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "bank_code": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "tan_mode": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "tan_mode_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "ready": {
            "type": "boolean"
          },
          "fetch_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "history_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_fetched_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "iban": {
                  "type": "string"
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "iban",
                "name"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "name",
          "bank_code",
          "url",
          "tan_mode",
          "tan_mode_name",
          "ready",
          "fetch_from",
          "history_days",
          "last_fetched_at",
          "last_error",
          "accounts"
        ],
        "additionalProperties": false
      },
      "StatementImportResult": {
        "type": "object",
        "properties": {
          "statements": {
            "type": "integer"
          },
          "transactions": {
            "type": "integer"
          },
          "duplicates": {
            "type": "integer"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "periods": {
            "type": "array",
            "description": "Je Konto der Datei: erste und letzte Buchung, ohne Umsatz das Datum des Auszugs.",
            "items": {
              "type": "object",
              "properties": {
                "iban": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "from": {
                  "type": "string",
                  "format": "date"
                },
                "to": {
                  "type": "string",
                  "format": "date"
                }
              },
              "required": [
                "iban",
                "name",
                "from",
                "to"
              ],
              "additionalProperties": false
            }
          },
          "document_id": {
            "type": "integer",
            "minimum": 1
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          },
          "data_status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BankDataStatus"
              }
            ],
            "description": "Nur beim CSV-Import"
          }
        },
        "required": [
          "statements",
          "transactions",
          "duplicates",
          "warnings",
          "accounts",
          "periods"
        ],
        "additionalProperties": false
      },
      "BankTransaction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "bank_account_id": {
            "type": "integer",
            "minimum": 1
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "counterparty_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "counterparty_iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "purpose": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "end_to_end_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "booked_on": {
            "type": "string",
            "format": "date"
          },
          "value_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "purpose_text": {
            "type": "string"
          },
          "settled": {
            "type": "boolean"
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "bank_account_id",
          "amount_cents",
          "counterparty_name",
          "counterparty_iban",
          "purpose",
          "end_to_end_id",
          "booked_on",
          "value_date",
          "purpose_text",
          "settled",
          "journal_entry_id",
          "entry_number"
        ],
        "additionalProperties": false
      },
      "SettlementSkontoGroup": {
        "type": "object",
        "properties": {
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "type": "integer",
            "minimum": 1
          },
          "tax_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "source_line_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "source_net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "source_tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "gross_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "rate_bp": {
            "type": "integer"
          },
          "tax_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "direction": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_number": {
            "type": "string"
          },
          "source_gross_cents": {
            "type": "integer"
          }
        },
        "required": [
          "tax_key_id",
          "account_id",
          "tax_account_id",
          "source_line_ids",
          "source_net_cents",
          "source_tax_cents",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "rate_bp",
          "tax_code",
          "direction",
          "account_number",
          "source_gross_cents"
        ],
        "additionalProperties": false
      },
      "CsvOptions": {
        "type": "object",
        "properties": {
          "profile": {
            "type": "string",
            "enum": [
              "generic",
              "finom"
            ]
          },
          "delimiter": {
            "type": "string",
            "enum": [
              ";",
              ","
            ]
          },
          "encoding": {
            "type": "string",
            "enum": [
              "UTF-8",
              "Windows-1252"
            ]
          },
          "date_format": {
            "type": "string",
            "enum": [
              "Y-m-d",
              "d.m.Y",
              "d-m-Y",
              "d/m/Y",
              "m/d/Y"
            ]
          },
          "number_format": {
            "type": "string",
            "enum": [
              "decimal_comma",
              "decimal_dot"
            ]
          },
          "booked_status": {
            "type": "string",
            "maxLength": 100
          },
          "mapping": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 63
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "decisions": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 40
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "required": [
          "delimiter",
          "encoding",
          "date_format",
          "number_format",
          "booked_status",
          "mapping"
        ],
        "additionalProperties": false
      },
      "CsvPreview": {
        "type": "object",
        "properties": {
          "headers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "line": {
                  "type": "integer"
                },
                "values": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "booked_on": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "value_date": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "amount_cents": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "description": "Ganzzahlige Cent"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "balance": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "description": "Ganzzahlige Cent"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "currency": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "counterparty_name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "counterparty_iban": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "purpose": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "bank_reference": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "end_to_end_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "duplicate_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "candidates": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "identity": {
                  "type": "string"
                },
                "fingerprint": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              },
              "required": [
                "line",
                "values",
                "booked_on",
                "amount_cents",
                "error",
                "duplicate_id",
                "candidates",
                "identity"
              ],
              "additionalProperties": false
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "incoming": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "outgoing": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "duplicates": {
            "type": "integer"
          },
          "conflicts": {
            "type": "integer"
          },
          "count": {
            "type": "integer"
          },
          "opening": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              {
                "type": "null"
              }
            ]
          },
          "closing": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              {
                "type": "null"
              }
            ]
          },
          "valid": {
            "type": "boolean"
          },
          "account_id": {
            "type": "integer",
            "minimum": 1
          },
          "account": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "version": {
            "type": "string"
          },
          "options": {
            "$ref": "#/components/schemas/CsvOptions"
          },
          "token": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          },
          "continuity": {
            "type": "object",
            "description": "Bisheriger Stand und die Saldenlücke, die nach dem Import bliebe. Teil der gebundenen Vorschau.",
            "properties": {
              "previous_through": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "gap": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BankBalanceGap"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "previous_through",
              "gap"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "headers",
          "rows",
          "errors",
          "incoming",
          "outgoing",
          "from",
          "to",
          "duplicates",
          "conflicts",
          "count",
          "opening",
          "closing",
          "valid",
          "account_id",
          "account",
          "sha256",
          "version",
          "options",
          "token",
          "continuity"
        ],
        "additionalProperties": false
      },
      "StripeConnection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "account": {
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "auth_method": {
            "type": "string"
          },
          "connected": {
            "type": "boolean"
          },
          "fetch_from": {
            "type": "string",
            "format": "date"
          },
          "last_fetched_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "disconnected_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "bank_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "ledger_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "account",
          "name",
          "livemode",
          "auth_method",
          "connected",
          "fetch_from",
          "last_fetched_at",
          "last_error",
          "last_warnings",
          "disconnected_at",
          "bank_account_id",
          "ledger_account_id"
        ],
        "additionalProperties": false
      },
      "QuoteLine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "quote_id": {
            "type": "integer",
            "readOnly": true
          },
          "position": {
            "type": "integer",
            "readOnly": true
          },
          "snapshot": {
            "type": "object",
            "properties": {
              "article_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "description": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "detail": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "quantity": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "unit": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unit_price_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tax_key_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "revenue_account_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rate_label": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tax_snapshot": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "code": {
                        "type": "string"
                      },
                      "direction": {
                        "type": "string"
                      },
                      "rate_bp": {
                        "type": "integer"
                      },
                      "category": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "account_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "counter_account_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "vat_box": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "code",
                      "direction",
                      "rate_bp",
                      "category",
                      "account_id",
                      "counter_account_id",
                      "vat_box"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "net_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "tax_rate_bp": {
                "type": "integer"
              }
            },
            "required": [
              "description",
              "detail",
              "quantity",
              "unit",
              "unit_price_cents",
              "tax_key_id",
              "revenue_account_id",
              "tax_snapshot",
              "net_cents",
              "tax_rate_bp"
            ],
            "additionalProperties": false,
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "quote_id",
          "position",
          "snapshot",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Quote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "released",
              "accepted",
              "rejected",
              "superseded"
            ],
            "readOnly": true
          },
          "content": {
            "type": "object",
            "properties": {
              "account_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "quote_date": {
                "type": "string",
                "format": "date"
              },
              "intro_text": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "closing_text": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currency": {
                "type": "string",
                "enum": [
                  "EUR"
                ]
              },
              "recipient_name": {
                "type": "string"
              },
              "recipient_street": {
                "type": "string"
              },
              "recipient_postal_code": {
                "type": "string"
              },
              "recipient_city": {
                "type": "string"
              },
              "recipient_country": {
                "type": "string"
              },
              "recipient_vat_id": {
                "type": "string"
              },
              "recipient_email": {
                "type": "string"
              },
              "buyer_reference": {
                "type": "string"
              },
              "sender": {
                "type": "object",
                "properties": {
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "street": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postal_code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tax_number": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "register": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "represented_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "website": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "invoice_font": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "small_business": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "street",
                  "postal_code",
                  "city",
                  "country",
                  "vat_id",
                  "tax_number",
                  "register",
                  "represented_by",
                  "phone",
                  "email",
                  "website",
                  "invoice_font",
                  "small_business"
                ],
                "additionalProperties": false
              },
              "net_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "tax_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "gross_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              }
            },
            "required": [
              "quote_date",
              "currency",
              "recipient_name",
              "recipient_street",
              "recipient_postal_code",
              "recipient_city",
              "recipient_country",
              "recipient_vat_id",
              "recipient_email",
              "buyer_reference",
              "sender",
              "net_cents",
              "tax_cents",
              "gross_cents"
            ],
            "additionalProperties": false,
            "readOnly": true
          },
          "valid_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "previous_quote_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "revision": {
            "type": "integer",
            "readOnly": true
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "released_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "pdf_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "snapshot_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "decision_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "decision_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuoteLine"
            },
            "readOnly": true
          },
          "sales_orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesOrder"
            }
          }
        },
        "required": [
          "id",
          "status",
          "content",
          "valid_until",
          "previous_quote_id",
          "revision",
          "number",
          "released_at",
          "pdf_hash",
          "snapshot_hash",
          "decision_on",
          "decision_source",
          "invoice_id",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "InvoiceRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "status": {
            "type": "string",
            "readOnly": true
          },
          "kind": {
            "type": "string",
            "readOnly": true
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "number_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "service_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "service_period_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "service_period_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "recipient_name": {
            "type": "string",
            "readOnly": true
          },
          "recipient_street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient_country": {
            "type": "string",
            "readOnly": true
          },
          "recipient_vat_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "buyer_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "currency": {
            "type": "string",
            "readOnly": true
          },
          "net_cents": {
            "type": "integer",
            "readOnly": true
          },
          "tax_cents": {
            "type": "integer",
            "readOnly": true
          },
          "gross_cents": {
            "type": "integer",
            "readOnly": true
          },
          "intro": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "closing": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "reverses_invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "issued_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "issued_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "formatted_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_type": {
            "type": "string",
            "readOnly": true
          },
          "advance_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "prepaid_net_cents": {
            "type": "integer",
            "readOnly": true
          },
          "prepaid_tax_cents": {
            "type": "integer",
            "readOnly": true
          },
          "prepaid_gross_cents": {
            "type": "integer",
            "readOnly": true
          },
          "advance_transfer_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "profile_snapshot": {
            "$ref": "#/components/schemas/ProfileSnapshot",
            "readOnly": true
          },
          "discount": {
            "$ref": "#/components/schemas/Discount",
            "readOnly": true
          },
          "pricing_snapshot": {
            "$ref": "#/components/schemas/PricingSnapshot",
            "readOnly": true
          },
          "skonto_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "skonto_percent_bp": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "payment_terms_snapshot": {
            "$ref": "#/components/schemas/PaymentTermsSnapshot",
            "readOnly": true
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineRecord"
            },
            "readOnly": true
          },
          "business_process": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_endpoint": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_endpoint_scheme": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "buyer_endpoint": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "buyer_endpoint_scheme": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_contact_name": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_contact_phone": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_contact_email": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "paid_via": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "invoice_profile": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "en16931",
              "xrechnung_3_0_2"
            ],
            "readOnly": true
          },
          "paid_means": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "online"
            ],
            "readOnly": true
          },
          "clearing_account_id": {
            "type": [
              "integer",
              "null"
            ],
            "readOnly": true
          },
          "settlement_entry_id": {
            "type": [
              "integer",
              "null"
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "status",
          "kind",
          "number",
          "number_year",
          "invoice_date",
          "service_date",
          "service_period_from",
          "service_period_to",
          "due_date",
          "recipient_name",
          "recipient_street",
          "recipient_postal_code",
          "recipient_city",
          "recipient_country",
          "recipient_vat_id",
          "recipient_email",
          "buyer_reference",
          "account_id",
          "currency",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "intro",
          "closing",
          "reverses_invoice_id",
          "document_id",
          "journal_entry_id",
          "issued_at",
          "issued_by",
          "created_by",
          "created_at",
          "updated_at",
          "formatted_number",
          "invoice_type",
          "advance_account_id",
          "prepaid_net_cents",
          "prepaid_tax_cents",
          "prepaid_gross_cents",
          "advance_transfer_entry_id",
          "language",
          "profile_snapshot",
          "discount",
          "pricing_snapshot",
          "skonto_days",
          "skonto_percent_bp",
          "payment_terms_snapshot",
          "business_process",
          "seller_endpoint",
          "seller_endpoint_scheme",
          "buyer_endpoint",
          "buyer_endpoint_scheme",
          "seller_contact_name",
          "seller_contact_phone",
          "seller_contact_email",
          "paid_via",
          "invoice_profile",
          "paid_means",
          "clearing_account_id",
          "settlement_entry_id"
        ],
        "additionalProperties": false
      },
      "InvoiceLineRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "invoice_id": {
            "type": "integer",
            "readOnly": true
          },
          "position": {
            "type": "integer",
            "readOnly": true
          },
          "description": {
            "type": "string",
            "readOnly": true
          },
          "quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^-?[0-9]+(?:\\.[0-9]+)?$"
              }
            ],
            "readOnly": true
          },
          "unit": {
            "type": "string",
            "readOnly": true
          },
          "unit_price_cents": {
            "type": "integer",
            "readOnly": true
          },
          "net_cents": {
            "type": "integer",
            "readOnly": true
          },
          "tax_cents": {
            "type": "integer",
            "readOnly": true
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "revenue_account_id": {
            "type": "integer",
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "article_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "discount": {
            "$ref": "#/components/schemas/Discount",
            "readOnly": true
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "id",
          "invoice_id",
          "position",
          "description",
          "quantity",
          "unit",
          "unit_price_cents",
          "net_cents",
          "tax_cents",
          "tax_key_id",
          "revenue_account_id",
          "created_at",
          "updated_at",
          "article_id",
          "detail",
          "discount"
        ],
        "additionalProperties": false
      },
      "RecurringRevision": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "recurring_invoice_id": {
            "type": "integer",
            "readOnly": true
          },
          "effective_index": {
            "type": "integer",
            "readOnly": true
          },
          "source_invoice_id": {
            "type": "integer",
            "readOnly": true
          },
          "content": {
            "$ref": "#/components/schemas/RecurringContent",
            "readOnly": true
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string"
                },
                "detail": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "quantity": {
                  "type": "number"
                },
                "unit": {
                  "type": "string"
                },
                "unit_price_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                },
                "discount": {
                  "$ref": "#/components/schemas/Discount"
                },
                "tax_key_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "revenue_account_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "cost_center_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1
                }
              },
              "required": [
                "description",
                "detail",
                "quantity",
                "unit",
                "unit_price_cents",
                "discount",
                "tax_key_id",
                "revenue_account_id"
              ],
              "additionalProperties": false
            },
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "recurring_invoice_id",
          "effective_index",
          "source_invoice_id",
          "content",
          "lines",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "RecurringCycle": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "recurring_invoice_id": {
            "type": "integer",
            "readOnly": true
          },
          "revision_id": {
            "type": "integer",
            "readOnly": true
          },
          "cycle_index": {
            "type": "integer",
            "readOnly": true
          },
          "due_on": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "service_period_from": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "service_period_to": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "failed",
              "draft",
              "skipped"
            ],
            "readOnly": true
          },
          "invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "attempts": {
            "type": "integer",
            "readOnly": true
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "recurring_invoice_id",
          "revision_id",
          "cycle_index",
          "due_on",
          "service_period_from",
          "service_period_to",
          "status",
          "invoice_id",
          "attempts",
          "error",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "RecurringInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "name": {
            "type": "string",
            "readOnly": true
          },
          "account_id": {
            "type": "integer",
            "readOnly": true
          },
          "starts_on": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "ends_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "interval_months": {
            "type": "integer",
            "enum": [
              1,
              3,
              12
            ],
            "readOnly": true
          },
          "billing_timing": {
            "type": "string",
            "enum": [
              "advance",
              "arrears"
            ],
            "readOnly": true
          },
          "mode": {
            "type": "string",
            "enum": [
              "draft"
            ],
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "paused",
              "ended"
            ],
            "readOnly": true
          },
          "next_index": {
            "type": "integer",
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecurringRevision"
            },
            "readOnly": true
          },
          "cycles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecurringCycle"
            },
            "readOnly": true
          }
        },
        "required": [
          "id",
          "name",
          "account_id",
          "starts_on",
          "ends_on",
          "interval_months",
          "billing_timing",
          "mode",
          "status",
          "next_index",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "RecurringAutomation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "recurring_invoice_id": {
            "type": "integer"
          },
          "revision_id": {
            "type": "integer"
          },
          "cycle_id": {
            "type": "integer"
          },
          "consent_id": {
            "type": "integer"
          },
          "invoice_id": {
            "type": "integer"
          },
          "draft_hash": {
            "type": "string"
          },
          "delivery_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "attempts": {
            "type": "integer"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Timestamp as text with offset"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Timestamp as text with offset"
          }
        },
        "required": [
          "id",
          "recurring_invoice_id",
          "revision_id",
          "cycle_id",
          "consent_id",
          "invoice_id",
          "draft_hash",
          "delivery_id",
          "status",
          "attempts",
          "error",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "TrialBalanceRow": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "integer",
            "minimum": 1
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "debit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "credit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "balance_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          }
        },
        "required": [
          "account_id",
          "number",
          "name",
          "type",
          "debit_cents",
          "credit_cents",
          "balance_cents"
        ],
        "additionalProperties": false
      },
      "LedgerSummary": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "integer",
            "minimum": 1
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "through": {
            "type": "string",
            "format": "date"
          },
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "minimum": 1
              },
              "number": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "personal_kind": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_active": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "number",
              "name",
              "type",
              "personal_kind",
              "is_active"
            ],
            "additionalProperties": false
          },
          "opening_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "debit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "credit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "closing_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "movement_count": {
            "type": "integer"
          }
        },
        "required": [
          "account_id",
          "from",
          "through",
          "account",
          "opening_cents",
          "debit_cents",
          "credit_cents",
          "closing_cents",
          "movement_count"
        ],
        "additionalProperties": false
      },
      "LedgerRow": {
        "type": "object",
        "properties": {
          "line_id": {
            "type": "integer",
            "minimum": 1
          },
          "account_id": {
            "type": "integer",
            "minimum": 1
          },
          "entry_id": {
            "type": "integer",
            "minimum": 1
          },
          "entry_number": {
            "type": "integer",
            "minimum": 1
          },
          "debit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "credit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "running_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "reverses_entry_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "line_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "entry_lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "line_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "account_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "number": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "debit_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "credit_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "cost_center_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "cost_center_source_line_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "cost_center_number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "cost_center_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "cost_center_active": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              },
              "required": [
                "line_id",
                "account_id",
                "number",
                "name",
                "debit_cents",
                "credit_cents"
              ],
              "additionalProperties": false
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "original_name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "sha256",
                "original_name"
              ],
              "additionalProperties": false
            }
          },
          "reversal_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "required": [
          "line_id",
          "account_id",
          "entry_id",
          "entry_number",
          "debit_cents",
          "credit_cents",
          "running_cents",
          "reverses_entry_id",
          "booking_date",
          "description",
          "line_description",
          "entry_lines",
          "documents",
          "reversal_ids"
        ],
        "additionalProperties": false
      },
      "LedgerMetadata": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "string",
            "enum": [
              "summator-ledger/1",
              "summator-ledger/2",
              "summator-ledger/3",
              "summator-ledger/4"
            ]
          },
          "audit_visible_ranges": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "integer"
              },
              "minItems": 2,
              "maxItems": 2
            }
          },
          "tenant_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ledger",
              "trial_balance"
            ]
          },
          "audit_cutoff": {
            "type": "integer"
          },
          "options": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "integer",
                "minimum": 1
              },
              "from": {
                "type": "string",
                "format": "date"
              },
              "through": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "through"
            ],
            "additionalProperties": false
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "unit": {
            "type": "string",
            "enum": [
              "EUR cent"
            ]
          },
          "drafts_excluded": {
            "type": "boolean"
          },
          "opening_basis": {
            "type": "string"
          },
          "summary": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LedgerSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "row_count": {
            "type": "integer"
          },
          "rows_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "csv_prefix": {
            "type": "string"
          },
          "html_prefix": {
            "type": "string"
          },
          "html_suffix": {
            "type": "string"
          },
          "opening_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        },
        "required": [
          "contract",
          "tenant_id",
          "kind",
          "audit_cutoff",
          "options",
          "generated_at",
          "unit",
          "drafts_excluded",
          "opening_basis",
          "summary",
          "row_count",
          "rows_hash",
          "csv_prefix",
          "html_prefix",
          "html_suffix"
        ],
        "additionalProperties": false
      },
      "ArchiveSummary": {
        "type": "object",
        "properties": {
          "schema_version": {
            "type": "string"
          },
          "options": {
            "type": "object",
            "properties": {
              "fiscal_year_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "fiscal_year_id"
            ],
            "additionalProperties": false
          },
          "focus": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "year": {
                    "type": "integer"
                  },
                  "from": {
                    "type": "string",
                    "format": "date"
                  },
                  "to": {
                    "type": "string",
                    "format": "date"
                  },
                  "journal_entries": {
                    "type": "integer"
                  },
                  "posted_journal_cents": {
                    "type": "object",
                    "properties": {
                      "debit_cents": {
                        "type": "string",
                        "pattern": "^-?[0-9]+$"
                      },
                      "credit_cents": {
                        "type": "string",
                        "pattern": "^-?[0-9]+$"
                      }
                    },
                    "required": [
                      "debit_cents",
                      "credit_cents"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "year",
                  "from",
                  "to",
                  "journal_entries",
                  "posted_journal_cents"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "row_count": {
            "type": "integer"
          },
          "estimated_bytes": {
            "type": "integer"
          },
          "groups": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "totals_cents": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                }
              }
            }
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "inventory": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "classification": {
                  "type": "string"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source_columns": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SourceJson"
                  }
                },
                "source_indexes": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SourceJson"
                  }
                },
                "foreign_keys": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SourceJson"
                  }
                }
              },
              "required": [
                "name",
                "classification",
                "reason"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "schema_version",
          "options",
          "focus",
          "fingerprint",
          "counts",
          "row_count",
          "estimated_bytes",
          "groups",
          "totals_cents",
          "findings",
          "inventory"
        ],
        "additionalProperties": false
      },
      "ArchivePackage": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid"
          },
          "id": {
            "type": "integer"
          },
          "tenant_id": {
            "type": "string"
          },
          "created_by": {
            "type": "integer"
          },
          "request_key": {
            "type": "string",
            "format": "uuid"
          },
          "options": {
            "type": "object",
            "properties": {
              "fiscal_year_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "fiscal_year_id"
            ],
            "additionalProperties": false
          },
          "fingerprint": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "building",
              "ready",
              "failed",
              "expired"
            ]
          },
          "summary": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ArchiveSummary"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SourceJson"
                },
                "maxItems": 0
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "uuid",
          "id",
          "tenant_id",
          "created_by",
          "request_key",
          "options",
          "fingerprint",
          "status",
          "summary",
          "error",
          "sha256",
          "size_bytes",
          "started_at",
          "expires_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Source_accounts": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "number": {
            "type": "string",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "readOnly": true
          },
          "is_active": {
            "type": "boolean",
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "category_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "personal_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "vat_box": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "vat_reportable": {
            "type": "boolean",
            "readOnly": true
          },
          "type": {
            "type": "string",
            "enum": [
              "asset",
              "liability",
              "equity",
              "revenue",
              "expense"
            ],
            "readOnly": true
          },
          "chart": {
            "type": "string",
            "enum": [
              "SKR03",
              "SKR04"
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "is_active",
          "created_at",
          "updated_at",
          "category",
          "category_code",
          "personal_kind",
          "vat_box",
          "vat_reportable",
          "type",
          "chart"
        ],
        "additionalProperties": false
      },
      "Source_tax_keys": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "code": {
            "type": "string",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "readOnly": true
          },
          "rate_bp": {
            "type": "integer",
            "readOnly": true
          },
          "account_id": {
            "type": [
              "integer",
              "null"
            ],
            "readOnly": true
          },
          "is_active": {
            "type": "boolean",
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "counter_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "vat_box": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "direction": {
            "type": "string",
            "enum": [
              "input",
              "output",
              "reverse_charge",
              "not_taxable"
            ],
            "readOnly": true
          },
          "chart": {
            "type": "string",
            "enum": [
              "SKR03",
              "SKR04"
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "rate_bp",
          "account_id",
          "is_active",
          "created_at",
          "updated_at",
          "counter_account_id",
          "vat_box",
          "category",
          "direction",
          "chart"
        ],
        "additionalProperties": false
      },
      "Source_journal_lines": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "journal_entry_id": {
            "type": "integer",
            "readOnly": true
          },
          "account_id": {
            "type": "integer",
            "readOnly": true
          },
          "debit_cents": {
            "type": "integer",
            "readOnly": true
          },
          "credit_cents": {
            "type": "integer",
            "readOnly": true
          },
          "position": {
            "type": "integer",
            "readOnly": true
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "cost_center_source_line_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "id",
          "journal_entry_id",
          "account_id",
          "debit_cents",
          "credit_cents",
          "position",
          "description",
          "created_at",
          "updated_at",
          "tax_key_id"
        ],
        "additionalProperties": false
      },
      "Source_documents": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "original_name": {
            "type": "string",
            "readOnly": true
          },
          "mime_type": {
            "type": "string",
            "readOnly": true
          },
          "size_bytes": {
            "type": "integer",
            "readOnly": true
          },
          "sha256": {
            "type": "string",
            "readOnly": true
          },
          "path": {
            "type": "string",
            "readOnly": true
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "received_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          },
          "uploaded_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "locked_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "seal_on_post": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "required": [
          "id",
          "original_name",
          "mime_type",
          "size_bytes",
          "sha256",
          "path",
          "document_date",
          "note",
          "received_at",
          "uploaded_by",
          "locked_at",
          "created_at",
          "updated_at",
          "seal_on_post"
        ],
        "additionalProperties": false
      },
      "Source_document_links": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "document_id": {
            "type": "integer",
            "readOnly": true
          },
          "journal_entry_id": {
            "type": "integer",
            "readOnly": true
          },
          "linked_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          },
          "linked_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "document_id",
          "journal_entry_id",
          "linked_at",
          "linked_by"
        ],
        "additionalProperties": false
      },
      "Source_fiscal_years": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "year": {
            "type": "integer",
            "readOnly": true
          },
          "starts_on": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "ends_on": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "year",
          "starts_on",
          "ends_on",
          "closed_at",
          "created_at",
          "updated_at",
          "status"
        ],
        "additionalProperties": false
      },
      "Source_payment_allocations": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "account_id": {
            "type": "integer",
            "readOnly": true
          },
          "invoice_line_id": {
            "type": "integer",
            "readOnly": true
          },
          "payment_line_id": {
            "type": "integer",
            "readOnly": true
          },
          "amount_cents": {
            "type": "integer",
            "readOnly": true
          },
          "allocated_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          },
          "allocated_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "account_id",
          "invoice_line_id",
          "payment_line_id",
          "amount_cents",
          "allocated_at",
          "allocated_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Source_euer_revisions": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "report_year": {
            "type": "integer",
            "readOnly": true
          },
          "kind": {
            "type": "string",
            "readOnly": true
          },
          "source_key": {
            "type": "string",
            "readOnly": true
          },
          "supersedes_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "payload": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "source_hash": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "row": {
                          "type": "string",
                          "enum": [
                            "revenue",
                            "output_vat",
                            "vat_refund",
                            "goods",
                            "staff",
                            "rent",
                            "other",
                            "input_vat",
                            "vat_paid",
                            "depreciation",
                            "excluded"
                          ]
                        },
                        "cents": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "row",
                        "cents"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "source_hash",
                  "rows"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "account_number": {
                    "type": "string"
                  },
                  "chart": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "account_id",
                  "account_number",
                  "chart",
                  "role"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "rows": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "row": {
                          "type": "string",
                          "enum": [
                            "revenue",
                            "output_vat",
                            "vat_refund",
                            "goods",
                            "staff",
                            "rent",
                            "other",
                            "input_vat",
                            "vat_paid",
                            "depreciation",
                            "excluded"
                          ]
                        },
                        "cents": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "row",
                        "cents"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "rows"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "description": "Hebt die vorige Fassung derselben Klärung auf.",
                "properties": {
                  "withdrawn": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "withdrawn"
                ],
                "additionalProperties": false
              }
            ],
            "readOnly": true
          },
          "reason": {
            "type": "string",
            "readOnly": true
          },
          "origin": {
            "type": "string",
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          }
        },
        "required": [
          "id",
          "report_year",
          "kind",
          "source_key",
          "supersedes_id",
          "payload",
          "reason",
          "origin",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Source_guv_revisions": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "report_uuid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "account_id": {
            "type": "integer",
            "readOnly": true
          },
          "account_hash": {
            "type": "string",
            "readOnly": true
          },
          "row_key": {
            "type": "string",
            "readOnly": true
          },
          "supersedes_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "reason": {
            "type": "string",
            "readOnly": true
          },
          "origin": {
            "type": "string",
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          }
        },
        "required": [
          "id",
          "report_uuid",
          "account_id",
          "account_hash",
          "row_key",
          "supersedes_id",
          "reason",
          "origin",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Source_settlement_skonto_groups": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "payment_allocation_id": {
            "type": "integer",
            "readOnly": true
          },
          "invoice_entry_id": {
            "type": "integer",
            "readOnly": true
          },
          "payment_entry_id": {
            "type": "integer",
            "readOnly": true
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "discount_account_id": {
            "type": "integer",
            "readOnly": true
          },
          "tax_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "plan": {
            "type": "object",
            "properties": {
              "rule": {
                "type": "string"
              },
              "group": {
                "$ref": "#/components/schemas/SettlementSkontoGroup"
              }
            },
            "required": [
              "rule",
              "group"
            ],
            "additionalProperties": false,
            "readOnly": true
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          }
        },
        "required": [
          "id",
          "payment_allocation_id",
          "invoice_entry_id",
          "payment_entry_id",
          "tax_key_id",
          "discount_account_id",
          "tax_account_id",
          "plan",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Source_taxation_periods": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "valid_from": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "taxation": {
            "type": "string",
            "readOnly": true
          },
          "basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "automatic": {
            "type": "boolean",
            "readOnly": true
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "decided_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          },
          "decided_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "valid_from",
          "taxation",
          "basis",
          "automatic",
          "note",
          "decided_at",
          "decided_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Source_vat_filing_periods": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "valid_from": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "frequency": {
            "type": "string",
            "readOnly": true
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "decided_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          },
          "decided_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "valid_from",
          "frequency",
          "note",
          "decided_at",
          "decided_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Source_journal_entries": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fiscal_year_id": {
            "type": "integer",
            "readOnly": true
          },
          "document_date": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "booking_date": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "recorded_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "description": {
            "type": "string",
            "readOnly": true
          },
          "reverses_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_journal_lines"
            },
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "posted"
            ],
            "readOnly": true
          },
          "year_end_closure_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "year_end_kind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "closing",
              "opening",
              "closing_reversal",
              "opening_reversal",
              null
            ]
          },
          "year_end_position": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fx_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fx_amount_cents": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent in der Belegwährung"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fx_units_per_eur": {
            "anyOf": [
              {
                "type": "string",
                "description": "Dezimalzahl als Text, Einheiten der Belegwährung je Euro"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fx_rate_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fx_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fx_rate_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fx_source_sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fx_groups": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fx_service_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "entry_number",
          "fiscal_year_id",
          "document_date",
          "booking_date",
          "recorded_at",
          "posted_at",
          "description",
          "reverses_entry_id",
          "created_by",
          "created_at",
          "updated_at",
          "lines",
          "status"
        ],
        "additionalProperties": false
      },
      "EuerSource": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "company": {
            "type": "object",
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "chart": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "legal_form": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxation": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "small_business": {
                "type": "boolean"
              }
            },
            "required": [
              "chart",
              "legal_form",
              "taxation",
              "small_business"
            ],
            "additionalProperties": false
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_journal_entries"
            }
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_accounts"
            }
          },
          "skonto_groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_settlement_skonto_groups"
            }
          },
          "document_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_document_links"
            }
          },
          "chart": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_tax_keys"
            }
          },
          "allocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_payment_allocations"
            }
          },
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_euer_revisions"
            }
          },
          "bank_feed_account_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Sachkonten der Bankkonten ohne Zahlungsdienst. Fehlt in eingefrorenen Berichten von vor dieser Regel."
          },
          "payment_service_account_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Sachkonten der Zahlungsdienste. Fehlt in eingefrorenen Berichten von vor dieser Regel."
          },
          "asset_entry_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Buchungen des Anlagenbuchs, die als AfA zählen, samt Storno. Fehlt in eingefrorenen Berichten von vor dieser Regel."
          },
          "fx_context": {
            "type": "object",
            "description": "Nur vorhanden, wenn der Bericht USD-Rechnungen oder ihre Zahlungen enthält.",
            "properties": {
              "contract": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "scope": {
                "type": "string"
              },
              "invoices": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "journal_entry_id": {
                      "type": "integer"
                    },
                    "document_id": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reverses_invoice_id": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "currency": {
                      "type": "string"
                    },
                    "fx_terms": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fx_snapshot": {
                      "anyOf": [
                        {
                          "type": "object",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "journal_entry_id",
                    "document_id",
                    "reverses_invoice_id",
                    "currency",
                    "fx_terms",
                    "fx_snapshot"
                  ],
                  "additionalProperties": false
                }
              },
              "settlements": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Source_fx_settlements"
                }
              }
            },
            "required": [
              "contract",
              "unit",
              "scope",
              "invoices",
              "settlements"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "tenant_id",
          "company",
          "entries",
          "accounts",
          "document_links",
          "chart",
          "tax_keys",
          "allocations",
          "revisions"
        ],
        "additionalProperties": false
      },
      "EuerSnapshot": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "enum": [
              2025,
              2026,
              2027
            ]
          },
          "rule_version": {
            "type": "string"
          },
          "rule_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "checked_on": {
            "type": "string",
            "format": "date"
          },
          "scope": {
            "type": "string"
          },
          "row_labels": {
            "type": "object",
            "properties": {
              "revenue": {
                "type": "string"
              },
              "output_vat": {
                "type": "string"
              },
              "vat_refund": {
                "type": "string"
              },
              "goods": {
                "type": "string"
              },
              "staff": {
                "type": "string"
              },
              "rent": {
                "type": "string"
              },
              "other": {
                "type": "string"
              },
              "input_vat": {
                "type": "string"
              },
              "vat_paid": {
                "type": "string"
              },
              "depreciation": {
                "type": "string"
              },
              "excluded": {
                "type": "string"
              }
            },
            "required": [
              "revenue",
              "output_vat",
              "vat_refund",
              "goods",
              "staff",
              "rent",
              "other",
              "input_vat",
              "vat_paid",
              "depreciation",
              "excluded"
            ],
            "additionalProperties": false
          },
          "legal_sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "basis": {
                  "type": "string"
                }
              },
              "required": [
                "url",
                "basis"
              ],
              "additionalProperties": false
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "revenue": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "output_vat": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "vat_refund": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "goods": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "staff": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "rent": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "other": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "input_vat": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "vat_paid": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "depreciation": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "excluded": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              }
            },
            "required": [
              "revenue",
              "output_vat",
              "vat_refund",
              "goods",
              "staff",
              "rent",
              "other",
              "input_vat",
              "vat_paid",
              "depreciation",
              "excluded"
            ],
            "additionalProperties": false
          },
          "income_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "expense_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "result_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "status": {
            "type": "string",
            "enum": [
              "needs_review",
              "within_supported_scope"
            ]
          },
          "blocking_cases": {
            "type": "integer"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "payment_date": {
                  "type": "string",
                  "format": "date"
                },
                "payment_entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "invoice_entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": {
                  "type": "string"
                },
                "rows": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "row": {
                        "type": "string",
                        "enum": [
                          "revenue",
                          "output_vat",
                          "vat_refund",
                          "goods",
                          "staff",
                          "rent",
                          "other",
                          "input_vat",
                          "vat_paid",
                          "depreciation",
                          "excluded"
                        ]
                      },
                      "cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "line_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "account_number": {
                        "type": "string"
                      },
                      "tax_key_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "skonto_group_id": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "required": [
                      "row",
                      "cents"
                    ],
                    "additionalProperties": false
                  }
                },
                "issues": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "payment": {
                  "$ref": "#/components/schemas/Source_journal_entries"
                },
                "invoice": {
                  "$ref": "#/components/schemas/Source_journal_entries"
                },
                "allocation": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Source_payment_allocations"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "carried_asset_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "prior_lines": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Source_journal_lines"
                  }
                },
                "source_hash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "original_rows": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "row": {
                        "type": "string",
                        "enum": [
                          "revenue",
                          "output_vat",
                          "vat_refund",
                          "goods",
                          "staff",
                          "rent",
                          "other",
                          "input_vat",
                          "vat_paid",
                          "depreciation",
                          "excluded"
                        ]
                      },
                      "cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "line_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "account_number": {
                        "type": "string"
                      },
                      "tax_key_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "skonto_group_id": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "required": [
                      "row",
                      "cents"
                    ],
                    "additionalProperties": false
                  }
                },
                "resolved_issues": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "revision": {
                  "$ref": "#/components/schemas/Source_euer_revisions"
                },
                "report_year": {
                  "type": "integer"
                },
                "included": {
                  "type": "boolean"
                },
                "fx": {
                  "$ref": "#/components/schemas/Source_fx_settlements"
                }
              },
              "required": [
                "key",
                "rows",
                "issues",
                "report_year",
                "included"
              ],
              "additionalProperties": false
            }
          },
          "notices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "unpaid",
                    "orphaned_resolution",
                    "duplicate_resolution",
                    "depreciation_two_sources",
                    "asset_resolution"
                  ]
                },
                "entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "line_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "open_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "cents": {
                  "type": "integer",
                  "description": "Nur bei `depreciation_two_sources`: AfA aus Klärung und Ergänzung, ganzzahlige Cent."
                },
                "blocking": {
                  "type": "boolean"
                },
                "source_key": {
                  "type": "string",
                  "description": "Nur bei `orphaned_resolution`, `duplicate_resolution` und `asset_resolution`: der Vorgang der gemeldeten Klärung."
                },
                "rows": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "row": {
                        "type": "string",
                        "enum": [
                          "revenue",
                          "output_vat",
                          "vat_refund",
                          "goods",
                          "staff",
                          "rent",
                          "other",
                          "input_vat",
                          "vat_paid",
                          "depreciation",
                          "excluded"
                        ]
                      },
                      "cents": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "row",
                      "cents"
                    ],
                    "additionalProperties": false
                  },
                  "description": "Nur bei `orphaned_resolution`, `duplicate_resolution` und `asset_resolution`: die Anteile der gemeldeten Klärung."
                },
                "reason": {
                  "type": "string",
                  "description": "Nur bei `orphaned_resolution`, `duplicate_resolution` und `asset_resolution`: die Begründung der Klärung."
                },
                "also_in": {
                  "type": "array",
                  "description": "Nur bei `duplicate_resolution`: die Klärungen derselben Zahlung in anderen Jahren.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "source_key": {
                        "type": "string"
                      },
                      "report_year": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "source_key",
                      "report_year"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "code",
                "blocking"
              ],
              "additionalProperties": false
            }
          },
          "source": {
            "$ref": "#/components/schemas/EuerSource"
          },
          "tenant_id": {
            "type": "string"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "year",
          "rule_version",
          "rule_hash",
          "checked_on",
          "scope",
          "row_labels",
          "legal_sources",
          "totals",
          "income_cents",
          "expense_cents",
          "result_cents",
          "status",
          "blocking_cases",
          "events",
          "notices",
          "source",
          "tenant_id",
          "generated_at"
        ],
        "additionalProperties": false
      },
      "EuerReport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "snapshot_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "stale": {
            "type": "boolean"
          },
          "snapshot": {
            "$ref": "#/components/schemas/EuerSnapshot"
          }
        },
        "required": [
          "id",
          "snapshot_hash",
          "source_hash",
          "stale",
          "snapshot"
        ],
        "additionalProperties": false
      },
      "GuvSource": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "company": {
            "type": "object",
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "chart": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "legal_form": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxation": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "small_business": {
                "type": "boolean"
              }
            },
            "required": [
              "chart",
              "legal_form",
              "taxation",
              "small_business"
            ],
            "additionalProperties": false
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_journal_entries"
            }
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_accounts"
            }
          },
          "skonto_groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_settlement_skonto_groups"
            }
          },
          "document_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_document_links"
            }
          },
          "fiscal_years": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_fiscal_years"
            }
          },
          "draft_notices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "booking_date": {
                  "type": "string",
                  "format": "date"
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "entry_id",
                "booking_date",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_guv_revisions"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_documents"
            }
          }
        },
        "required": [
          "tenant_id",
          "company",
          "entries",
          "accounts",
          "skonto_groups",
          "document_links",
          "fiscal_years",
          "draft_notices",
          "revisions",
          "documents"
        ],
        "additionalProperties": false
      },
      "GuvCalculation": {
        "type": "object",
        "properties": {
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "totals": {
            "type": "object",
            "properties": {
              "sales": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "inventory": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "own_work": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "other_income": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "materials": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "services": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "wages": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "social": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "depreciation": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "current_depreciation": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "other_expense": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "participation_income": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "securities_income": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "interest_income": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "financial_depreciation": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "interest_expense": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "income_tax": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "other_tax": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              }
            },
            "required": [
              "sales",
              "other_income",
              "materials",
              "services",
              "wages",
              "social",
              "depreciation",
              "other_expense",
              "interest_income",
              "interest_expense",
              "income_tax",
              "other_tax"
            ],
            "additionalProperties": false
          },
          "income_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "expense_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "operating_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "before_tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "after_tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "result_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "journal_result_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "unmapped_result_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "unmapped_accounts": {
            "type": "integer"
          },
          "draft_entry_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "missing_original_entry_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "incomplete",
              "provisional"
            ]
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "number": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "row": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "classification": {
                  "type": "string",
                  "enum": [
                    "included",
                    "unmapped",
                    "balance"
                  ]
                },
                "cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "result_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "lines": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "line_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "entry_number": {
                        "anyOf": [
                          {
                            "type": "integer"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "booking_date": {
                        "type": "string",
                        "format": "date"
                      },
                      "description": {
                        "type": "string"
                      },
                      "reverses_entry_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "debit_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "credit_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "result_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      }
                    },
                    "required": [
                      "line_id",
                      "entry_id",
                      "entry_number",
                      "booking_date",
                      "description",
                      "reverses_entry_id",
                      "debit_cents",
                      "credit_cents",
                      "result_cents"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "account_id",
                "number",
                "name",
                "type",
                "row",
                "classification",
                "cents",
                "result_cents",
                "lines"
              ],
              "additionalProperties": false
            }
          },
          "raw_journal_result_cents": {
            "type": "integer"
          },
          "excluded_result_cents": {
            "type": "integer"
          },
          "excluded_lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1,
                  "readOnly": true
                },
                "journal_entry_id": {
                  "type": "integer",
                  "readOnly": true
                },
                "account_id": {
                  "type": "integer",
                  "readOnly": true
                },
                "debit_cents": {
                  "type": "integer",
                  "readOnly": true
                },
                "credit_cents": {
                  "type": "integer",
                  "readOnly": true
                },
                "position": {
                  "type": "integer",
                  "readOnly": true
                },
                "description": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "readOnly": true
                },
                "created_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "Zeitstempel als Text mit Zeitzonenoffset."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "readOnly": true
                },
                "updated_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "Zeitstempel als Text mit Zeitzonenoffset."
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "readOnly": true
                },
                "tax_key_id": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "readOnly": true
                },
                "entry_id": {
                  "type": "integer"
                },
                "year_end_kind": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "closing",
                    "opening",
                    "closing_reversal",
                    "opening_reversal",
                    null
                  ]
                },
                "year_end_closure_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "result_cents": {
                  "type": "integer"
                },
                "cost_center_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1
                },
                "cost_center_source_line_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1
                }
              },
              "required": [
                "id",
                "journal_entry_id",
                "account_id",
                "debit_cents",
                "credit_cents",
                "position",
                "description",
                "created_at",
                "updated_at",
                "tax_key_id",
                "entry_id",
                "year_end_kind",
                "year_end_closure_id",
                "result_cents"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "period",
          "totals",
          "income_cents",
          "expense_cents",
          "operating_cents",
          "before_tax_cents",
          "result_cents",
          "journal_result_cents",
          "unmapped_result_cents",
          "unmapped_accounts",
          "draft_entry_ids",
          "missing_original_entry_ids",
          "status",
          "accounts"
        ],
        "additionalProperties": false
      },
      "GuvSnapshot": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "rule_version": {
            "type": "string"
          },
          "rule_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "scope": {
            "type": "string"
          },
          "legal_sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "checked_on": {
            "type": "string",
            "format": "date"
          },
          "row_labels": {
            "type": "object",
            "properties": {
              "sales": {
                "type": "string"
              },
              "inventory": {
                "type": "string"
              },
              "own_work": {
                "type": "string"
              },
              "other_income": {
                "type": "string"
              },
              "materials": {
                "type": "string"
              },
              "services": {
                "type": "string"
              },
              "wages": {
                "type": "string"
              },
              "social": {
                "type": "string"
              },
              "depreciation": {
                "type": "string"
              },
              "current_depreciation": {
                "type": "string"
              },
              "other_expense": {
                "type": "string"
              },
              "participation_income": {
                "type": "string"
              },
              "securities_income": {
                "type": "string"
              },
              "interest_income": {
                "type": "string"
              },
              "financial_depreciation": {
                "type": "string"
              },
              "interest_expense": {
                "type": "string"
              },
              "income_tax": {
                "type": "string"
              },
              "other_tax": {
                "type": "string"
              }
            },
            "required": [
              "sales",
              "other_income",
              "materials",
              "services",
              "wages",
              "social",
              "depreciation",
              "other_expense",
              "interest_income",
              "interest_expense",
              "income_tax",
              "other_tax"
            ],
            "additionalProperties": false
          },
          "row_order": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sales",
                "inventory",
                "own_work",
                "other_income",
                "materials",
                "services",
                "wages",
                "social",
                "depreciation",
                "current_depreciation",
                "other_expense",
                "participation_income",
                "securities_income",
                "interest_income",
                "financial_depreciation",
                "interest_expense",
                "income_tax",
                "other_tax"
              ]
            }
          },
          "locale": {
            "type": "string"
          },
          "options": {
            "type": "object",
            "properties": {
              "current": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "format": "date"
                  },
                  "to": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "from",
                  "to"
                ],
                "additionalProperties": false
              },
              "compare": {
                "type": "string",
                "enum": [
                  "none",
                  "previous_year",
                  "previous_period"
                ]
              },
              "comparison": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string",
                        "format": "date"
                      },
                      "to": {
                        "type": "string",
                        "format": "date"
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "current",
              "compare",
              "comparison"
            ],
            "additionalProperties": false
          },
          "source": {
            "$ref": "#/components/schemas/GuvSource"
          },
          "current": {
            "$ref": "#/components/schemas/GuvCalculation"
          },
          "comparison": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GuvCalculation"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "tenant_id",
          "generated_at",
          "rule_version",
          "rule_hash",
          "scope",
          "legal_sources",
          "checked_on",
          "row_labels",
          "row_order",
          "locale",
          "options",
          "source",
          "current",
          "comparison"
        ],
        "additionalProperties": false
      },
      "GuvReport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "snapshot_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "stale": {
            "type": "boolean"
          },
          "snapshot": {
            "$ref": "#/components/schemas/GuvSnapshot"
          }
        },
        "required": [
          "id",
          "source_hash",
          "snapshot_hash",
          "stale",
          "snapshot"
        ],
        "additionalProperties": false
      },
      "DatevPreview": {
        "type": "object",
        "properties": {
          "profile": {
            "type": "string"
          },
          "options": {
            "type": "object",
            "properties": {
              "fiscal_year_id": {
                "type": "integer",
                "minimum": 1
              },
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              },
              "advisor": {
                "type": "integer",
                "minimum": 1001,
                "maximum": 9999999
              },
              "client": {
                "type": "integer",
                "minimum": 1,
                "maximum": 99999
              },
              "account_length": {
                "type": "integer",
                "minimum": 4,
                "maximum": 8
              },
              "account_modes": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "manual",
                            "automatic700",
                            "automatic1900"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "manual",
                            "automatic700",
                            "automatic1900"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "maxItems": 0
                  }
                ]
              }
            },
            "required": [
              "fiscal_year_id",
              "from",
              "to",
              "advisor",
              "client",
              "account_length",
              "account_modes"
            ],
            "additionalProperties": false
          },
          "chart": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "taxation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "year": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "minimum": 1
              },
              "starts_on": {
                "type": "string",
                "format": "date"
              },
              "ends_on": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "id",
              "starts_on",
              "ends_on"
            ],
            "additionalProperties": false
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "entry_number": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "fiscal_year_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": {
                  "type": "string"
                },
                "reverses_entry_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "posted_at": {
                  "type": "string"
                },
                "document_date": {
                  "type": "string",
                  "format": "date"
                },
                "booking_date": {
                  "type": "string",
                  "format": "date"
                },
                "reference": {
                  "type": "string"
                },
                "lines": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "tax_key_id": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "debit_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "credit_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "position": {
                        "type": "integer"
                      },
                      "description": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "cost_center_id": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1
                      },
                      "cost_center_source_line_id": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1
                      }
                    },
                    "required": [
                      "id",
                      "account_id",
                      "tax_key_id",
                      "debit_cents",
                      "credit_cents",
                      "position",
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "document_ids": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "text_shortened": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "entry_number",
                "fiscal_year_id",
                "description",
                "reverses_entry_id",
                "posted_at",
                "document_date",
                "booking_date",
                "reference",
                "lines",
                "document_ids"
              ],
              "additionalProperties": false
            }
          },
          "accounts": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "number": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "chart": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "personal_kind": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "contact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "street": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "postal_code": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "city": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "country": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "vat_id": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "street",
                            "postal_code",
                            "city",
                            "country",
                            "email",
                            "vat_id"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "number",
                    "name",
                    "chart",
                    "type",
                    "personal_kind",
                    "contact"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SourceJson"
                },
                "maxItems": 0
              }
            ]
          },
          "documents": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "original_name": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "path": {
                      "type": "string"
                    },
                    "size_bytes": {
                      "type": "integer"
                    },
                    "mime_type": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "original_name",
                    "sha256",
                    "path",
                    "size_bytes",
                    "mime_type"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SourceJson"
                },
                "maxItems": 0
              }
            ]
          },
          "bookings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "account": {
                  "type": "string"
                },
                "contra": {
                  "type": "string"
                },
                "gross_cents": {
                  "type": "integer"
                },
                "net_cents": {
                  "type": "integer"
                },
                "tax_cents": {
                  "type": "integer"
                },
                "tax_account": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "rate_bp": {
                  "type": "integer"
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "S",
                    "H"
                  ]
                },
                "bu": {
                  "type": [
                    "string",
                    "integer",
                    "null"
                  ]
                },
                "document_date": {
                  "type": "string",
                  "pattern": "^[0-9]{4}$"
                },
                "reference": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "entry_id",
                "account",
                "contra",
                "gross_cents",
                "net_cents",
                "tax_cents",
                "tax_account",
                "rate_bp",
                "side",
                "bu",
                "document_date",
                "reference",
                "text"
              ],
              "additionalProperties": false
            }
          },
          "totals": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "debit_cents": {
                      "type": "integer",
                      "description": "Ganzzahlige Cent"
                    },
                    "credit_cents": {
                      "type": "integer",
                      "description": "Ganzzahlige Cent"
                    }
                  },
                  "required": [
                    "debit_cents",
                    "credit_cents"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SourceJson"
                },
                "maxItems": 0
              }
            ]
          },
          "tax_keys": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Source_tax_keys"
                }
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SourceJson"
                },
                "maxItems": 0
              }
            ]
          },
          "payment_allocations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "invoice_line_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "payment_line_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "amount_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "invoice_entry_number": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "payment_entry_id": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "required": [
                "id",
                "invoice_line_id",
                "payment_line_id",
                "amount_cents",
                "invoice_entry_number",
                "payment_entry_id"
              ],
              "additionalProperties": false
            }
          },
          "draft_count": {
            "type": "integer"
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "generated_at": {
            "type": "string",
            "pattern": "^[0-9]{17}$"
          },
          "overlaps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "limits": {
            "type": "string"
          },
          "obstacles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "entry_count": {
            "type": "integer"
          },
          "document_count": {
            "type": "integer"
          },
          "booking_count": {
            "type": "integer"
          },
          "fx_documents": {
            "type": "object",
            "description": "Nur vorhanden, wenn der Zeitraum Buchungen aus Fremdwährungsbelegen oder deren Kursausgleiche enthält.",
            "additionalProperties": true
          }
        },
        "required": [
          "profile",
          "options",
          "chart",
          "taxation",
          "year",
          "sources",
          "accounts",
          "documents",
          "bookings",
          "totals",
          "tax_keys",
          "payment_allocations",
          "draft_count",
          "fingerprint",
          "generated_at",
          "overlaps",
          "limits",
          "obstacles",
          "entry_count",
          "document_count",
          "booking_count"
        ],
        "additionalProperties": false
      },
      "DatevPackageStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "building",
              "ready",
              "failed"
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "download_path": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "external_acceptance": {
            "type": "string",
            "enum": [
              "not_verified"
            ]
          },
          "downloaded": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "status",
          "error",
          "fingerprint",
          "sha256",
          "download_path",
          "expires_at",
          "external_acceptance",
          "downloaded"
        ],
        "additionalProperties": false
      },
      "AssetPeriod": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}$"
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "book_after_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          }
        },
        "required": [
          "period",
          "booking_date",
          "amount_cents",
          "book_after_cents"
        ],
        "additionalProperties": false
      },
      "AssetSnapshot": {
        "type": "object",
        "properties": {
          "parameters": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 200
              },
              "origin": {
                "type": "string",
                "enum": [
                  "new",
                  "linked",
                  "opening"
                ]
              },
              "acquired_on": {
                "type": "string",
                "format": "date"
              },
              "commissioned_on": {
                "type": "string",
                "format": "date"
              },
              "opening_on": {
                "type": "string",
                "format": "date"
              },
              "cost_cents": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000000000
              },
              "prior_depreciation_cents": {
                "type": "integer",
                "minimum": 0
              },
              "opening_book_cents": {
                "type": "integer",
                "minimum": 1
              },
              "useful_years": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "method": {
                "type": "string",
                "enum": [
                  "linear"
                ]
              },
              "profile": {
                "type": "string",
                "enum": [
                  "movable-common-basis"
                ]
              },
              "asset_account_id": {
                "type": "integer",
                "minimum": 1
              },
              "expense_account_id": {
                "type": "integer",
                "minimum": 1
              },
              "document_id": {
                "type": "integer",
                "minimum": 1
              },
              "acquisition_entry_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "counter_account_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "supersedes_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "basis_reason": {
                "type": "string",
                "minLength": 10,
                "maxLength": 2000
              }
            },
            "required": [
              "name",
              "origin",
              "acquired_on",
              "commissioned_on",
              "opening_on",
              "cost_cents",
              "prior_depreciation_cents",
              "opening_book_cents",
              "useful_years",
              "method",
              "profile",
              "asset_account_id",
              "expense_account_id",
              "document_id",
              "acquisition_entry_id",
              "counter_account_id",
              "supersedes_id",
              "basis_reason"
            ],
            "additionalProperties": false
          },
          "rule": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              },
              "source": {
                "type": "string"
              },
              "source_sha256": {
                "type": "string"
              },
              "checked_on": {
                "type": "string"
              },
              "rounding": {
                "type": "string"
              },
              "limits": {
                "type": "string"
              }
            },
            "required": [
              "version",
              "source",
              "source_sha256",
              "checked_on",
              "rounding",
              "limits"
            ],
            "additionalProperties": false
          },
          "periods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetPeriod"
            }
          },
          "sources": {
            "type": "object",
            "properties": {
              "asset_account": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "number": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "chart": {
                    "type": "string"
                  },
                  "category_code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "number",
                  "name",
                  "type",
                  "chart",
                  "category_code"
                ],
                "additionalProperties": false
              },
              "expense_account": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "number": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "chart": {
                    "type": "string"
                  },
                  "category_code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "number",
                  "name",
                  "type",
                  "chart",
                  "category_code"
                ],
                "additionalProperties": false
              },
              "document": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "sha256": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                },
                "required": [
                  "id",
                  "sha256"
                ],
                "additionalProperties": false
              },
              "counter_account": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "number": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "chart": {
                    "type": "string"
                  },
                  "category_code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "number",
                  "name",
                  "type",
                  "chart",
                  "category_code"
                ],
                "additionalProperties": false
              },
              "entry": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "entry_number": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "booking_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "account_id": {
                          "type": "integer"
                        },
                        "debit_cents": {
                          "type": "integer"
                        },
                        "credit_cents": {
                          "type": "integer"
                        },
                        "position": {
                          "type": "integer"
                        },
                        "description": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "tax_key_id": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cost_center_id": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1
                        },
                        "cost_center_source_line_id": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1
                        }
                      },
                      "required": [
                        "id",
                        "account_id",
                        "debit_cents",
                        "credit_cents",
                        "position",
                        "description",
                        "tax_key_id"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "id",
                  "entry_number",
                  "booking_date",
                  "lines"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "asset_account",
              "expense_account",
              "document"
            ],
            "additionalProperties": false
          },
          "tenant_id": {
            "type": "string"
          }
        },
        "required": [
          "parameters",
          "rule",
          "periods",
          "sources",
          "tenant_id"
        ],
        "additionalProperties": false
      },
      "FixedAsset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "uuid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "tenant_id": {
            "type": "string",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "readOnly": true
          },
          "origin": {
            "type": "string",
            "enum": [
              "new",
              "linked",
              "opening"
            ],
            "readOnly": true
          },
          "acquired_on": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "commissioned_on": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "opening_on": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "cost_cents": {
            "type": "integer",
            "readOnly": true
          },
          "prior_depreciation_cents": {
            "type": "integer",
            "readOnly": true
          },
          "opening_book_cents": {
            "type": "integer",
            "readOnly": true
          },
          "useful_years": {
            "type": "integer",
            "readOnly": true
          },
          "asset_account_id": {
            "type": "integer",
            "readOnly": true
          },
          "expense_account_id": {
            "type": "integer",
            "readOnly": true
          },
          "document_id": {
            "type": "integer",
            "readOnly": true
          },
          "acquisition_entry_id": {
            "type": "integer",
            "readOnly": true
          },
          "supersedes_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "snapshot": {
            "$ref": "#/components/schemas/AssetSnapshot",
            "readOnly": true
          },
          "plan": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetPeriod"
            },
            "readOnly": true
          },
          "plan_hash": {
            "type": "string",
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "id",
          "uuid",
          "tenant_id",
          "name",
          "origin",
          "acquired_on",
          "commissioned_on",
          "opening_on",
          "cost_cents",
          "prior_depreciation_cents",
          "opening_book_cents",
          "useful_years",
          "asset_account_id",
          "expense_account_id",
          "document_id",
          "acquisition_entry_id",
          "supersedes_id",
          "snapshot",
          "plan",
          "plan_hash",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "AssetBatchPreview": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "through": {
            "type": "string",
            "pattern": "^[0-9]{4}-[0-9]{2}$"
          },
          "scope": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "asset_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "plan_hash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "periods": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AssetPeriod"
                  }
                }
              },
              "required": [
                "asset_id",
                "plan_hash",
                "periods"
              ],
              "additionalProperties": false
            }
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "tenant_id",
          "through",
          "scope",
          "fingerprint"
        ],
        "additionalProperties": false
      },
      "AssetPosting": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "asset_id": {
            "type": "integer"
          },
          "run_id": {
            "type": "integer"
          },
          "period": {
            "type": "string"
          },
          "amount_cents": {
            "type": "integer"
          },
          "book_after_cents": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset."
          },
          "reversal_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "reversal_entry_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "reversal_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "reversal_posting_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "reversal_created_by": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "reversal_created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "asset_id",
          "run_id",
          "period",
          "amount_cents",
          "book_after_cents",
          "journal_entry_id",
          "created_by",
          "created_at",
          "reversal_id",
          "reversal_entry_id",
          "reversal_reason",
          "reversal_posting_id",
          "reversal_created_by",
          "reversal_created_at"
        ],
        "additionalProperties": false
      },
      "AssetRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "approval_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset."
          }
        },
        "required": [
          "id",
          "approval_id",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "AssetClosure": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "asset_id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset."
          }
        },
        "required": [
          "id",
          "asset_id",
          "journal_entry_id",
          "reason",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "AssetCard": {
        "type": "object",
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/FixedAsset"
          },
          "approvals": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "tenant_id": {
                  "type": "string"
                },
                "scope": {
                  "$ref": "#/components/schemas/AssetBatchPreview"
                },
                "created_by": {
                  "type": "integer",
                  "minimum": 1
                },
                "created_at": {
                  "type": "string",
                  "description": "Zeitstempel als Text mit Zeitzonenoffset."
                }
              },
              "required": [
                "id",
                "uuid",
                "tenant_id",
                "scope",
                "created_by",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetRun"
            }
          },
          "postings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetPosting"
            }
          },
          "closure": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AssetClosure"
              },
              {
                "type": "null"
              }
            ]
          },
          "depreciation_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "book_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "disposed_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "remaining_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "asset",
          "approvals",
          "runs",
          "postings",
          "closure",
          "depreciation_cents",
          "book_cents",
          "disposed_cents",
          "remaining_cents"
        ],
        "additionalProperties": false
      },
      "AssetReconciliation": {
        "type": "object",
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date"
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "account_number": {
                  "type": "string"
                },
                "asset_book_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "journal_balance_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "difference_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                }
              },
              "required": [
                "account_id",
                "account_number",
                "asset_book_cents",
                "journal_balance_cents",
                "difference_cents"
              ],
              "additionalProperties": false
            }
          },
          "scope": {
            "type": "string"
          }
        },
        "required": [
          "as_of",
          "accounts",
          "scope"
        ],
        "additionalProperties": false
      },
      "InvoiceMailPreview": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant": {
            "type": "string"
          },
          "actor_id": {
            "type": "integer",
            "minimum": 1
          },
          "actor_name": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "template": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "reply_to": {
            "type": "string"
          },
          "mailer": {
            "type": "string"
          },
          "invoice_id": {
            "type": "integer",
            "minimum": 1
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "include_xml": {
            "type": "boolean"
          },
          "resend": {
            "type": "boolean"
          },
          "expires": {
            "type": "integer",
            "description": "Unix-Sekunden, Vorschau 15 Minuten gültig"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "mime": {
                  "type": "string"
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "size": {
                  "type": "integer"
                }
              },
              "required": [
                "name",
                "mime",
                "sha256",
                "size"
              ],
              "additionalProperties": false
            }
          },
          "subject": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "confirmation": {
            "type": "string"
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "tenant",
          "actor_id",
          "actor_name",
          "recipient",
          "template",
          "language",
          "number",
          "company",
          "from",
          "from_name",
          "reply_to",
          "mailer",
          "invoice_id",
          "amount_cents",
          "original_sha256",
          "include_xml",
          "resend",
          "expires",
          "attachments",
          "subject",
          "body",
          "confirmation"
        ],
        "additionalProperties": false
      },
      "InvoiceMailEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "occurred_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset."
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "delivery_id",
          "status",
          "occurred_at",
          "reference"
        ],
        "additionalProperties": false
      },
      "InvoiceMailHistory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "recipient": {
            "type": "string"
          },
          "actor_id": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset."
          },
          "details": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "tenant": {
                "type": "string"
              },
              "actor_id": {
                "type": "integer",
                "minimum": 1
              },
              "actor_name": {
                "type": "string"
              },
              "recipient": {
                "type": "string"
              },
              "template": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "number": {
                "type": "string"
              },
              "company": {
                "type": "string"
              },
              "from": {
                "type": "string"
              },
              "from_name": {
                "type": "string"
              },
              "reply_to": {
                "type": "string"
              },
              "mailer": {
                "type": "string"
              },
              "invoice_id": {
                "type": "integer",
                "minimum": 1
              },
              "amount_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "original_sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "include_xml": {
                "type": "boolean"
              },
              "resend": {
                "type": "boolean"
              },
              "expires": {
                "type": "integer",
                "description": "Unix-Sekunden, Vorschau 15 Minuten gültig"
              },
              "attachments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "mime": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "size": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "name",
                    "mime",
                    "sha256",
                    "size"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "id",
              "tenant",
              "actor_id",
              "actor_name",
              "recipient",
              "template",
              "language",
              "number",
              "company",
              "from",
              "from_name",
              "reply_to",
              "mailer",
              "invoice_id",
              "amount_cents",
              "original_sha256",
              "include_xml",
              "resend",
              "expires",
              "attachments"
            ],
            "additionalProperties": false
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "handing_off",
              "handed_over",
              "failed",
              "uncertain"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceMailEvent"
            }
          }
        },
        "required": [
          "id",
          "recipient",
          "actor_id",
          "created_at",
          "details",
          "status",
          "events"
        ],
        "additionalProperties": false
      },
      "ReminderState": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "invoice_id": {
            "type": "integer",
            "minimum": 1
          },
          "number": {
            "type": "string"
          },
          "document_id": {
            "type": "integer",
            "minimum": 1
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "invoice_line_id": {
            "type": "integer",
            "minimum": 1
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "gross_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "allocated_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "open_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "allocations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "payment_line_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "amount_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "allocated_at": {
                  "type": "string",
                  "description": "Zeitstempel als Text mit Zeitzonenoffset."
                }
              },
              "required": [
                "id",
                "payment_line_id",
                "amount_cents",
                "allocated_at"
              ],
              "additionalProperties": false
            }
          },
          "recipient": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "street": {
                "type": "string"
              },
              "postal_code": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "street",
              "postal_code",
              "city",
              "country",
              "email"
            ],
            "additionalProperties": false
          },
          "language": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ]
          },
          "currency": {
            "type": "string"
          },
          "sender": {
            "type": "object",
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "street": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postal_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "iban": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "bic": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "name",
              "street",
              "postal_code",
              "city",
              "email",
              "iban",
              "bic"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "tenant_id",
          "invoice_id",
          "number",
          "document_id",
          "original_sha256",
          "invoice_line_id",
          "due_date",
          "gross_cents",
          "allocated_cents",
          "open_cents",
          "allocations",
          "recipient",
          "language",
          "currency",
          "sender"
        ],
        "additionalProperties": false
      },
      "ReminderContent": {
        "type": "object",
        "properties": {
          "state": {
            "$ref": "#/components/schemas/ReminderState"
          },
          "stage": {
            "type": "string",
            "enum": [
              "reminder",
              "first",
              "second"
            ]
          },
          "deadline": {
            "type": "string",
            "format": "date"
          },
          "text": {
            "type": "string"
          },
          "actor_name": {
            "type": "string"
          },
          "previous_letter_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "checked": {
            "const": true
          },
          "disputed": {
            "const": false
          },
          "as_of": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "state",
          "stage",
          "deadline",
          "text",
          "actor_name",
          "previous_letter_ids",
          "checked",
          "disputed",
          "as_of"
        ],
        "additionalProperties": false
      },
      "ReminderEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "letter_id": {
            "type": "string",
            "format": "uuid"
          },
          "actor_id": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "occurred_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset."
          }
        },
        "required": [
          "id",
          "letter_id",
          "actor_id",
          "status",
          "reference",
          "occurred_at"
        ],
        "additionalProperties": false
      },
      "ReminderLetter": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_id": {
            "type": "integer"
          },
          "actor_id": {
            "type": "integer"
          },
          "content": {
            "$ref": "#/components/schemas/ReminderContent"
          },
          "released_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset."
          },
          "status": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReminderEvent"
            }
          }
        },
        "required": [
          "id",
          "invoice_id",
          "actor_id",
          "content",
          "released_at",
          "status",
          "events"
        ],
        "additionalProperties": false
      },
      "VatReport": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "payment_issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "payment_entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "invoice_entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "allocation_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [],
              "additionalProperties": false
            }
          },
          "output": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "rate_bp": {
                  "type": "integer"
                },
                "direction": {
                  "type": "string"
                },
                "account_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "vat_box": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "box_net": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "box_tax": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reverse_charge": {
                  "type": "boolean"
                },
                "sources": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "line_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "booking_date": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "net_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "tax_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "section": {
                        "type": "string"
                      },
                      "rule_reference": {
                        "type": "string"
                      },
                      "payment_entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "allocation_id": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "required": [
                      "line_id",
                      "entry_id",
                      "booking_date",
                      "net_cents",
                      "tax_cents"
                    ],
                    "additionalProperties": false
                  }
                },
                "net_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "tax_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                }
              },
              "required": [
                "code",
                "name",
                "rate_bp",
                "direction",
                "vat_box",
                "box_net",
                "box_tax",
                "sources",
                "net_cents",
                "tax_cents"
              ],
              "additionalProperties": false
            }
          },
          "input": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "rate_bp": {
                  "type": "integer"
                },
                "direction": {
                  "type": "string"
                },
                "account_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "vat_box": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "box_net": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "box_tax": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reverse_charge": {
                  "type": "boolean"
                },
                "sources": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "line_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "booking_date": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "net_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "tax_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "section": {
                        "type": "string"
                      },
                      "rule_reference": {
                        "type": "string"
                      },
                      "payment_entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "allocation_id": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "required": [
                      "line_id",
                      "entry_id",
                      "booking_date",
                      "net_cents",
                      "tax_cents"
                    ],
                    "additionalProperties": false
                  }
                },
                "net_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "tax_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                }
              },
              "required": [
                "code",
                "name",
                "rate_bp",
                "direction",
                "vat_box",
                "box_net",
                "box_tax",
                "sources",
                "net_cents",
                "tax_cents"
              ],
              "additionalProperties": false
            }
          },
          "not_taxable": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "vat_box": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "net_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "tax_key",
                    "account"
                  ]
                },
                "sources": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "line_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "booking_date": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "net_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "tax_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "section": {
                        "type": "string"
                      },
                      "rule_reference": {
                        "type": "string"
                      },
                      "payment_entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "allocation_id": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "required": [
                      "line_id",
                      "entry_id",
                      "booking_date",
                      "net_cents",
                      "tax_cents"
                    ],
                    "additionalProperties": false
                  }
                },
                "configured_vat_box": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "code",
                "name",
                "vat_box",
                "net_cents",
                "source",
                "sources"
              ],
              "additionalProperties": false
            }
          },
          "output_tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "input_tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "payable_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "taxation": {
            "type": "string",
            "enum": [
              "soll",
              "ist"
            ]
          },
          "taxation_change": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "date": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "from": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "to": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "date",
                  "from",
                  "to"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "carried_over": {
            "type": "boolean"
          },
          "taxation_note": {
            "type": "string"
          },
          "contract_version": {
            "type": "string"
          },
          "form": {
            "type": "object",
            "properties": {
              "year": {
                "type": "integer"
              },
              "version": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "verified": {
                "type": "boolean"
              },
              "verified_on": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "source_sha256": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "year",
              "version",
              "verified",
              "verified_on",
              "source_sha256",
              "source"
            ],
            "additionalProperties": false
          },
          "data_fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "configuration": {
            "type": "object",
            "properties": {
              "settings": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "chart": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "taxation": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "small_business": {
                        "type": "boolean"
                      },
                      "updated_at": {
                        "type": "string",
                        "description": "Zeitstempel als Text mit Zeitzonenoffset."
                      }
                    },
                    "required": [
                      "id",
                      "chart",
                      "taxation",
                      "small_business",
                      "updated_at"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxation_history": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Source_taxation_periods"
                }
              },
              "filing_history": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Source_vat_filing_periods"
                }
              },
              "assignment_history": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "occurred_at": {
                      "type": "string",
                      "description": "Zeitstempel als Text mit Zeitzonenoffset."
                    },
                    "table_name": {
                      "type": "string"
                    },
                    "record_id": {
                      "type": "integer"
                    },
                    "operation": {
                      "type": "string"
                    },
                    "actor_id": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "before": {
                      "type": "string"
                    },
                    "after": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "occurred_at",
                    "table_name",
                    "record_id",
                    "operation",
                    "actor_id",
                    "before",
                    "after"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "settings",
              "taxation_history",
              "filing_history",
              "assignment_history"
            ],
            "additionalProperties": false
          },
          "completeness": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "blocked",
                  "review_required"
                ]
              },
              "arithmetically_balanced": {
                "type": "boolean"
              },
              "supported_scope": {
                "type": "boolean"
              },
              "user_reviewed": {
                "const": false
              },
              "filing_ready": {
                "const": false
              },
              "export_allowed": {
                "const": false
              },
              "scope": {
                "type": "string"
              }
            },
            "required": [
              "status",
              "arithmetically_balanced",
              "supported_scope",
              "user_reviewed",
              "filing_ready",
              "export_allowed",
              "scope"
            ],
            "additionalProperties": false
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "severity": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "remedy": {
                  "type": "string"
                },
                "entry_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "line_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "account": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "tax_key": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "vat_box": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "debit_cents": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "description": "Ganzzahlige Cent"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "credit_cents": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "description": "Ganzzahlige Cent"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reference": {
                  "type": "string"
                },
                "payment_entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "invoice_entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "allocation_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "service_month": {
                  "type": "string",
                  "pattern": "^[0-9]{4}-[0-9]{2}$"
                }
              },
              "required": [
                "code",
                "severity",
                "message",
                "remedy",
                "entry_id",
                "line_id",
                "account",
                "tax_key",
                "vat_box",
                "debit_cents",
                "credit_cents",
                "reference"
              ],
              "additionalProperties": false
            }
          },
          "boxes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "box": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "net",
                    "tax"
                  ]
                },
                "amount_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "sources": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "line_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "booking_date": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "account_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "net_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "tax_cents": {
                        "type": "integer",
                        "description": "Ganzzahlige Cent"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "section": {
                        "type": "string"
                      },
                      "rule_reference": {
                        "type": "string"
                      },
                      "payment_entry_id": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "allocation_id": {
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "required": [
                      "line_id",
                      "entry_id",
                      "booking_date",
                      "net_cents",
                      "tax_cents"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "box",
                "kind",
                "amount_cents",
                "sources"
              ],
              "additionalProperties": false
            }
          },
          "case_matrix": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "case": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "reference": {
                  "type": "string"
                },
                "condition": {
                  "type": "string"
                },
                "boxes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "case",
                "label",
                "status",
                "reference",
                "condition",
                "boxes"
              ],
              "additionalProperties": false
            }
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "from",
          "to",
          "payment_issues",
          "output",
          "input",
          "not_taxable",
          "output_tax_cents",
          "input_tax_cents",
          "payable_cents",
          "taxation",
          "taxation_change",
          "carried_over",
          "taxation_note",
          "contract_version",
          "form",
          "data_fingerprint",
          "configuration",
          "completeness",
          "findings",
          "boxes",
          "case_matrix"
        ],
        "additionalProperties": false
      },
      "DocumentExtractRecord": {
        "type": "object",
        "properties": {
          "issuer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "profile": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "net_cents": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "tax_cents": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "gross_cents": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "source": {
            "type": "string",
            "readOnly": true
          },
          "tax_breakdown": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "rate": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "net_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tax_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "category": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "scheme": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "rate",
                    "net_cents",
                    "tax_cents"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "problems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "ocr_request_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "provenance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SourceJson"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "issued_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "extracted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "document_id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "extracted_by": {
            "type": [
              "integer",
              "null"
            ],
            "readOnly": true
          },
          "issuer_vat_id": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "issuer_iban": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "due_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "issuer_name",
          "invoice_number",
          "currency",
          "profile",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "id",
          "source",
          "tax_breakdown",
          "problems",
          "ocr_request_id",
          "provenance",
          "issued_on",
          "extracted_at",
          "document_id",
          "extracted_by",
          "issuer_vat_id",
          "issuer_iban",
          "due_on",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "JournalEntryRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fiscal_year_id": {
            "type": "integer",
            "readOnly": true
          },
          "document_date": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "booking_date": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "recorded_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "description": {
            "type": "string",
            "readOnly": true
          },
          "reverses_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_journal_lines"
            },
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "posted"
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "entry_number",
          "fiscal_year_id",
          "document_date",
          "booking_date",
          "recorded_at",
          "posted_at",
          "description",
          "reverses_entry_id",
          "created_by",
          "created_at",
          "updated_at",
          "status"
        ],
        "additionalProperties": false
      },
      "RecurringContent": {
        "type": "object",
        "properties": {
          "recipient_name": {
            "type": "string"
          },
          "recipient_street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_country": {
            "type": "string"
          },
          "recipient_vat_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "buyer_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "intro": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "closing": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "net_cents": {
            "type": "integer"
          },
          "tax_cents": {
            "type": "integer"
          },
          "gross_cents": {
            "type": "integer"
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "skonto_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "skonto_percent_bp": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_profile": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "en16931",
              "xrechnung_3_0_2"
            ],
            "readOnly": true
          },
          "business_process": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_endpoint": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_endpoint_scheme": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "buyer_endpoint": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "buyer_endpoint_scheme": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_contact_name": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_contact_phone": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_contact_email": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "profile_snapshot": {
            "$ref": "#/components/schemas/ProfileSnapshot"
          },
          "payment_term_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "skonto_term_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tax_keys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "minimum": 1
                },
                "code": {
                  "type": "string"
                },
                "rate_bp": {
                  "type": "integer"
                },
                "direction": {
                  "type": "string"
                },
                "category": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "account_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "counter_account_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "vat_box": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "code",
                "rate_bp",
                "direction",
                "category",
                "account_id",
                "counter_account_id",
                "vat_box"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "recipient_name",
          "recipient_street",
          "recipient_postal_code",
          "recipient_city",
          "recipient_country",
          "recipient_vat_id",
          "recipient_email",
          "buyer_reference",
          "intro",
          "closing",
          "language",
          "currency",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "discount",
          "skonto_days",
          "skonto_percent_bp",
          "invoice_profile",
          "business_process",
          "seller_endpoint",
          "seller_endpoint_scheme",
          "buyer_endpoint",
          "buyer_endpoint_scheme",
          "seller_contact_name",
          "seller_contact_phone",
          "seller_contact_email",
          "profile_snapshot",
          "payment_term_days",
          "skonto_term_days",
          "tax_keys"
        ],
        "additionalProperties": false
      },
      "DeltaRate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "article_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "unit": {
            "type": "string",
            "maxLength": 3,
            "readOnly": true
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "valid_from": {
            "type": "string",
            "format": "date",
            "readOnly": true
          }
        },
        "required": [
          "id",
          "account_id",
          "article_id",
          "label",
          "unit",
          "amount_cents",
          "valid_from"
        ],
        "additionalProperties": false
      },
      "DeltaContactAddress": {
        "type": "object",
        "properties": {
          "street": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "country": {
            "type": "string",
            "maxLength": 2,
            "readOnly": true
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "vat_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "buyer_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "intro_text_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "closing_text_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "street",
          "postal_code",
          "city",
          "country",
          "email",
          "vat_id",
          "buyer_reference",
          "note",
          "intro_text_id",
          "closing_text_id"
        ],
        "additionalProperties": false
      },
      "DeltaInvoiceLine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "position": {
            "type": "integer",
            "readOnly": true
          },
          "description": {
            "type": "string",
            "maxLength": 255,
            "readOnly": true
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "quantity": {
            "type": "string",
            "pattern": "^-?[0-9]+(?:\\.[0-9]+)?$",
            "description": "Dezimalzahl als Text, keine Cent-Gleitkommazahl.",
            "readOnly": true
          },
          "unit": {
            "type": "string",
            "maxLength": 3,
            "readOnly": true
          },
          "unit_price_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "revenue_account_id": {
            "type": "integer",
            "readOnly": true
          },
          "article_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "id",
          "position",
          "description",
          "detail",
          "quantity",
          "unit",
          "unit_price_cents",
          "net_cents",
          "tax_cents",
          "tax_key_id",
          "revenue_account_id",
          "article_id"
        ],
        "additionalProperties": false
      },
      "DeltaEntryLine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "position": {
            "type": "integer",
            "readOnly": true
          },
          "account_id": {
            "type": "integer",
            "readOnly": true
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "debit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "credit_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "cost_center_source_line_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "id",
          "position",
          "account_id",
          "tax_key_id",
          "debit_cents",
          "credit_cents",
          "description"
        ],
        "additionalProperties": false
      },
      "DeltaDecision": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "auto",
              "dismissed",
              "selected"
            ]
          },
          "target_kind": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "target_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "revision": {
            "type": "integer",
            "readOnly": true
          }
        },
        "required": [
          "status",
          "target_kind",
          "target_id",
          "account_id",
          "tax_key_id",
          "revision"
        ],
        "additionalProperties": false
      },
      "DeltaAllocation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "account_id": {
            "type": "integer",
            "readOnly": true
          },
          "invoice_line_id": {
            "type": "integer",
            "readOnly": true
          },
          "payment_line_id": {
            "type": "integer",
            "readOnly": true
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "allocated_at": {
            "type": "string",
            "description": "Zeitstempel als Text, kein vereinheitlichtes ISO-Format.",
            "readOnly": true
          },
          "effective": {
            "type": "boolean",
            "readOnly": true,
            "description": "false, wenn eine beteiligte Buchung nach ihrer Stornokette storniert ist; Historienzeile bleibt. Ist der Storno selbst Teil der Zuordnung, wie bei der Korrektur einer Selbstabrechnung, bleibt sie wirksam."
          }
        },
        "required": [
          "id",
          "account_id",
          "invoice_line_id",
          "payment_line_id",
          "amount_cents",
          "allocated_at",
          "effective"
        ],
        "additionalProperties": false,
        "readOnly": true,
        "description": "Öffentliche eingefrorene allocations-Projektion. IDs sind Quell-IDs; Nummern sind getrennte Fachwerte. Keine vollständige Fachblatt-/Archivdarstellung."
      },
      "DeltaContact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "number": {
            "type": "string",
            "maxLength": 16,
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "readOnly": true
          },
          "personal_kind": {
            "type": "string",
            "enum": [
              "debtor",
              "creditor"
            ]
          },
          "is_active": {
            "type": "boolean",
            "readOnly": true
          },
          "rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeltaRate"
            }
          },
          "contact": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeltaContactAddress"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "personal_kind",
          "is_active",
          "rates",
          "contact"
        ],
        "additionalProperties": false,
        "readOnly": true,
        "description": "Öffentliche eingefrorene contacts-Projektion. IDs sind Quell-IDs; Nummern sind getrennte Fachwerte. Keine vollständige Fachblatt-/Archivdarstellung."
      },
      "DeltaArticle": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "number": {
            "type": "string",
            "maxLength": 32,
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "readOnly": true
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "unit": {
            "type": "string",
            "maxLength": 3,
            "readOnly": true
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "revenue_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "is_active": {
            "type": "boolean",
            "readOnly": true
          },
          "closing_text_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeltaRate"
            }
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "description",
          "unit",
          "tax_key_id",
          "revenue_account_id",
          "is_active",
          "closing_text_id",
          "rates"
        ],
        "additionalProperties": false,
        "readOnly": true,
        "description": "Öffentliche eingefrorene articles-Projektion. IDs sind Quell-IDs; Nummern sind getrennte Fachwerte. Keine vollständige Fachblatt-/Archivdarstellung."
      },
      "DeltaInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "kind": {
            "type": "string",
            "maxLength": 16,
            "readOnly": true
          },
          "invoice_type": {
            "type": "string",
            "maxLength": 16,
            "readOnly": true
          },
          "status": {
            "type": "string",
            "maxLength": 8,
            "readOnly": true
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_date": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient_name": {
            "type": "string",
            "maxLength": 255,
            "readOnly": true
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "currency": {
            "const": "EUR"
          },
          "net_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "tax_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "gross_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "settlement_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "reverses_invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "paid_means": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "paid_via": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "allocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeltaAllocation"
            }
          },
          "reversal_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeltaInvoiceLine"
            }
          },
          "allocated_cents": {
            "type": "integer",
            "readOnly": true
          },
          "project_time_origin": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProjectInvoiceOrigin99"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "invoice_type",
          "status",
          "number",
          "invoice_date",
          "due_date",
          "recipient_name",
          "account_id",
          "currency",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "document_id",
          "journal_entry_id",
          "settlement_entry_id",
          "reverses_invoice_id",
          "paid_means",
          "paid_via",
          "allocations",
          "reversal_ids",
          "lines",
          "allocated_cents",
          "project_time_origin"
        ],
        "additionalProperties": false,
        "readOnly": true,
        "description": "Öffentliche eingefrorene invoices-Projektion. IDs sind Quell-IDs; Nummern sind getrennte Fachwerte. Keine vollständige Fachblatt-/Archivdarstellung."
      },
      "DeltaDocument": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "original_name": {
            "type": "string",
            "maxLength": 255,
            "readOnly": true
          },
          "mime_type": {
            "type": "string",
            "maxLength": 128,
            "readOnly": true
          },
          "size_bytes": {
            "type": "integer",
            "readOnly": true
          },
          "sha256": {
            "type": "string",
            "maxLength": 64,
            "readOnly": true
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "received_at": {
            "type": "string",
            "description": "Zeitstempel als Text, kein vereinheitlichtes ISO-Format.",
            "readOnly": true
          },
          "locked_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text, kein vereinheitlichtes ISO-Format."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "entry_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "required": [
          "id",
          "original_name",
          "mime_type",
          "size_bytes",
          "sha256",
          "document_date",
          "note",
          "received_at",
          "locked_at",
          "entry_ids"
        ],
        "additionalProperties": false,
        "readOnly": true,
        "description": "Öffentliche eingefrorene documents-Projektion. IDs sind Quell-IDs; Nummern sind getrennte Fachwerte. Keine vollständige Fachblatt-/Archivdarstellung."
      },
      "DeltaEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "status": {
            "type": "string",
            "maxLength": 255,
            "readOnly": true
          },
          "description": {
            "type": "string",
            "maxLength": 255,
            "readOnly": true
          },
          "document_date": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "booking_date": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "recorded_at": {
            "type": "string",
            "description": "Zeitstempel als Text, kein vereinheitlichtes ISO-Format.",
            "readOnly": true
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text, kein vereinheitlichtes ISO-Format."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "reverses_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "allocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeltaAllocation"
            }
          },
          "reversal_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeltaEntryLine"
            }
          },
          "document_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "fx": {
            "description": "Herkunft einer Buchung aus einem Eingangsbeleg in Fremdwährung. Bei jeder anderen Buchung null, auch bei einer USD-Ausgangsrechnung, deren Herkunft an der Rechnung steht. Die Zeilen der Buchung stehen immer in EUR.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/EntryForeignCurrency"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "entry_number",
          "status",
          "description",
          "document_date",
          "booking_date",
          "recorded_at",
          "posted_at",
          "reverses_entry_id",
          "allocations",
          "reversal_ids",
          "lines",
          "document_ids",
          "fx"
        ],
        "additionalProperties": false,
        "readOnly": true,
        "description": "Öffentliche eingefrorene entries-Projektion. IDs sind Quell-IDs; Nummern sind getrennte Fachwerte. Keine vollständige Fachblatt-/Archivdarstellung."
      },
      "DeltaPayment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "bank_statement_id": {
            "type": "integer",
            "readOnly": true
          },
          "bank_account_id": {
            "type": "integer",
            "readOnly": true
          },
          "booked_on": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "value_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent.",
            "readOnly": true
          },
          "currency": {
            "type": "string",
            "maxLength": 3,
            "readOnly": true
          },
          "purpose": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "allocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeltaAllocation"
            }
          },
          "reversal_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "decision": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeltaDecision"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "bank_statement_id",
          "bank_account_id",
          "booked_on",
          "value_date",
          "amount_cents",
          "currency",
          "purpose",
          "journal_entry_id",
          "document_id",
          "allocations",
          "reversal_ids",
          "decision"
        ],
        "additionalProperties": false,
        "readOnly": true,
        "description": "Öffentliche eingefrorene payments-Projektion. IDs sind Quell-IDs; Nummern sind getrennte Fachwerte. Keine vollständige Fachblatt-/Archivdarstellung."
      },
      "DeltaItem": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "contacts"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/DeltaContact"
              },
              "deleted": {
                "const": false
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "contacts"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "const": "deleted"
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "type": "null"
              },
              "deleted": {
                "const": true
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "articles"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/DeltaArticle"
              },
              "deleted": {
                "const": false
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "articles"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "const": "deleted"
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "type": "null"
              },
              "deleted": {
                "const": true
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "invoices"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/DeltaInvoice"
              },
              "deleted": {
                "const": false
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "invoices"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "const": "deleted"
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "type": "null"
              },
              "deleted": {
                "const": true
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "documents"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/DeltaDocument"
              },
              "deleted": {
                "const": false
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "documents"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "const": "deleted"
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "type": "null"
              },
              "deleted": {
                "const": true
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "entries"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/DeltaEntry"
              },
              "deleted": {
                "const": false
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "entries"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "const": "deleted"
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "type": "null"
              },
              "deleted": {
                "const": true
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "payments"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/DeltaPayment"
              },
              "deleted": {
                "const": false
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "payments"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "const": "deleted"
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "type": "null"
              },
              "deleted": {
                "const": true
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "allocations"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/DeltaAllocation"
              },
              "deleted": {
                "const": false
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "allocations"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "const": "deleted"
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "type": "null"
              },
              "deleted": {
                "const": true
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "projects"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/DeltaProject99"
              },
              "deleted": {
                "const": false
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "projects"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "const": "deleted"
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "type": "null"
              },
              "deleted": {
                "const": true
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "project-time-entries"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/DeltaProjectTime99"
              },
              "deleted": {
                "const": false
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "pattern": "^(bootstrap:[0-9a-f-]{36}:[1-9][0-9]*|delta:.+:[1-9][0-9]*)$"
              },
              "resource": {
                "const": "project-time-entries"
              },
              "id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "action": {
                "const": "deleted"
              },
              "changeAction": {
                "type": "string",
                "enum": [
                  "snapshot",
                  "created",
                  "updated",
                  "deleted",
                  "deactivated",
                  "reactivated",
                  "archived",
                  "reversed",
                  "linked",
                  "unlinked",
                  "payment",
                  "allocated",
                  "deallocated"
                ]
              },
              "state": {
                "type": "null"
              },
              "deleted": {
                "const": true
              },
              "resolve": {
                "type": "string",
                "pattern": "^/api/v1/sync/resources/(allocations|articles|contacts|documents|entries|invoices|payments|projects|project-time-entries)/[1-9][0-9]*$"
              }
            },
            "required": [
              "eventId",
              "resource",
              "id",
              "action",
              "changeAction",
              "state",
              "deleted",
              "resolve"
            ],
            "additionalProperties": false
          }
        ],
        "description": "state ist letzter eingefrorener Stand am oberen Rand, kein Zwischenstand jedes Events. Tombstone: deleted=true, action=deleted, state=null. changeAction bewahrt die Quellmutation."
      },
      "DeltaPage": {
        "type": "object",
        "properties": {
          "contract": {
            "const": "summator-delta/1"
          },
          "mode": {
            "type": "string",
            "enum": [
              "bootstrap",
              "delta"
            ]
          },
          "windowId": {
            "type": "string",
            "format": "uuid"
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "allocations",
                "articles",
                "contacts",
                "documents",
                "entries",
                "invoices",
                "payments",
                "projects",
                "project-time-entries",
                "cost-centers"
              ]
            },
            "minItems": 1,
            "uniqueItems": true
          },
          "lowerBound": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "upperBound": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeltaItem"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "windowComplete": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": "string",
            "minLength": 1,
            "description": "Opaker verschlüsselter Fortsetzungsstand; erst atomar mit den Daten speichern."
          },
          "cursorExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "contract",
          "mode",
          "windowId",
          "resources",
          "lowerBound",
          "upperBound",
          "data",
          "hasMore",
          "windowComplete",
          "nextCursor",
          "cursorExpiresAt"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "hasMore": {
                  "const": true
                }
              }
            },
            "then": {
              "properties": {
                "windowComplete": {
                  "const": false
                }
              }
            },
            "else": {
              "properties": {
                "windowComplete": {
                  "const": true
                }
              }
            }
          }
        ]
      },
      "DeltaResolved": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "contacts"
              },
              "data": {
                "$ref": "#/components/schemas/DeltaContact"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "articles"
              },
              "data": {
                "$ref": "#/components/schemas/DeltaArticle"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "invoices"
              },
              "data": {
                "$ref": "#/components/schemas/DeltaInvoice"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "documents"
              },
              "data": {
                "$ref": "#/components/schemas/DeltaDocument"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "entries"
              },
              "data": {
                "$ref": "#/components/schemas/DeltaEntry"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "payments"
              },
              "data": {
                "$ref": "#/components/schemas/DeltaPayment"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "allocations"
              },
              "data": {
                "$ref": "#/components/schemas/DeltaAllocation"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "projects"
              },
              "data": {
                "$ref": "#/components/schemas/DeltaProject99"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "project-time-entries"
              },
              "data": {
                "$ref": "#/components/schemas/DeltaProjectTime99"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "contract": {
                "const": "summator-delta/1"
              },
              "resource": {
                "const": "cost-centers"
              },
              "data": {
                "$ref": "#/components/schemas/CostCenter89"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "contract",
              "resource",
              "data"
            ],
            "additionalProperties": false
          }
        ]
      },
      "IdempotencyConflict": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "idempotency_conflict",
              "idempotency_transport_conflict",
              "idempotency_processing"
            ]
          },
          "message": {
            "type": "string"
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "IdempotencyRequired": {
        "type": "object",
        "properties": {
          "code": {
            "const": "idempotency_key_required"
          },
          "message": {
            "type": "string"
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "IdempotencyMediaError": {
        "type": "object",
        "properties": {
          "code": {
            "const": "idempotency_json_required"
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "code"
        ],
        "additionalProperties": false
      },
      "IdempotencyBadRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "code": {
                "const": "invalid_json"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "code"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "code": {
                "const": "idempotency_unsupported"
              },
              "message": {
                "type": "string"
              },
              "setup": {
                "type": "object",
                "properties": {
                  "complete": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "complete",
                  "message",
                  "missing"
                ],
                "additionalProperties": false
              },
              "billing": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "overdue",
                      "payment_failed"
                    ]
                  },
                  "can_write": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "due_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "transfer": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "status",
                  "can_write",
                  "message",
                  "due_by",
                  "amount_cents",
                  "reference",
                  "transfer"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        ]
      },
      "IdempotencyExecutionError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "rejected",
              "rolled_back"
            ]
          },
          "message": {
            "type": "string"
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "SalesOrder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "released",
              "superseded",
              "cancelled",
              "converted"
            ]
          },
          "revision": {
            "type": "integer",
            "readOnly": true
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "released_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "pdf_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "snapshot_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "quote_id": {
            "type": "integer"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "previous_order_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "content": {
            "type": "object",
            "properties": {
              "account_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "quote_date": {
                "type": "string",
                "format": "date"
              },
              "intro_text": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "closing_text": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currency": {
                "type": "string",
                "enum": [
                  "EUR"
                ]
              },
              "recipient_name": {
                "type": "string"
              },
              "recipient_street": {
                "type": "string"
              },
              "recipient_postal_code": {
                "type": "string"
              },
              "recipient_city": {
                "type": "string"
              },
              "recipient_country": {
                "type": "string"
              },
              "recipient_vat_id": {
                "type": "string"
              },
              "recipient_email": {
                "type": "string"
              },
              "buyer_reference": {
                "type": "string"
              },
              "sender": {
                "type": "object",
                "properties": {
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "street": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postal_code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vat_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tax_number": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "register": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "represented_by": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "website": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "invoice_font": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "small_business": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "street",
                  "postal_code",
                  "city",
                  "country",
                  "vat_id",
                  "tax_number",
                  "register",
                  "represented_by",
                  "phone",
                  "email",
                  "website",
                  "invoice_font",
                  "small_business"
                ],
                "additionalProperties": false
              },
              "net_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "tax_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "gross_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "lines": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "article_id": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "detail": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quantity": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "unit": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unit_price_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "description": "Ganzzahlige Cent"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tax_key_id": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "revenue_account_id": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "rate_label": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tax_snapshot": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "code": {
                              "type": "string"
                            },
                            "direction": {
                              "type": "string"
                            },
                            "rate_bp": {
                              "type": "integer"
                            },
                            "category": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "account_id": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "counter_account_id": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "vat_box": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "code",
                            "direction",
                            "rate_bp",
                            "category",
                            "account_id",
                            "counter_account_id",
                            "vat_box"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "net_cents": {
                      "type": "integer",
                      "description": "Ganzzahlige Cent"
                    },
                    "tax_rate_bp": {
                      "type": "integer"
                    },
                    "source_position": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "description",
                    "detail",
                    "quantity",
                    "unit",
                    "unit_price_cents",
                    "tax_key_id",
                    "revenue_account_id",
                    "tax_snapshot",
                    "net_cents",
                    "tax_rate_bp"
                  ],
                  "additionalProperties": false,
                  "readOnly": true
                }
              },
              "order_reference": {
                "type": "string"
              },
              "service_date": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "agreed_schedule": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "conditions": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "quote_date",
              "currency",
              "recipient_name",
              "recipient_street",
              "recipient_postal_code",
              "recipient_city",
              "recipient_country",
              "recipient_vat_id",
              "recipient_email",
              "buyer_reference",
              "sender",
              "net_cents",
              "tax_cents",
              "gross_cents",
              "lines",
              "order_reference",
              "service_date",
              "agreed_schedule",
              "conditions"
            ],
            "additionalProperties": false,
            "readOnly": true
          },
          "change_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "released_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "differences_accepted": {
            "type": "boolean"
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "cancelled_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cancellation_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "conversion_input": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "invoice_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "service_date": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "invoice_date",
                  "service_date"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "review_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "differences": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "position": {
                  "type": "integer"
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "description",
                    "detail",
                    "quantity",
                    "unit",
                    "unit_price_cents"
                  ]
                },
                "offered": {
                  "type": [
                    "string",
                    "number",
                    "null"
                  ]
                },
                "ordered": {
                  "type": [
                    "string",
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "position",
                "field",
                "offered",
                "ordered"
              ],
              "additionalProperties": false
            }
          },
          "quote": {
            "$ref": "#/components/schemas/Quote"
          },
          "next_version": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SalesOrder"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "status",
          "revision",
          "number",
          "released_at",
          "pdf_hash",
          "snapshot_hash",
          "invoice_id",
          "created_by",
          "created_at",
          "updated_at",
          "quote_id",
          "source_hash",
          "previous_order_id",
          "content",
          "change_reason",
          "released_by",
          "differences_accepted",
          "cancelled_at",
          "cancelled_by",
          "cancellation_reason",
          "conversion_input",
          "review_hash",
          "differences"
        ],
        "additionalProperties": false
      },
      "DeliveryNoteLine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "delivery_note_id": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "quantity": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d{1,6})?$"
          },
          "snapshot": {
            "type": "object",
            "properties": {
              "article_id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "detail": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "unit": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source_line_id": {
                "type": "integer"
              },
              "source_quantity": {
                "type": "string",
                "pattern": "^\\d+(\\.\\d{1,6})?$"
              }
            },
            "required": [
              "article_id",
              "description",
              "detail",
              "unit"
            ],
            "additionalProperties": false
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "delivery_note_id",
          "position",
          "quantity",
          "snapshot",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "DeliveryNote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "draft",
              "released",
              "cancelled"
            ]
          },
          "request_key": {
            "type": "string"
          },
          "request_hash": {
            "type": "string"
          },
          "content": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "integer"
              },
              "recipient_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_street": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_postal_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_country": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delivery_date": {
                "type": "string",
                "format": "date"
              },
              "handover_note": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "currency": {
                "const": "EUR"
              },
              "sender": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "street": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "postal_code": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "country": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "invoice_font": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name",
                  "street",
                  "postal_code",
                  "city",
                  "country",
                  "email",
                  "invoice_font"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "account_id",
              "delivery_date",
              "currency",
              "sender",
              "recipient_name",
              "recipient_street",
              "recipient_postal_code",
              "recipient_city",
              "recipient_country"
            ],
            "additionalProperties": false
          },
          "source_invoice_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source_sales_order_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source_quote_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source_hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "released_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "pdf_hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "snapshot_hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cancellation_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeliveryNoteLine"
            }
          }
        },
        "required": [
          "id",
          "status",
          "request_key",
          "request_hash",
          "content",
          "source_invoice_id",
          "source_sales_order_id",
          "source_quote_id",
          "source_hash",
          "number",
          "released_at",
          "pdf_hash",
          "snapshot_hash",
          "invoice_id",
          "cancellation_reason",
          "cancelled_at",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "DeliverySource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "invoice",
              "sales_order",
              "quote"
            ]
          },
          "source_id": {
            "type": "integer"
          },
          "invoice_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Vorhandener Rechnungsentwurf der Quelle. Lieferungen werden dorthin verknüpft."
          },
          "source_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "account_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "recipient": {
            "type": "object",
            "properties": {
              "recipient_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_street": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_postal_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipient_country": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "recipient_name",
              "recipient_street",
              "recipient_postal_code",
              "recipient_city",
              "recipient_country"
            ],
            "additionalProperties": false
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "article_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "description": {
                  "type": "string"
                },
                "detail": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^\\d+(\\.\\d{1,6})?$"
                },
                "unit": {
                  "type": "string"
                },
                "consumed_quantity": {
                  "type": "string",
                  "pattern": "^\\d+(\\.\\d{1,6})?$"
                },
                "remaining_quantity": {
                  "type": "string",
                  "pattern": "^\\d+(\\.\\d{1,6})?$"
                }
              },
              "required": [
                "id",
                "article_id",
                "description",
                "detail",
                "quantity",
                "unit",
                "consumed_quantity",
                "remaining_quantity"
              ],
              "additionalProperties": false
            }
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "number",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "source_id",
          "invoice_id",
          "source_hash",
          "account_id",
          "recipient",
          "lines",
          "history"
        ],
        "additionalProperties": false
      },
      "BwaMapping": {
        "type": "object",
        "properties": {
          "row": {
            "type": "string",
            "enum": [
              "sales",
              "inventory",
              "own_work",
              "materials",
              "services",
              "other_income",
              "personnel",
              "premises",
              "depreciation",
              "other_expense",
              "other_tax",
              "interest_income",
              "interest_expense",
              "income_tax"
            ]
          },
          "origin": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "row",
          "origin",
          "reason"
        ],
        "additionalProperties": false
      },
      "BwaMappingInput": {
        "type": "object",
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            ]
          },
          "row": {
            "type": "string",
            "enum": [
              "sales",
              "inventory",
              "own_work",
              "materials",
              "services",
              "other_income",
              "personnel",
              "premises",
              "depreciation",
              "other_expense",
              "other_tax",
              "interest_income",
              "interest_expense",
              "income_tax"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 10,
            "maxLength": 500
          }
        },
        "required": [
          "account_id",
          "row",
          "reason"
        ],
        "additionalProperties": false
      },
      "BwaRange": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "additionalProperties": false
      },
      "BwaPeriodRange": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "available": {
            "type": "boolean"
          }
        },
        "required": [
          "from",
          "to",
          "available"
        ],
        "additionalProperties": false
      },
      "BwaAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "chart": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "category_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "personal_kind": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "chart",
          "type",
          "category_code",
          "personal_kind"
        ],
        "additionalProperties": false
      },
      "BwaDocumentRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "original_name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sha256",
          "original_name"
        ],
        "additionalProperties": false
      },
      "BwaLineSource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "debit_cents": {
            "type": "integer"
          },
          "credit_cents": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "journal_entry_id",
          "account_id",
          "debit_cents",
          "credit_cents"
        ],
        "additionalProperties": false
      },
      "BwaLine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "debit_cents": {
            "type": "integer"
          },
          "credit_cents": {
            "type": "integer"
          },
          "entry_id": {
            "type": "integer"
          },
          "entry_number": {
            "type": "integer"
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "document_date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "reverses_entry_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaDocumentRef"
            }
          },
          "result_cents": {
            "type": "integer"
          },
          "asset_posting": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "journal_entry_id",
          "account_id",
          "debit_cents",
          "credit_cents",
          "entry_id",
          "entry_number",
          "booking_date",
          "document_date",
          "description",
          "reverses_entry_id",
          "documents",
          "result_cents",
          "asset_posting"
        ],
        "additionalProperties": false
      },
      "BwaExcludedLine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "debit_cents": {
            "type": "integer"
          },
          "credit_cents": {
            "type": "integer"
          },
          "entry_id": {
            "type": "integer"
          },
          "entry_number": {
            "type": "integer"
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "document_date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "reverses_entry_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaDocumentRef"
            }
          },
          "result_cents": {
            "type": "integer"
          },
          "asset_posting": {
            "type": [
              "integer",
              "null"
            ]
          },
          "number": {
            "type": "string"
          },
          "reason": {
            "enum": [
              "BALANCE_CARRIED_FORWARD",
              "closing",
              "opening",
              "closing_reversal",
              "opening_reversal"
            ]
          },
          "year_end_closure_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "journal_entry_id",
          "account_id",
          "debit_cents",
          "credit_cents",
          "entry_id",
          "entry_number",
          "booking_date",
          "document_date",
          "description",
          "reverses_entry_id",
          "documents",
          "result_cents",
          "asset_posting",
          "number",
          "reason"
        ],
        "additionalProperties": false
      },
      "BwaAccountDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "chart": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "category_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "personal_kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "row": {
            "type": [
              "string",
              "null"
            ]
          },
          "cents": {
            "type": "integer"
          },
          "result_cents": {
            "type": "integer"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaLine"
            }
          },
          "mapping": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BwaMapping"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "chart",
          "type",
          "category_code",
          "personal_kind",
          "row",
          "cents",
          "result_cents",
          "lines",
          "mapping"
        ],
        "additionalProperties": false
      },
      "BwaDraft": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "document_date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "booking_date",
          "document_date",
          "description"
        ],
        "additionalProperties": false
      },
      "BwaEntrySource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "entry_number": {
            "type": "integer"
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "document_date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "reverses_entry_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "posted_at": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaLineSource"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaDocumentRef"
            }
          },
          "asset_posting": {
            "type": [
              "integer",
              "null"
            ]
          },
          "year_end_closure_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "year_end_kind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "closing",
              "opening",
              "closing_reversal",
              "opening_reversal",
              null
            ]
          },
          "year_end_position": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "entry_number",
          "booking_date",
          "document_date",
          "description",
          "reverses_entry_id",
          "posted_at",
          "lines",
          "documents",
          "asset_posting"
        ],
        "additionalProperties": false
      },
      "BwaOpenDocument": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "original_name": {
            "type": "string"
          },
          "document_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "received_at": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "original_name",
          "document_date",
          "received_at",
          "sha256"
        ],
        "additionalProperties": false
      },
      "BwaFiscalYear": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "starts_on": {
            "type": "string",
            "format": "date"
          },
          "ends_on": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "year",
          "starts_on",
          "ends_on",
          "status"
        ],
        "additionalProperties": false
      },
      "BwaSource": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "company": {
            "type": "object",
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "chart": {
                "enum": [
                  "SKR03",
                  "SKR04"
                ]
              }
            },
            "required": [
              "name",
              "chart"
            ],
            "additionalProperties": false
          },
          "fiscal_years": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaFiscalYear"
            }
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaAccount"
            }
          },
          "mapping": {
            "anyOf": [
              {
                "type": "object",
                "patternProperties": {
                  "^account:[0-9]+$": {
                    "$ref": "#/components/schemas/BwaMapping"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "maxItems": 0
              }
            ]
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaEntrySource"
            }
          },
          "drafts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaDraft"
            }
          },
          "unbooked_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaOpenDocument"
            }
          },
          "integrity_notices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "finding_count": {
                  "type": "integer"
                },
                "created_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "finding_count",
                "created_at"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "tenant_id",
          "company",
          "fiscal_years",
          "accounts",
          "mapping",
          "entries",
          "drafts",
          "unbooked_documents",
          "integrity_notices"
        ],
        "additionalProperties": false
      },
      "BwaPeriod": {
        "type": "object",
        "properties": {
          "period": {
            "$ref": "#/components/schemas/BwaPeriodRange"
          },
          "totals": {
            "type": "object",
            "properties": {
              "sales": {
                "type": "integer"
              },
              "inventory": {
                "type": "integer"
              },
              "own_work": {
                "type": "integer"
              },
              "output": {
                "type": "integer"
              },
              "materials": {
                "type": "integer"
              },
              "services": {
                "type": "integer"
              },
              "gross_profit": {
                "type": "integer"
              },
              "other_income": {
                "type": "integer"
              },
              "personnel": {
                "type": "integer"
              },
              "premises": {
                "type": "integer"
              },
              "depreciation": {
                "type": "integer"
              },
              "other_expense": {
                "type": "integer"
              },
              "other_tax": {
                "type": "integer"
              },
              "operating": {
                "type": "integer"
              },
              "interest_income": {
                "type": "integer"
              },
              "interest_expense": {
                "type": "integer"
              },
              "financial": {
                "type": "integer"
              },
              "before_tax": {
                "type": "integer"
              },
              "income_tax": {
                "type": "integer"
              },
              "result": {
                "type": "integer"
              }
            },
            "required": [
              "sales",
              "inventory",
              "own_work",
              "output",
              "materials",
              "services",
              "gross_profit",
              "other_income",
              "personnel",
              "premises",
              "depreciation",
              "other_expense",
              "other_tax",
              "operating",
              "interest_income",
              "interest_expense",
              "financial",
              "before_tax",
              "income_tax",
              "result"
            ],
            "additionalProperties": false
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaAccountDetail"
            }
          },
          "excluded_lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaExcludedLine"
            }
          },
          "posted_entry_count": {
            "type": "integer"
          },
          "drafts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BwaDraft"
            }
          },
          "journal_result_cents": {
            "type": "integer"
          },
          "unmapped_result_cents": {
            "type": "integer"
          },
          "excluded_result_cents": {
            "type": "integer"
          },
          "reconciliation_difference_cents": {
            "type": "integer"
          },
          "has_data": {
            "type": "boolean"
          }
        },
        "required": [
          "period",
          "totals",
          "accounts",
          "excluded_lines",
          "posted_entry_count",
          "drafts",
          "journal_result_cents",
          "unmapped_result_cents",
          "excluded_result_cents",
          "reconciliation_difference_cents",
          "has_data"
        ],
        "additionalProperties": false
      },
      "BwaDifference": {
        "type": "object",
        "properties": {
          "delta_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "percent": {
            "type": [
              "number",
              "null"
            ]
          },
          "reason": {
            "enum": [
              "missing_fiscal_year",
              "no_posted_data",
              "zero_base",
              null
            ]
          }
        },
        "required": [
          "delta_cents",
          "percent",
          "reason"
        ],
        "additionalProperties": false
      },
      "BwaSnapshot": {
        "type": "object",
        "properties": {
          "contract": {
            "enum": [
              "summator-basis-bwa/1",
              "summator-basis-bwa/2",
              "summator-basis-bwa/3"
            ]
          },
          "rule_hash": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "locale": {
            "type": "string"
          },
          "options": {
            "type": "object",
            "properties": {
              "month": {
                "type": "string",
                "pattern": "^[0-9]{4}-[0-9]{2}$"
              },
              "period": {
                "enum": [
                  "month",
                  "quarter"
                ]
              },
              "compare": {
                "enum": [
                  "previous_period",
                  "previous_year"
                ]
              },
              "current": {
                "$ref": "#/components/schemas/BwaRange"
              },
              "comparison": {
                "$ref": "#/components/schemas/BwaRange"
              },
              "mappings": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BwaMappingInput"
                }
              }
            },
            "required": [
              "month",
              "period",
              "compare",
              "current",
              "comparison",
              "mappings"
            ],
            "additionalProperties": false
          },
          "source_hash": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/BwaSource"
          },
          "status": {
            "const": "provisional"
          },
          "rows": {
            "type": "array",
            "items": {
              "enum": [
                "sales",
                "inventory",
                "own_work",
                "output",
                "materials",
                "services",
                "gross_profit",
                "other_income",
                "personnel",
                "premises",
                "depreciation",
                "other_expense",
                "other_tax",
                "operating",
                "interest_income",
                "interest_expense",
                "financial",
                "before_tax",
                "income_tax",
                "result"
              ]
            }
          },
          "row_labels": {
            "type": "object",
            "properties": {
              "sales": {
                "type": "string"
              },
              "inventory": {
                "type": "string"
              },
              "own_work": {
                "type": "string"
              },
              "output": {
                "type": "string"
              },
              "materials": {
                "type": "string"
              },
              "services": {
                "type": "string"
              },
              "gross_profit": {
                "type": "string"
              },
              "other_income": {
                "type": "string"
              },
              "personnel": {
                "type": "string"
              },
              "premises": {
                "type": "string"
              },
              "depreciation": {
                "type": "string"
              },
              "other_expense": {
                "type": "string"
              },
              "other_tax": {
                "type": "string"
              },
              "operating": {
                "type": "string"
              },
              "interest_income": {
                "type": "string"
              },
              "interest_expense": {
                "type": "string"
              },
              "financial": {
                "type": "string"
              },
              "before_tax": {
                "type": "string"
              },
              "income_tax": {
                "type": "string"
              },
              "result": {
                "type": "string"
              }
            },
            "required": [
              "sales",
              "inventory",
              "own_work",
              "output",
              "materials",
              "services",
              "gross_profit",
              "other_income",
              "personnel",
              "premises",
              "depreciation",
              "other_expense",
              "other_tax",
              "operating",
              "interest_income",
              "interest_expense",
              "financial",
              "before_tax",
              "income_tax",
              "result"
            ],
            "additionalProperties": false
          },
          "schema_accounts": {
            "type": "object",
            "properties": {
              "SKR03": {
                "type": "object",
                "additionalProperties": {
                  "enum": [
                    "sales",
                    "inventory",
                    "own_work",
                    "materials",
                    "services",
                    "other_income",
                    "personnel",
                    "premises",
                    "depreciation",
                    "other_expense",
                    "other_tax",
                    "interest_income",
                    "interest_expense",
                    "income_tax"
                  ]
                }
              },
              "SKR04": {
                "type": "object",
                "additionalProperties": {
                  "enum": [
                    "sales",
                    "inventory",
                    "own_work",
                    "materials",
                    "services",
                    "other_income",
                    "personnel",
                    "premises",
                    "depreciation",
                    "other_expense",
                    "other_tax",
                    "interest_income",
                    "interest_expense",
                    "income_tax"
                  ]
                }
              }
            },
            "required": [
              "SKR03",
              "SKR04"
            ],
            "additionalProperties": false
          },
          "current": {
            "$ref": "#/components/schemas/BwaPeriod"
          },
          "comparison": {
            "$ref": "#/components/schemas/BwaPeriod"
          },
          "current_ytd": {
            "$ref": "#/components/schemas/BwaPeriod"
          },
          "comparison_ytd": {
            "$ref": "#/components/schemas/BwaPeriod"
          },
          "differences": {
            "type": "object",
            "properties": {
              "sales": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "inventory": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "own_work": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "output": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "materials": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "services": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "gross_profit": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "other_income": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "personnel": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "premises": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "depreciation": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "other_expense": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "other_tax": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "operating": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "interest_income": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "interest_expense": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "financial": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "before_tax": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "income_tax": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "result": {
                "$ref": "#/components/schemas/BwaDifference"
              }
            },
            "required": [
              "sales",
              "inventory",
              "own_work",
              "output",
              "materials",
              "services",
              "gross_profit",
              "other_income",
              "personnel",
              "premises",
              "depreciation",
              "other_expense",
              "other_tax",
              "operating",
              "interest_income",
              "interest_expense",
              "financial",
              "before_tax",
              "income_tax",
              "result"
            ],
            "additionalProperties": false
          },
          "ytd_differences": {
            "type": "object",
            "properties": {
              "sales": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "inventory": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "own_work": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "output": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "materials": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "services": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "gross_profit": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "other_income": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "personnel": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "premises": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "depreciation": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "other_expense": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "other_tax": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "operating": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "interest_income": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "interest_expense": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "financial": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "before_tax": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "income_tax": {
                "$ref": "#/components/schemas/BwaDifference"
              },
              "result": {
                "$ref": "#/components/schemas/BwaDifference"
              }
            },
            "required": [
              "sales",
              "inventory",
              "own_work",
              "output",
              "materials",
              "services",
              "gross_profit",
              "other_income",
              "personnel",
              "premises",
              "depreciation",
              "other_expense",
              "other_tax",
              "operating",
              "interest_income",
              "interest_expense",
              "financial",
              "before_tax",
              "income_tax",
              "result"
            ],
            "additionalProperties": false
          },
          "snapshot_hash": {
            "type": "string"
          }
        },
        "required": [
          "contract",
          "rule_hash",
          "tenant_id",
          "generated_at",
          "locale",
          "options",
          "source_hash",
          "source",
          "status",
          "rows",
          "row_labels",
          "current",
          "comparison",
          "current_ytd",
          "comparison_ytd",
          "differences",
          "ytd_differences",
          "snapshot_hash"
        ],
        "additionalProperties": false
      },
      "BwaResult": {
        "type": "object",
        "properties": {
          "report": {
            "$ref": "#/components/schemas/BwaSnapshot"
          },
          "binding": {
            "type": "string"
          }
        },
        "required": [
          "report",
          "binding"
        ],
        "additionalProperties": false
      },
      "BwaDownloadRequest": {
        "type": "object",
        "properties": {
          "binding": {
            "type": "string",
            "maxLength": 16000000
          },
          "format": {
            "enum": [
              "json",
              "csv",
              "html"
            ]
          },
          "confidential": {
            "const": true
          }
        },
        "required": [
          "binding",
          "format",
          "confidential"
        ],
        "additionalProperties": false
      },
      "YearEndSource_accounts": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "chart": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "category_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "personal_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_box": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_reportable": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "type",
          "chart",
          "is_active",
          "created_at",
          "updated_at",
          "category",
          "category_code",
          "personal_kind",
          "vat_box",
          "vat_reportable"
        ],
        "additionalProperties": false
      },
      "YearEndSource_invoices": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "number_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "service_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_period_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "due_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_name": {
            "type": "string"
          },
          "recipient_street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_country": {
            "type": "string"
          },
          "recipient_vat_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipient_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "buyer_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "net_cents": {
            "type": "integer"
          },
          "tax_cents": {
            "type": "integer"
          },
          "gross_cents": {
            "type": "integer"
          },
          "intro": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "closing": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "reverses_invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "issued_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "issued_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_means": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "paid_via": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "clearing_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "settlement_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_type": {
            "type": "string"
          },
          "advance_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "prepaid_net_cents": {
            "type": "integer"
          },
          "prepaid_tax_cents": {
            "type": "integer"
          },
          "prepaid_gross_cents": {
            "type": "integer"
          },
          "advance_transfer_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_profile": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "business_process": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "seller_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "seller_endpoint_scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "buyer_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "buyer_endpoint_scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "seller_contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "seller_contact_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "seller_contact_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "profile_snapshot": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "discount": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "pricing_snapshot": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "skonto_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "skonto_percent_bp": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_terms_snapshot": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "status",
          "kind",
          "number",
          "number_year",
          "invoice_date",
          "service_date",
          "service_period_from",
          "service_period_to",
          "due_date",
          "recipient_name",
          "recipient_street",
          "recipient_postal_code",
          "recipient_city",
          "recipient_country",
          "recipient_vat_id",
          "recipient_email",
          "buyer_reference",
          "account_id",
          "currency",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "intro",
          "closing",
          "reverses_invoice_id",
          "document_id",
          "journal_entry_id",
          "issued_at",
          "issued_by",
          "created_by",
          "created_at",
          "updated_at",
          "formatted_number",
          "paid_means",
          "paid_via",
          "clearing_account_id",
          "settlement_entry_id",
          "invoice_type",
          "advance_account_id",
          "prepaid_net_cents",
          "prepaid_tax_cents",
          "prepaid_gross_cents",
          "advance_transfer_entry_id",
          "language",
          "invoice_profile",
          "business_process",
          "seller_endpoint",
          "seller_endpoint_scheme",
          "buyer_endpoint",
          "buyer_endpoint_scheme",
          "seller_contact_name",
          "seller_contact_phone",
          "seller_contact_email",
          "profile_snapshot",
          "discount",
          "pricing_snapshot",
          "skonto_days",
          "skonto_percent_bp",
          "payment_terms_snapshot"
        ],
        "additionalProperties": false
      },
      "YearEndSource_tax_keys": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "rate_bp": {
            "type": "integer"
          },
          "direction": {
            "type": "string"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "chart": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "counter_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_box": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "rate_bp",
          "direction",
          "account_id",
          "chart",
          "is_active",
          "created_at",
          "updated_at",
          "counter_account_id",
          "vat_box",
          "category"
        ],
        "additionalProperties": false
      },
      "YearEndSource_documents": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "original_name": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "sha256": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "received_at": {
            "type": "string"
          },
          "uploaded_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "locked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "seal_on_post": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "original_name",
          "mime_type",
          "size_bytes",
          "sha256",
          "path",
          "document_date",
          "note",
          "received_at",
          "uploaded_by",
          "locked_at",
          "created_at",
          "updated_at",
          "seal_on_post"
        ],
        "additionalProperties": false
      },
      "YearEndSource_asset_runs": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "approval_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "approval_id",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_fiscal_years": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "starts_on": {
            "type": "string",
            "format": "date"
          },
          "ends_on": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "type": "string"
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "year",
          "starts_on",
          "ends_on",
          "status",
          "closed_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_fixed_assets": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "uuid": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "acquired_on": {
            "type": "string",
            "format": "date"
          },
          "commissioned_on": {
            "type": "string",
            "format": "date"
          },
          "opening_on": {
            "type": "string",
            "format": "date"
          },
          "cost_cents": {
            "type": "integer"
          },
          "prior_depreciation_cents": {
            "type": "integer"
          },
          "opening_book_cents": {
            "type": "integer"
          },
          "useful_years": {
            "type": "integer"
          },
          "asset_account_id": {
            "type": "integer"
          },
          "expense_account_id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "acquisition_entry_id": {
            "type": "integer"
          },
          "supersedes_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "snapshot": {},
          "plan": {},
          "plan_hash": {
            "type": "string"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "uuid",
          "tenant_id",
          "name",
          "origin",
          "acquired_on",
          "commissioned_on",
          "opening_on",
          "cost_cents",
          "prior_depreciation_cents",
          "opening_book_cents",
          "useful_years",
          "asset_account_id",
          "expense_account_id",
          "document_id",
          "acquisition_entry_id",
          "supersedes_id",
          "snapshot",
          "plan",
          "plan_hash",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_bank_accounts": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "iban": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "bic": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "bank_connection_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "fetched_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_connection_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "iban",
          "name",
          "bic",
          "currency",
          "account_id",
          "created_at",
          "updated_at",
          "bank_connection_id",
          "fetched_until",
          "payment_connection_id"
        ],
        "additionalProperties": false
      },
      "YearEndSource_invoice_lines": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "invoice_id": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "unit_price_cents": {
            "type": "integer"
          },
          "net_cents": {
            "type": "integer"
          },
          "tax_cents": {
            "type": "integer"
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "revenue_account_id": {
            "type": "integer"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "article_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "id",
          "invoice_id",
          "position",
          "description",
          "quantity",
          "unit",
          "unit_price_cents",
          "net_cents",
          "tax_cents",
          "tax_key_id",
          "revenue_account_id",
          "created_at",
          "updated_at",
          "article_id",
          "detail",
          "discount"
        ],
        "additionalProperties": false
      },
      "YearEndSource_journal_lines": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "debit_cents": {
            "type": "integer"
          },
          "credit_cents": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "cost_center_source_line_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "id",
          "journal_entry_id",
          "account_id",
          "debit_cents",
          "credit_cents",
          "position",
          "description",
          "created_at",
          "updated_at",
          "tax_key_id"
        ],
        "additionalProperties": false
      },
      "YearEndSource_asset_closures": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "asset_id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "asset_id",
          "journal_entry_id",
          "reason",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_asset_postings": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "asset_id": {
            "type": "integer"
          },
          "run_id": {
            "type": "integer"
          },
          "period": {
            "type": "string"
          },
          "amount_cents": {
            "type": "integer"
          },
          "book_after_cents": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "asset_id",
          "run_id",
          "period",
          "amount_cents",
          "book_after_cents",
          "journal_entry_id",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_document_links": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "linked_at": {
            "type": "string"
          },
          "linked_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "document_id",
          "journal_entry_id",
          "linked_at",
          "linked_by"
        ],
        "additionalProperties": false
      },
      "YearEndSource_document_seals": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "sha256": {
            "type": "string"
          },
          "previous_seal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "seal": {
            "type": "string"
          },
          "sealed_at": {
            "type": "string"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "document_id",
          "sha256",
          "previous_seal",
          "seal",
          "sealed_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_asset_approvals": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "uuid": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "scope": {},
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "uuid",
          "tenant_id",
          "scope",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_asset_reversals": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "posting_id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "posting_id",
          "journal_entry_id",
          "reason",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_bank_statements": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "bank_account_id": {
            "type": "integer"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "statement_date": {
            "type": "string",
            "format": "date"
          },
          "opening_balance_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "closing_balance_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "format": {
            "type": "string"
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "imported_at": {
            "type": "string"
          },
          "imported_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "csv_provenance": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "bank_account_id",
          "number",
          "statement_date",
          "opening_balance_cents",
          "closing_balance_cents",
          "format",
          "document_id",
          "imported_at",
          "imported_by",
          "created_at",
          "updated_at",
          "csv_provenance"
        ],
        "additionalProperties": false
      },
      "YearEndSource_journal_entries": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "fiscal_year_id": {
            "type": "integer"
          },
          "document_date": {
            "type": "string",
            "format": "date"
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "recorded_at": {
            "type": "string"
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "reverses_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "year_end_closure_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "year_end_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "year_end_position": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "entry_number",
          "fiscal_year_id",
          "document_date",
          "booking_date",
          "recorded_at",
          "posted_at",
          "status",
          "description",
          "reverses_entry_id",
          "created_by",
          "created_at",
          "updated_at",
          "year_end_closure_id",
          "year_end_kind",
          "year_end_position"
        ],
        "additionalProperties": false
      },
      "YearEndSource_company_settings": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "chart": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "taxation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "taxation_set_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": "string"
          },
          "small_business": {
            "type": "boolean"
          },
          "iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "bic": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "register": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "represented_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "receivables_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "website": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "bank_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "logo_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_layout": {
            "type": "string"
          },
          "invoice_font": {
            "type": "string"
          },
          "invoice_prices": {
            "type": "string"
          },
          "legal_form": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_number_format": {
            "type": "string"
          },
          "credit_note_number_format": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "chart",
          "tax_number",
          "vat_id",
          "created_at",
          "updated_at",
          "taxation",
          "taxation_set_at",
          "street",
          "postal_code",
          "city",
          "country",
          "small_business",
          "iban",
          "bic",
          "register",
          "represented_by",
          "receivables_account_id",
          "phone",
          "email",
          "website",
          "bank_name",
          "logo_path",
          "invoice_layout",
          "invoice_font",
          "invoice_prices",
          "legal_form",
          "invoice_number_format",
          "credit_note_number_format"
        ],
        "additionalProperties": false
      },
      "YearEndSource_integrity_alerts": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "fingerprint": {
            "type": "string"
          },
          "finding_count": {
            "type": "integer"
          },
          "summary": {
            "type": "string"
          },
          "notified_at": {
            "type": "string"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "fingerprint",
          "finding_count",
          "summary",
          "notified_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_taxation_periods": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "valid_from": {
            "type": "string",
            "format": "date"
          },
          "taxation": {
            "type": "string"
          },
          "basis": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "automatic": {
            "type": "boolean"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "decided_at": {
            "type": "string"
          },
          "decided_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "valid_from",
          "taxation",
          "basis",
          "automatic",
          "note",
          "decided_at",
          "decided_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_bank_transactions": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "bank_statement_id": {
            "type": "integer"
          },
          "bank_account_id": {
            "type": "integer"
          },
          "booked_on": {
            "type": "string",
            "format": "date"
          },
          "value_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "amount_cents": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "counterparty_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "counterparty_iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "purpose": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "end_to_end_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "bank_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "fingerprint": {
            "type": "string"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "bank_statement_id",
          "bank_account_id",
          "booked_on",
          "value_date",
          "amount_cents",
          "currency",
          "counterparty_name",
          "counterparty_iban",
          "purpose",
          "end_to_end_id",
          "bank_reference",
          "fingerprint",
          "created_at",
          "updated_at",
          "journal_entry_id",
          "document_id"
        ],
        "additionalProperties": false
      },
      "YearEndSource_document_extracts": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "source": {
            "type": "string"
          },
          "profile": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "extracted_at": {
            "type": "string"
          },
          "extracted_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "issuer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "issuer_vat_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "issuer_iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "issued_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "due_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "net_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_breakdown": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "problems": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "ocr_request_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "provenance": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "document_id",
          "source",
          "profile",
          "extracted_at",
          "extracted_by",
          "issuer_name",
          "issuer_vat_id",
          "issuer_iban",
          "invoice_number",
          "issued_on",
          "due_on",
          "currency",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "tax_breakdown",
          "problems",
          "created_at",
          "updated_at",
          "ocr_request_id",
          "provenance"
        ],
        "additionalProperties": false
      },
      "YearEndSource_year_end_closures": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "uuid": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "preview_id": {
            "type": "integer"
          },
          "source_year_id": {
            "type": "integer"
          },
          "target_year_id": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "uuid",
          "tenant_id",
          "preview_id",
          "source_year_id",
          "target_year_id",
          "revision",
          "document_id",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_payment_allocations": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "invoice_line_id": {
            "type": "integer"
          },
          "payment_line_id": {
            "type": "integer"
          },
          "amount_cents": {
            "type": "integer"
          },
          "allocated_at": {
            "type": "string"
          },
          "allocated_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "account_id",
          "invoice_line_id",
          "payment_line_id",
          "amount_cents",
          "allocated_at",
          "allocated_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_year_end_withdrawals": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "closure_id": {
            "type": "integer"
          },
          "preview_id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "closure_id",
          "preview_id",
          "document_id",
          "reason",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_document_ocr_requests": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "tenant_id": {
            "type": "string"
          },
          "attempt": {
            "type": "integer"
          },
          "original_sha256": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "requested_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "checkpoint": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "document_id",
          "tenant_id",
          "attempt",
          "original_sha256",
          "status",
          "error_code",
          "requested_by",
          "started_at",
          "finished_at",
          "checkpoint",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_invoice_advance_closures": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "reference_id": {
            "type": "integer"
          },
          "receivable_line_id": {
            "type": "integer"
          },
          "closing_entry_id": {
            "type": "integer"
          },
          "closing_line_id": {
            "type": "integer"
          },
          "amount_cents": {
            "type": "integer"
          },
          "released_by_invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "reversal_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "reversal_line_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "reference_id",
          "receivable_line_id",
          "closing_entry_id",
          "closing_line_id",
          "amount_cents",
          "released_by_invoice_id",
          "reversal_entry_id",
          "reversal_line_id",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_reconciliation_decisions": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "bank_transaction_id": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "target_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "target_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "decided_by": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "bank_transaction_id",
          "status",
          "target_kind",
          "target_id",
          "account_id",
          "tax_key_id",
          "decided_by",
          "revision",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_settlement_skonto_groups": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "payment_allocation_id": {
            "type": "integer"
          },
          "invoice_entry_id": {
            "type": "integer"
          },
          "payment_entry_id": {
            "type": "integer"
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount_account_id": {
            "type": "integer"
          },
          "tax_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "plan": {},
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "payment_allocation_id",
          "invoice_entry_id",
          "payment_entry_id",
          "tax_key_id",
          "discount_account_id",
          "tax_account_id",
          "plan",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_advance_payment_tax_lines": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "payment_allocation_id": {
            "type": "integer"
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "net_cents": {
            "type": "integer"
          },
          "tax_cents": {
            "type": "integer"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "payment_allocation_id",
          "tax_key_id",
          "net_cents",
          "tax_cents",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_invoice_advance_references": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "final_invoice_id": {
            "type": "integer"
          },
          "advance_invoice_id": {
            "type": "integer"
          },
          "net_cents": {
            "type": "integer"
          },
          "tax_cents": {
            "type": "integer"
          },
          "gross_cents": {
            "type": "integer"
          },
          "tax_breakdown": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "is_correction": {
            "type": "boolean"
          },
          "released_by_invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "consumption_version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "final_invoice_id",
          "advance_invoice_id",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "tax_breakdown",
          "is_correction",
          "released_by_invoice_id",
          "created_at",
          "updated_at",
          "consumption_version"
        ],
        "additionalProperties": false
      },
      "YearEndSource_invoice_advance_consumptions": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "reference_id": {
            "type": "integer"
          },
          "payment_tax_line_id": {
            "type": "integer"
          },
          "source_consumption_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "cutoff_date": {
            "type": "string",
            "format": "date"
          },
          "net_cents": {
            "type": "integer"
          },
          "tax_cents": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "reference_id",
          "payment_tax_line_id",
          "source_consumption_id",
          "cutoff_date",
          "net_cents",
          "tax_cents",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource_year_end_previews": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "uuid": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "source_year_id": {
            "type": "integer"
          },
          "source_hash": {
            "type": "string"
          },
          "snapshot_hash": {
            "type": "string"
          },
          "snapshot": {},
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "uuid",
          "tenant_id",
          "operation",
          "source_year_id",
          "source_hash",
          "snapshot_hash",
          "snapshot",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "YearEndSource": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_accounts"
            }
          },
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_invoices"
            }
          },
          "tax_keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_tax_keys"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_documents"
            }
          },
          "asset_runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_asset_runs"
            }
          },
          "fiscal_years": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_fiscal_years"
            }
          },
          "fixed_assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_fixed_assets"
            }
          },
          "bank_accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_bank_accounts"
            }
          },
          "invoice_lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_invoice_lines"
            }
          },
          "journal_lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_journal_lines"
            }
          },
          "asset_closures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_asset_closures"
            }
          },
          "asset_postings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_asset_postings"
            }
          },
          "document_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_document_links"
            }
          },
          "document_seals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_document_seals"
            }
          },
          "asset_approvals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_asset_approvals"
            }
          },
          "asset_reversals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_asset_reversals"
            }
          },
          "bank_statements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_bank_statements"
            }
          },
          "journal_entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_journal_entries"
            }
          },
          "company_settings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_company_settings"
            }
          },
          "integrity_alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_integrity_alerts"
            }
          },
          "taxation_periods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_taxation_periods"
            }
          },
          "bank_transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_bank_transactions"
            }
          },
          "document_extracts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_document_extracts"
            }
          },
          "year_end_closures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_year_end_closures"
            }
          },
          "payment_allocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_payment_allocations"
            }
          },
          "year_end_withdrawals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_year_end_withdrawals"
            }
          },
          "document_ocr_requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_document_ocr_requests"
            }
          },
          "invoice_advance_closures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_invoice_advance_closures"
            }
          },
          "reconciliation_decisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_reconciliation_decisions"
            }
          },
          "settlement_skonto_groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_settlement_skonto_groups"
            }
          },
          "advance_payment_tax_lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_advance_payment_tax_lines"
            }
          },
          "invoice_advance_references": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_invoice_advance_references"
            }
          },
          "invoice_advance_consumptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_invoice_advance_consumptions"
            }
          }
        },
        "required": [
          "accounts",
          "invoices",
          "tax_keys",
          "documents",
          "asset_runs",
          "fiscal_years",
          "fixed_assets",
          "bank_accounts",
          "invoice_lines",
          "journal_lines",
          "asset_closures",
          "asset_postings",
          "document_links",
          "document_seals",
          "asset_approvals",
          "asset_reversals",
          "bank_statements",
          "journal_entries",
          "company_settings",
          "integrity_alerts",
          "taxation_periods",
          "bank_transactions",
          "document_extracts",
          "year_end_closures",
          "payment_allocations",
          "year_end_withdrawals",
          "document_ocr_requests",
          "invoice_advance_closures",
          "reconciliation_decisions",
          "settlement_skonto_groups",
          "advance_payment_tax_lines",
          "invoice_advance_references",
          "invoice_advance_consumptions"
        ],
        "additionalProperties": false
      },
      "YearEndLine": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "integer"
          },
          "debit_cents": {
            "type": "integer"
          },
          "credit_cents": {
            "type": "integer"
          }
        },
        "required": [
          "account_id",
          "debit_cents",
          "credit_cents"
        ],
        "additionalProperties": false
      },
      "YearEndPlannedJournal": {
        "type": "object",
        "properties": {
          "kind": {
            "enum": [
              "closing",
              "opening"
            ]
          },
          "position": {
            "type": "integer"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndLine"
            }
          }
        },
        "required": [
          "kind",
          "position",
          "date",
          "lines"
        ],
        "additionalProperties": false
      },
      "YearEndFinding": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "id": {
            "anyOf": [
              {
                "type": [
                  "integer",
                  "string"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "period": {
            "type": "string"
          },
          "remedy": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "remedy"
        ],
        "additionalProperties": false
      },
      "YearEndYear": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "year": {
            "type": "integer",
            "readOnly": true
          },
          "starts_on": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "ends_on": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "year",
          "starts_on",
          "ends_on",
          "closed_at",
          "created_at",
          "updated_at",
          "status"
        ],
        "additionalProperties": false,
        "description": "ISO dates for fiscal year; timestamps are returned as stored."
      },
      "YearEndJournal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "fiscal_year_id": {
            "type": "integer",
            "readOnly": true
          },
          "document_date": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "booking_date": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "recorded_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset.",
            "readOnly": true
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "description": {
            "type": "string",
            "readOnly": true
          },
          "reverses_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Zeitstempel als Text mit Zeitzonenoffset."
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_journal_lines"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "posted"
            ],
            "readOnly": true
          },
          "year_end_closure_id": {
            "type": "integer"
          },
          "year_end_kind": {
            "enum": [
              "closing",
              "opening",
              "closing_reversal",
              "opening_reversal"
            ]
          },
          "year_end_position": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "entry_number",
          "fiscal_year_id",
          "document_date",
          "booking_date",
          "recorded_at",
          "posted_at",
          "description",
          "reverses_entry_id",
          "created_by",
          "created_at",
          "updated_at",
          "lines",
          "status",
          "year_end_closure_id",
          "year_end_kind",
          "year_end_position"
        ],
        "additionalProperties": false
      },
      "YearEndCloseSnapshot": {
        "type": "object",
        "properties": {
          "version": {
            "const": "summator-year-end/1"
          },
          "scope": {
            "type": "string"
          },
          "operation": {
            "const": "close"
          },
          "source_year": {
            "$ref": "#/components/schemas/YearEndYear"
          },
          "options": {
            "type": "object",
            "properties": {
              "source_year_id": {
                "type": "integer"
              },
              "result_account_id": {
                "type": "integer"
              },
              "opening_account_id": {
                "type": "integer"
              },
              "create_target": {
                "type": "boolean"
              }
            },
            "required": [
              "source_year_id",
              "result_account_id",
              "opening_account_id",
              "create_target"
            ],
            "additionalProperties": false
          },
          "source": {
            "$ref": "#/components/schemas/YearEndSource"
          },
          "blockers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndFinding"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndFinding"
            }
          },
          "target_year": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/YearEndSource_fiscal_years"
              },
              {
                "type": "object",
                "properties": {
                  "year": {
                    "type": "integer"
                  },
                  "status": {
                    "const": "will_create"
                  }
                },
                "required": [
                  "year",
                  "status"
                ],
                "additionalProperties": false
              }
            ]
          },
          "result_cents": {
            "type": "integer"
          },
          "balances": {
            "type": [
              "object",
              "array"
            ],
            "additionalProperties": {
              "type": "integer"
            },
            "items": {
              "type": "integer"
            }
          },
          "carry_balances": {
            "type": [
              "object",
              "array"
            ],
            "additionalProperties": {
              "type": "integer"
            },
            "items": {
              "type": "integer"
            }
          },
          "journals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndPlannedJournal"
            }
          }
        },
        "required": [
          "version",
          "scope",
          "operation",
          "source_year",
          "options",
          "source",
          "blockers",
          "warnings",
          "target_year",
          "result_cents",
          "balances",
          "carry_balances",
          "journals"
        ],
        "additionalProperties": false
      },
      "YearEndReopenSnapshot": {
        "type": "object",
        "properties": {
          "version": {
            "const": "summator-year-end/1"
          },
          "scope": {
            "type": "string"
          },
          "operation": {
            "const": "reopen"
          },
          "source_year": {
            "$ref": "#/components/schemas/YearEndYear"
          },
          "options": {
            "type": "object",
            "properties": {
              "closure_id": {
                "type": "string",
                "format": "uuid"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "closure_id",
              "reason"
            ],
            "additionalProperties": false
          },
          "source": {
            "$ref": "#/components/schemas/YearEndSource"
          },
          "closure_id": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string"
          },
          "blockers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndFinding"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndFinding"
            }
          },
          "journals": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "entry_number": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "fiscal_year_id": {
                  "type": "integer"
                },
                "document_date": {
                  "type": "string",
                  "format": "date"
                },
                "booking_date": {
                  "type": "string",
                  "format": "date"
                },
                "recorded_at": {
                  "type": "string"
                },
                "posted_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "reverses_entry_id": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_by": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "updated_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "year_end_closure_id": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "year_end_kind": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "year_end_position": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "lines": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Source_journal_lines"
                  }
                }
              },
              "required": [
                "id",
                "entry_number",
                "fiscal_year_id",
                "document_date",
                "booking_date",
                "recorded_at",
                "posted_at",
                "status",
                "description",
                "reverses_entry_id",
                "created_by",
                "created_at",
                "updated_at",
                "year_end_closure_id",
                "year_end_kind",
                "year_end_position",
                "lines"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "version",
          "scope",
          "operation",
          "source_year",
          "options",
          "source",
          "closure_id",
          "reason",
          "blockers",
          "warnings",
          "journals"
        ],
        "additionalProperties": false
      },
      "YearEndSnapshot": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/YearEndCloseSnapshot"
          },
          {
            "$ref": "#/components/schemas/YearEndReopenSnapshot"
          }
        ]
      },
      "YearEndPreview": {
        "type": "object",
        "properties": {
          "preview_id": {
            "type": "string",
            "format": "uuid"
          },
          "snapshot_hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "snapshot": {
            "$ref": "#/components/schemas/YearEndSnapshot"
          }
        },
        "required": [
          "preview_id",
          "snapshot_hash",
          "snapshot"
        ],
        "additionalProperties": false
      },
      "YearEndProtocol": {
        "type": "object",
        "properties": {
          "closure": {
            "$ref": "#/components/schemas/YearEndSource_year_end_closures"
          },
          "status": {
            "enum": [
              "closed",
              "withdrawn"
            ]
          },
          "snapshot_hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "snapshot": {
            "$ref": "#/components/schemas/YearEndCloseSnapshot"
          },
          "withdrawal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/YearEndSource_year_end_withdrawals"
              },
              {
                "type": "null"
              }
            ]
          },
          "journals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndJournal"
            }
          }
        },
        "required": [
          "closure",
          "status",
          "snapshot_hash",
          "snapshot",
          "withdrawal",
          "journals"
        ],
        "additionalProperties": false
      },
      "YearEndList": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string"
          },
          "years": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndYear"
            }
          },
          "closures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_year_end_closures"
            }
          }
        },
        "required": [
          "scope",
          "years",
          "closures"
        ],
        "additionalProperties": false
      },
      "YearEndEnvelope": {
        "type": "object",
        "properties": {
          "data": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/YearEndPreview"
              },
              {
                "$ref": "#/components/schemas/YearEndProtocol"
              },
              {
                "$ref": "#/components/schemas/YearEndList"
              }
            ]
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "YearEndRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "operation": {
                "const": "list"
              }
            },
            "required": [
              "operation"
            ],
            "additionalProperties": true
          },
          {
            "type": "object",
            "properties": {
              "operation": {
                "const": "show"
              },
              "closure_id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "operation",
              "closure_id"
            ],
            "additionalProperties": true
          },
          {
            "type": "object",
            "properties": {
              "operation": {
                "const": "preview"
              },
              "source_year_id": {
                "type": "integer"
              },
              "result_account_id": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "opening_account_id": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "create_target": {
                "type": [
                  "boolean",
                  "integer",
                  "string"
                ],
                "enum": [
                  true,
                  false,
                  0,
                  1,
                  "0",
                  "1"
                ]
              }
            },
            "required": [
              "operation",
              "source_year_id",
              "create_target"
            ],
            "additionalProperties": true
          },
          {
            "type": "object",
            "properties": {
              "operation": {
                "const": "reopen_preview"
              },
              "closure_id": {
                "type": "string",
                "format": "uuid"
              },
              "reason": {
                "type": "string",
                "minLength": 10,
                "maxLength": 2000
              }
            },
            "required": [
              "operation",
              "closure_id",
              "reason"
            ],
            "additionalProperties": true
          },
          {
            "type": "object",
            "properties": {
              "operation": {
                "const": "close"
              },
              "preview_id": {
                "type": "string",
                "format": "uuid"
              },
              "snapshot_hash": {
                "type": "string",
                "minLength": 64,
                "maxLength": 64
              },
              "confirmed": {
                "enum": [
                  true,
                  1,
                  "1",
                  "yes",
                  "on",
                  "true"
                ]
              }
            },
            "required": [
              "operation",
              "preview_id",
              "snapshot_hash",
              "confirmed"
            ],
            "additionalProperties": true
          },
          {
            "type": "object",
            "properties": {
              "operation": {
                "const": "reopen"
              },
              "preview_id": {
                "type": "string",
                "format": "uuid"
              },
              "snapshot_hash": {
                "type": "string",
                "minLength": 64,
                "maxLength": 64
              },
              "confirmed": {
                "enum": [
                  true,
                  1,
                  "1",
                  "yes",
                  "on",
                  "true"
                ]
              }
            },
            "required": [
              "operation",
              "preview_id",
              "snapshot_hash",
              "confirmed"
            ],
            "additionalProperties": true
          }
        ],
        "description": "Only close/reopen book money. A preview persists an append-only review record. IDs and explicit account choices must come from the authorized user. Unknown input keys are ignored."
      },
      "Project99": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "responsible_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "budget_seconds": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "starts_on": {
            "type": "string"
          },
          "ends_on": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "budget_net_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "archived_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "account_id",
          "responsible_id",
          "created_by",
          "budget_seconds",
          "name",
          "starts_on",
          "ends_on",
          "created_at",
          "updated_at",
          "archived_at"
        ],
        "additionalProperties": false
      },
      "ProjectTask99": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "project_id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "article_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "name",
          "article_id",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ProjectSegment99": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "entry_id": {
            "type": "integer"
          },
          "started_at": {
            "type": "string"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "entry_id",
          "started_at",
          "ended_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ProjectTime99": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "project_id": {
            "type": "integer"
          },
          "task_id": {
            "type": "integer"
          },
          "user_id": {
            "type": "integer"
          },
          "duration_seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400
          },
          "service_date": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "source": {
            "enum": [
              "manual",
              "timer"
            ]
          },
          "status": {
            "enum": [
              "running",
              "paused",
              "finished"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "billable": {
            "type": "boolean"
          },
          "approved_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "approved_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectSegment99"
            }
          },
          "elapsed_seconds": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "project_id",
          "task_id",
          "user_id",
          "duration_seconds",
          "service_date",
          "timezone",
          "source",
          "status",
          "created_at",
          "updated_at",
          "comment",
          "billable",
          "approved_by",
          "approved_at"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "finished"
                }
              }
            },
            "then": {
              "properties": {
                "duration_seconds": {
                  "minimum": 1
                }
              }
            }
          }
        ]
      },
      "ProjectPriceOrigin99": {
        "type": "object",
        "properties": {
          "entry_id": {
            "type": "integer"
          },
          "task_id": {
            "type": "integer"
          },
          "service_date": {
            "type": "string"
          },
          "raw_seconds": {
            "type": "integer"
          },
          "billed_seconds": {
            "type": "integer"
          },
          "rounding": {
            "type": "string"
          },
          "rate": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "account_id": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "article_id": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unit": {
                "const": "HUR"
              },
              "amount_cents": {
                "type": "integer"
              },
              "valid_from": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "id",
              "account_id",
              "article_id",
              "unit",
              "amount_cents",
              "valid_from"
            ],
            "additionalProperties": false
          },
          "tax": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "code": {
                    "type": "string"
                  },
                  "rate_bp": {
                    "type": "integer"
                  },
                  "direction": {
                    "type": "string"
                  },
                  "category": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "account_id": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "code",
                  "rate_bp",
                  "direction",
                  "category",
                  "account_id"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "revenue_account_id": {
            "type": "integer"
          }
        },
        "required": [
          "entry_id",
          "task_id",
          "service_date",
          "raw_seconds",
          "billed_seconds",
          "rounding",
          "rate",
          "tax",
          "revenue_account_id"
        ],
        "additionalProperties": false
      },
      "ProjectInvoiceLine99": {
        "type": "object",
        "properties": {
          "article_id": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "quantity": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "unit": {
            "const": "HUR"
          },
          "unit_price_cents": {
            "type": "integer"
          },
          "tax_key_id": {
            "type": "integer"
          },
          "revenue_account_id": {
            "type": "integer"
          }
        },
        "required": [
          "article_id",
          "description",
          "detail",
          "quantity",
          "unit",
          "unit_price_cents",
          "tax_key_id",
          "revenue_account_id"
        ],
        "additionalProperties": false
      },
      "ProjectInvoicePreview99": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "integer"
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "attributes": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "integer"
              },
              "invoice_date": {
                "type": "string"
              },
              "service_period_from": {
                "type": "string"
              },
              "service_period_to": {
                "type": "string"
              }
            },
            "required": [
              "account_id",
              "invoice_date",
              "service_period_from",
              "service_period_to"
            ],
            "additionalProperties": false
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "article_id": {
                  "type": "integer"
                },
                "description": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{6}$"
                },
                "unit": {
                  "const": "HUR"
                },
                "unit_price_cents": {
                  "type": "integer"
                },
                "tax_key_id": {
                  "type": "integer"
                },
                "revenue_account_id": {
                  "type": "integer"
                }
              },
              "required": [
                "article_id",
                "description",
                "detail",
                "quantity",
                "unit",
                "unit_price_cents",
                "tax_key_id",
                "revenue_account_id"
              ],
              "additionalProperties": false
            }
          },
          "origins": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entry_id": {
                  "type": "integer"
                },
                "task_id": {
                  "type": "integer"
                },
                "service_date": {
                  "type": "string"
                },
                "raw_seconds": {
                  "type": "integer"
                },
                "billed_seconds": {
                  "type": "integer"
                },
                "rounding": {
                  "type": "string"
                },
                "rate": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "account_id": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "article_id": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unit": {
                      "const": "HUR"
                    },
                    "amount_cents": {
                      "type": "integer"
                    },
                    "valid_from": {
                      "type": "string",
                      "format": "date"
                    }
                  },
                  "required": [
                    "id",
                    "account_id",
                    "article_id",
                    "unit",
                    "amount_cents",
                    "valid_from"
                  ],
                  "additionalProperties": false
                },
                "tax": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "code": {
                          "type": "string"
                        },
                        "rate_bp": {
                          "type": "integer"
                        },
                        "direction": {
                          "type": "string"
                        },
                        "category": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "account_id": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "code",
                        "rate_bp",
                        "direction",
                        "category",
                        "account_id"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "revenue_account_id": {
                  "type": "integer"
                }
              },
              "required": [
                "entry_id",
                "task_id",
                "service_date",
                "raw_seconds",
                "billed_seconds",
                "rounding",
                "rate",
                "tax",
                "revenue_account_id"
              ],
              "additionalProperties": false
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "net_cents": {
                "type": "integer"
              },
              "tax_cents": {
                "type": "integer"
              },
              "gross_cents": {
                "type": "integer"
              }
            },
            "required": [
              "net_cents",
              "tax_cents",
              "gross_cents"
            ],
            "additionalProperties": false
          },
          "hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "project_id",
          "entries",
          "attributes",
          "lines",
          "origins",
          "totals",
          "hash"
        ],
        "additionalProperties": false
      },
      "ProjectBinding99": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "batch_id": {
            "type": "integer"
          },
          "project_id": {
            "type": "integer"
          },
          "entry_id": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "raw_seconds": {
            "type": "integer"
          },
          "billed_seconds": {
            "type": "integer"
          },
          "rate_id": {
            "type": "integer"
          },
          "quantity": {
            "type": "string"
          },
          "price_snapshot": {
            "type": "string"
          },
          "released_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "released_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "batch_id",
          "project_id",
          "entry_id",
          "position",
          "raw_seconds",
          "billed_seconds",
          "rate_id",
          "quantity",
          "price_snapshot",
          "released_at",
          "released_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ProjectBatch99": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "project_id": {
            "type": "integer"
          },
          "original_invoice_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "correction_invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "enum": [
              "draft",
              "issued",
              "discarded",
              "reversed"
            ]
          },
          "preview_hash": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "original_invoice_id",
          "created_by",
          "invoice_id",
          "correction_invoice_id",
          "status",
          "preview_hash",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ProjectBudget99": {
        "type": "object",
        "properties": {
          "budget_seconds": {
            "type": "integer"
          },
          "actual_seconds": {
            "type": "integer"
          },
          "remaining_seconds": {
            "type": "integer"
          },
          "hours_exceeded": {
            "type": "boolean"
          },
          "budget_net_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "open_billable_net_cents": {
            "type": "integer"
          },
          "unpriced_entry_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "reserved_draft_net_cents": {
            "type": "integer"
          },
          "invoiced_net_cents": {
            "type": "integer"
          },
          "reversed_net_cents": {
            "type": "integer"
          },
          "money_exceeded": {
            "type": "boolean"
          }
        },
        "required": [
          "budget_seconds",
          "actual_seconds",
          "remaining_seconds",
          "hours_exceeded"
        ],
        "additionalProperties": false
      },
      "ProjectWorkspace99": {
        "type": "object",
        "properties": {
          "project": {
            "$ref": "#/components/schemas/Project99"
          },
          "manager": {
            "type": "boolean"
          },
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectTask99"
            }
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectTime99"
            }
          },
          "budget": {
            "$ref": "#/components/schemas/ProjectBudget99"
          },
          "bindings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectBinding99"
            }
          },
          "batches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectBatch99"
            }
          },
          "members": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "user_id": {
                  "type": "integer"
                },
                "is_active": {
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "user_id",
                "is_active",
                "name"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "project",
          "manager",
          "tasks",
          "entries",
          "budget"
        ],
        "additionalProperties": false
      },
      "ProjectInvoiceOrigin99": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "integer"
          },
          "batch_id": {
            "type": "integer"
          },
          "original_invoice_id": {
            "type": "integer"
          },
          "correction_invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entry_id": {
                  "type": "integer"
                },
                "position": {
                  "type": "integer"
                },
                "raw_seconds": {
                  "type": "integer"
                },
                "billed_seconds": {
                  "type": "integer"
                },
                "quantity": {
                  "type": "string"
                },
                "rate_id": {
                  "type": "integer"
                },
                "price_snapshot": {
                  "type": "object",
                  "properties": {
                    "entry_id": {
                      "type": "integer"
                    },
                    "task_id": {
                      "type": "integer"
                    },
                    "service_date": {
                      "type": "string"
                    },
                    "raw_seconds": {
                      "type": "integer"
                    },
                    "billed_seconds": {
                      "type": "integer"
                    },
                    "rounding": {
                      "type": "string"
                    },
                    "rate": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "account_id": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "article_id": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "unit": {
                          "const": "HUR"
                        },
                        "amount_cents": {
                          "type": "integer"
                        },
                        "valid_from": {
                          "type": "string",
                          "format": "date"
                        }
                      },
                      "required": [
                        "id",
                        "account_id",
                        "article_id",
                        "unit",
                        "amount_cents",
                        "valid_from"
                      ],
                      "additionalProperties": false
                    },
                    "tax": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "code": {
                              "type": "string"
                            },
                            "rate_bp": {
                              "type": "integer"
                            },
                            "direction": {
                              "type": "string"
                            },
                            "category": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "account_id": {
                              "anyOf": [
                                {
                                  "type": "integer"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "code",
                            "rate_bp",
                            "direction",
                            "category",
                            "account_id"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "revenue_account_id": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "entry_id",
                    "task_id",
                    "service_date",
                    "raw_seconds",
                    "billed_seconds",
                    "rounding",
                    "rate",
                    "tax",
                    "revenue_account_id"
                  ],
                  "additionalProperties": false
                },
                "released_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "entry_id",
                "position",
                "raw_seconds",
                "billed_seconds",
                "quantity",
                "rate_id",
                "price_snapshot",
                "released_at"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "project_id",
          "batch_id",
          "original_invoice_id",
          "correction_invoice_id",
          "status",
          "entries"
        ],
        "additionalProperties": false
      },
      "ProjectBoundInvoice99": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "status": {
            "type": "string",
            "readOnly": true
          },
          "kind": {
            "type": "string",
            "readOnly": true
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "number_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "service_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "service_period_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "service_period_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "recipient_name": {
            "type": "string",
            "readOnly": true
          },
          "recipient_street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient_postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient_country": {
            "type": "string",
            "readOnly": true
          },
          "recipient_vat_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "recipient_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "buyer_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "currency": {
            "type": "string",
            "readOnly": true
          },
          "net_cents": {
            "type": "integer",
            "readOnly": true
          },
          "tax_cents": {
            "type": "integer",
            "readOnly": true
          },
          "gross_cents": {
            "type": "integer",
            "readOnly": true
          },
          "intro": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "closing": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "reverses_invoice_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "issued_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "issued_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "formatted_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "invoice_type": {
            "type": "string",
            "readOnly": true
          },
          "advance_account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "prepaid_net_cents": {
            "type": "integer",
            "readOnly": true
          },
          "prepaid_tax_cents": {
            "type": "integer",
            "readOnly": true
          },
          "prepaid_gross_cents": {
            "type": "integer",
            "readOnly": true
          },
          "advance_transfer_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "profile_snapshot": {
            "$ref": "#/components/schemas/ProfileSnapshot",
            "readOnly": true
          },
          "discount": {
            "$ref": "#/components/schemas/Discount",
            "readOnly": true
          },
          "pricing_snapshot": {
            "$ref": "#/components/schemas/PricingSnapshot",
            "readOnly": true
          },
          "skonto_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "skonto_percent_bp": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "readOnly": true
          },
          "payment_terms_snapshot": {
            "$ref": "#/components/schemas/PaymentTermsSnapshot",
            "readOnly": true
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineRecord"
            }
          },
          "business_process": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_endpoint": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_endpoint_scheme": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "buyer_endpoint": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "buyer_endpoint_scheme": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_contact_name": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_contact_phone": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "seller_contact_email": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "paid_via": {
            "type": [
              "string",
              "null"
            ],
            "readOnly": true
          },
          "invoice_profile": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "en16931",
              "xrechnung_3_0_2"
            ],
            "readOnly": true
          },
          "paid_means": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              null,
              "online"
            ],
            "readOnly": true
          },
          "clearing_account_id": {
            "type": [
              "integer",
              "null"
            ],
            "readOnly": true
          },
          "settlement_entry_id": {
            "type": [
              "integer",
              "null"
            ],
            "readOnly": true
          }
        },
        "required": [
          "id",
          "status",
          "kind",
          "number",
          "number_year",
          "invoice_date",
          "service_date",
          "service_period_from",
          "service_period_to",
          "due_date",
          "recipient_name",
          "recipient_street",
          "recipient_postal_code",
          "recipient_city",
          "recipient_country",
          "recipient_vat_id",
          "recipient_email",
          "buyer_reference",
          "account_id",
          "currency",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "intro",
          "closing",
          "reverses_invoice_id",
          "document_id",
          "journal_entry_id",
          "issued_at",
          "issued_by",
          "created_by",
          "created_at",
          "updated_at",
          "formatted_number",
          "invoice_type",
          "advance_account_id",
          "prepaid_net_cents",
          "prepaid_tax_cents",
          "prepaid_gross_cents",
          "advance_transfer_entry_id",
          "language",
          "profile_snapshot",
          "discount",
          "pricing_snapshot",
          "skonto_days",
          "skonto_percent_bp",
          "payment_terms_snapshot",
          "business_process",
          "seller_endpoint",
          "seller_endpoint_scheme",
          "buyer_endpoint",
          "buyer_endpoint_scheme",
          "seller_contact_name",
          "seller_contact_phone",
          "seller_contact_email",
          "paid_via",
          "invoice_profile",
          "paid_means",
          "clearing_account_id",
          "settlement_entry_id",
          "lines"
        ],
        "additionalProperties": false
      },
      "ProjectCreate99": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "account_id": {
            "type": "integer"
          },
          "responsible_id": {
            "type": "integer"
          },
          "starts_on": {
            "type": "string",
            "format": "date"
          },
          "ends_on": {
            "type": "string",
            "format": "date"
          },
          "budget_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 315360000
          },
          "budget_net_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 100000000000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "account_id",
          "responsible_id",
          "starts_on",
          "ends_on",
          "budget_seconds"
        ],
        "additionalProperties": false
      },
      "ProjectTimeInput99": {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "integer"
          },
          "service_date": {
            "type": "string",
            "format": "date"
          },
          "timezone": {
            "type": "string"
          },
          "comment": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "billable": {
            "type": "boolean"
          },
          "started_at": {
            "type": "string"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 86400
          },
          "timer": {
            "type": "boolean"
          }
        },
        "required": [
          "task_id",
          "service_date",
          "timezone",
          "billable"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "timer": {
                  "const": true
                }
              },
              "required": [
                "timer"
              ]
            },
            "then": {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "started_at"
                    ]
                  },
                  {
                    "required": [
                      "ended_at"
                    ]
                  },
                  {
                    "required": [
                      "duration_seconds"
                    ]
                  }
                ]
              }
            },
            "else": {
              "required": [
                "started_at"
              ],
              "anyOf": [
                {
                  "required": [
                    "ended_at"
                  ],
                  "properties": {
                    "ended_at": {
                      "type": "string"
                    }
                  }
                },
                {
                  "required": [
                    "duration_seconds"
                  ],
                  "properties": {
                    "duration_seconds": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                }
              ]
            }
          }
        ],
        "description": "Manual: started_at with seconds and actual zone offset plus ended_at or duration_seconds; both must agree. Timer=true prohibits start/end/duration; server time. At most one unfinished timer per user/tenant. Finished raw seconds are immutable. Overlaps across projects rejected. Historical agreed service date is explicit."
      },
      "ProjectInvoiceInput99": {
        "type": "object",
        "properties": {
          "entries": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "entries",
          "invoice_date"
        ],
        "additionalProperties": false
      },
      "ProjectInvoiceConfirm99": {
        "type": "object",
        "properties": {
          "entries": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "invoice_date": {
            "type": "string",
            "format": "date"
          },
          "preview_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "confirmed": {
            "const": true
          }
        },
        "required": [
          "entries",
          "invoice_date",
          "preview_hash",
          "confirmed"
        ],
        "additionalProperties": false
      },
      "DeltaProject99": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "responsible_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "budget_seconds": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "starts_on": {
            "type": "string"
          },
          "ends_on": {
            "type": "string"
          },
          "archived_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "workspace": {
            "$ref": "#/components/schemas/ProjectWorkspace99"
          }
        },
        "required": [
          "id",
          "account_id",
          "responsible_id",
          "created_by",
          "budget_seconds",
          "name",
          "starts_on",
          "ends_on",
          "archived_at",
          "workspace"
        ],
        "additionalProperties": false
      },
      "DeltaProjectTime99": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "project_id": {
            "type": "integer"
          },
          "task_id": {
            "type": "integer"
          },
          "user_id": {
            "type": "integer"
          },
          "duration_seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400
          },
          "service_date": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "source": {
            "enum": [
              "manual",
              "timer"
            ]
          },
          "status": {
            "enum": [
              "running",
              "paused",
              "finished"
            ]
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "billable": {
            "type": "boolean"
          },
          "approved_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "approved_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "started_at": {
                  "type": "string"
                },
                "ended_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "started_at",
                "ended_at"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "project_id",
          "task_id",
          "user_id",
          "duration_seconds",
          "service_date",
          "timezone",
          "source",
          "status",
          "comment",
          "billable",
          "approved_by",
          "approved_at",
          "segments"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "finished"
                }
              }
            },
            "then": {
              "properties": {
                "duration_seconds": {
                  "minimum": 1
                }
              }
            }
          }
        ]
      },
      "BalanceMappingInput": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "integer"
          },
          "row": {
            "type": "string",
            "enum": [
              "intangible",
              "tangible",
              "financial",
              "inventory",
              "trade_receivables",
              "other_assets",
              "securities",
              "cash_bank",
              "prepaid_assets",
              "capital",
              "capital_reserve",
              "profit_reserve",
              "retained",
              "provisions",
              "bank_debt",
              "advances",
              "trade_payables",
              "other_liabilities",
              "prepaid_liabilities"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 10,
            "maxLength": 1000
          },
          "origin": {
            "type": "string",
            "minLength": 5,
            "maxLength": 1000
          }
        },
        "required": [
          "account_id",
          "row",
          "reason",
          "origin"
        ],
        "additionalProperties": false
      },
      "BalanceMapping": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "integer"
          },
          "row": {
            "type": "string",
            "enum": [
              "intangible",
              "tangible",
              "financial",
              "inventory",
              "trade_receivables",
              "other_assets",
              "securities",
              "cash_bank",
              "prepaid_assets",
              "capital",
              "capital_reserve",
              "profit_reserve",
              "retained",
              "provisions",
              "bank_debt",
              "advances",
              "trade_payables",
              "other_liabilities",
              "prepaid_liabilities"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 10,
            "maxLength": 1000
          },
          "origin": {
            "type": "string",
            "minLength": 5,
            "maxLength": 1000
          },
          "account_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          },
          "version": {
            "const": "report-mapping/1"
          }
        },
        "required": [
          "account_id",
          "row",
          "reason",
          "origin",
          "account_hash",
          "created_by",
          "created_at",
          "version"
        ],
        "additionalProperties": false
      },
      "BalanceOptions": {
        "type": "object",
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date"
          },
          "schema": {
            "const": "summator-balance-sheet/2"
          },
          "mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceMappingInput"
            }
          }
        },
        "required": [
          "as_of",
          "schema",
          "mappings"
        ],
        "additionalProperties": false
      },
      "BalanceDocument": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "original_name": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "original_name",
          "sha256",
          "document_date"
        ],
        "additionalProperties": false
      },
      "BalanceClosure": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "uuid": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "preview_id": {
            "type": "integer"
          },
          "source_year_id": {
            "type": "integer"
          },
          "target_year_id": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          },
          "snapshot_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "result_cents": {
            "type": "integer"
          },
          "options": {
            "type": "object",
            "properties": {
              "source_year_id": {
                "type": "integer"
              },
              "result_account_id": {
                "type": "integer"
              },
              "opening_account_id": {
                "type": "integer"
              },
              "create_target": {
                "type": "boolean"
              }
            },
            "required": [
              "source_year_id",
              "result_account_id",
              "opening_account_id",
              "create_target"
            ],
            "additionalProperties": false
          },
          "carry_balances": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              {
                "type": "array",
                "maxItems": 0
              }
            ]
          }
        },
        "required": [
          "id",
          "uuid",
          "tenant_id",
          "preview_id",
          "source_year_id",
          "target_year_id",
          "revision",
          "document_id",
          "created_by",
          "created_at",
          "snapshot_hash",
          "source_hash",
          "result_cents",
          "options",
          "carry_balances"
        ],
        "additionalProperties": false
      },
      "BalanceEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "fiscal_year_id": {
            "type": "integer"
          },
          "document_date": {
            "type": "string",
            "format": "date"
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "recorded_at": {
            "type": "string"
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "reverses_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "year_end_closure_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "year_end_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "year_end_position": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_journal_lines"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceDocument"
            }
          }
        },
        "required": [
          "id",
          "entry_number",
          "fiscal_year_id",
          "document_date",
          "booking_date",
          "recorded_at",
          "posted_at",
          "status",
          "description",
          "reverses_entry_id",
          "created_by",
          "created_at",
          "updated_at",
          "year_end_closure_id",
          "year_end_kind",
          "year_end_position",
          "lines",
          "documents"
        ],
        "additionalProperties": false
      },
      "BalanceSource": {
        "type": "object",
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "company": {
            "type": "object",
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "chart": {
                "enum": [
                  "SKR03",
                  "SKR04"
                ]
              },
              "legal_form": {
                "const": "corporation"
              },
              "taxation": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "name",
              "chart",
              "legal_form",
              "taxation"
            ],
            "additionalProperties": false
          },
          "fiscal_years": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_fiscal_years"
            }
          },
          "closures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceClosure"
            }
          },
          "withdrawals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_year_end_withdrawals"
            }
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_accounts"
            }
          },
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source_guv_revisions"
            }
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceEntry"
            }
          },
          "document_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YearEndSource_document_links"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceDocument"
            }
          },
          "foreign_currencies": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "table": {
                  "enum": [
                    "bank_accounts",
                    "invoices"
                  ]
                },
                "id": {
                  "type": "integer"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "table",
                "id",
                "currency"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "tenant_id",
          "company",
          "fiscal_years",
          "closures",
          "withdrawals",
          "accounts",
          "revisions",
          "entries",
          "document_links",
          "documents",
          "foreign_currencies"
        ],
        "additionalProperties": false
      },
      "BalanceFinding": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "severity": {
            "enum": [
              "blocker",
              "warning",
              "notice"
            ]
          },
          "account_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "entry_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "remedy": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "severity",
          "account_id",
          "entry_ids",
          "remedy"
        ],
        "additionalProperties": false
      },
      "BalanceLine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "debit_cents": {
            "type": "integer"
          },
          "credit_cents": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tax_key_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "entry_id": {
            "type": "integer"
          },
          "entry_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "booking_date": {
            "type": "string",
            "format": "date"
          },
          "reverses_entry_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "year_end_closure_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "year_end_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "excluded_closing": {
            "type": "boolean"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceDocument"
            }
          },
          "cost_center_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Current optional cost-center provenance from actual journal_lines; absent only in historical frozen reports."
          },
          "cost_center_source_line_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Current optional cost-center provenance from actual journal_lines; absent only in historical frozen reports."
          }
        },
        "required": [
          "id",
          "journal_entry_id",
          "account_id",
          "debit_cents",
          "credit_cents",
          "position",
          "description",
          "created_at",
          "updated_at",
          "tax_key_id",
          "entry_id",
          "entry_number",
          "booking_date",
          "reverses_entry_id",
          "year_end_closure_id",
          "year_end_kind",
          "excluded_closing",
          "documents"
        ],
        "additionalProperties": false
      },
      "BalanceResultTransfer": {
        "type": "object",
        "properties": {
          "closure_id": {
            "type": "integer"
          },
          "closure_uuid": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "from_row": {
            "type": "string"
          },
          "to_row": {
            "const": "retained"
          },
          "cents": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceResultComponent"
            },
            "description": "Cumulative active-chain result components on this actual account; absent only in frozen historical reports."
          }
        },
        "required": [
          "closure_id",
          "closure_uuid",
          "revision",
          "from_row",
          "to_row",
          "cents",
          "reason"
        ],
        "additionalProperties": false
      },
      "BalanceAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "chart": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "category_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "personal_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_box": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_reportable": {
            "type": "boolean"
          },
          "raw_balance_cents": {
            "type": "integer"
          },
          "excluded_closing_cents": {
            "type": "integer"
          },
          "balance_cents": {
            "type": "integer"
          },
          "row": {
            "anyOf": [
              {
                "enum": [
                  "intangible",
                  "tangible",
                  "financial",
                  "inventory",
                  "trade_receivables",
                  "other_assets",
                  "securities",
                  "cash_bank",
                  "prepaid_assets",
                  "capital",
                  "capital_reserve",
                  "profit_reserve",
                  "retained",
                  "result",
                  "provisions",
                  "bank_debt",
                  "advances",
                  "trade_payables",
                  "other_liabilities",
                  "prepaid_liabilities"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "origin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceLine"
            }
          },
          "display_cents": {
            "type": "integer"
          },
          "mapping": {
            "$ref": "#/components/schemas/BalanceMapping"
          },
          "result_transfer": {
            "$ref": "#/components/schemas/BalanceResultTransfer"
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "type",
          "chart",
          "is_active",
          "created_at",
          "updated_at",
          "category",
          "category_code",
          "personal_kind",
          "vat_box",
          "vat_reportable",
          "raw_balance_cents",
          "excluded_closing_cents",
          "balance_cents",
          "row",
          "origin",
          "lines"
        ],
        "additionalProperties": false
      },
      "BalancePeriod": {
        "type": "object",
        "properties": {
          "available": {
            "const": true
          },
          "as_of": {
            "type": "string",
            "format": "date"
          },
          "fiscal_year": {
            "$ref": "#/components/schemas/YearEndSource_fiscal_years"
          },
          "opening_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "opening_closure": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BalanceClosure"
              },
              {
                "type": "null"
              }
            ]
          },
          "closure": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BalanceClosure"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "enum": [
              "provisional",
              "closed_internal",
              "incomplete"
            ]
          },
          "totals": {
            "type": "object",
            "properties": {
              "intangible": {
                "type": "integer"
              },
              "tangible": {
                "type": "integer"
              },
              "financial": {
                "type": "integer"
              },
              "inventory": {
                "type": "integer"
              },
              "trade_receivables": {
                "type": "integer"
              },
              "other_assets": {
                "type": "integer"
              },
              "securities": {
                "type": "integer"
              },
              "cash_bank": {
                "type": "integer"
              },
              "prepaid_assets": {
                "type": "integer"
              },
              "capital": {
                "type": "integer"
              },
              "capital_reserve": {
                "type": "integer"
              },
              "profit_reserve": {
                "type": "integer"
              },
              "retained": {
                "type": "integer"
              },
              "result": {
                "type": "integer"
              },
              "provisions": {
                "type": "integer"
              },
              "bank_debt": {
                "type": "integer"
              },
              "advances": {
                "type": "integer"
              },
              "trade_payables": {
                "type": "integer"
              },
              "other_liabilities": {
                "type": "integer"
              },
              "prepaid_liabilities": {
                "type": "integer"
              }
            },
            "required": [
              "intangible",
              "tangible",
              "financial",
              "inventory",
              "trade_receivables",
              "other_assets",
              "securities",
              "cash_bank",
              "prepaid_assets",
              "capital",
              "capital_reserve",
              "profit_reserve",
              "retained",
              "result",
              "provisions",
              "bank_debt",
              "advances",
              "trade_payables",
              "other_liabilities",
              "prepaid_liabilities"
            ],
            "additionalProperties": false
          },
          "groups": {
            "type": "object",
            "properties": {
              "fixed": {
                "type": "integer"
              },
              "current": {
                "type": "integer"
              },
              "other_assets": {
                "type": "integer"
              },
              "equity": {
                "type": "integer"
              },
              "provisions": {
                "type": "integer"
              },
              "debt": {
                "type": "integer"
              },
              "other_liabilities": {
                "type": "integer"
              }
            },
            "required": [
              "fixed",
              "current",
              "other_assets",
              "equity",
              "provisions",
              "debt",
              "other_liabilities"
            ],
            "additionalProperties": false
          },
          "assets_cents": {
            "type": "integer"
          },
          "liabilities_cents": {
            "type": "integer"
          },
          "difference_cents": {
            "type": "integer"
          },
          "raw_journal_difference_cents": {
            "type": "integer"
          },
          "unmapped_balance_cents": {
            "type": "integer"
          },
          "profit": {
            "$ref": "#/components/schemas/GuvCalculation"
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceAccount"
            }
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceFinding"
            }
          },
          "blocker_count": {
            "type": "integer"
          },
          "opening_chain": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceClosure"
            },
            "description": "Chronological active carry chain used by new calculations. Withdrawn revisions excluded. Absent in frozen historical reports."
          }
        },
        "required": [
          "available",
          "as_of",
          "fiscal_year",
          "opening_from",
          "opening_closure",
          "closure",
          "status",
          "totals",
          "groups",
          "assets_cents",
          "liabilities_cents",
          "difference_cents",
          "raw_journal_difference_cents",
          "unmapped_balance_cents",
          "profit",
          "accounts",
          "findings",
          "blocker_count"
        ],
        "additionalProperties": false
      },
      "BalanceMissingYear": {
        "type": "object",
        "properties": {
          "available": {
            "const": false
          },
          "as_of": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "const": "missing_year"
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceFinding"
            }
          }
        },
        "required": [
          "available",
          "as_of",
          "status",
          "findings"
        ],
        "additionalProperties": false
      },
      "BalanceMappingHistory": {
        "type": "object",
        "properties": {
          "supersedes_snapshot_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "previous_mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceMapping"
            }
          },
          "changed_account_id": {
            "type": "integer"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "supersedes_snapshot_hash",
          "source_hash",
          "previous_mappings",
          "changed_account_id",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "BalanceSnapshot": {
        "type": "object",
        "properties": {
          "contract": {
            "const": "summator-balance-sheet/2"
          },
          "schema_name": {
            "const": "Internes Summator-Bilanzschema/2"
          },
          "scope": {
            "type": "string"
          },
          "rule_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "legal_sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources_checked_on": {
            "type": "string",
            "format": "date"
          },
          "tenant_id": {
            "type": "string"
          },
          "generated_at": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "options": {
            "$ref": "#/components/schemas/BalanceOptions"
          },
          "mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceMapping"
            }
          },
          "rows": {
            "type": "object",
            "properties": {
              "intangible": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "tangible": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "financial": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "inventory": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "trade_receivables": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "other_assets": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "securities": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "cash_bank": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "prepaid_assets": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "capital": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "capital_reserve": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "profit_reserve": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "retained": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "result": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "provisions": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "bank_debt": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "advances": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "trade_payables": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "other_liabilities": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              },
              "prepaid_liabilities": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "side": {
                    "enum": [
                      "assets",
                      "liabilities"
                    ]
                  },
                  "group": {
                    "type": "string"
                  }
                },
                "required": [
                  "label",
                  "side",
                  "group"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "intangible",
              "tangible",
              "financial",
              "inventory",
              "trade_receivables",
              "other_assets",
              "securities",
              "cash_bank",
              "prepaid_assets",
              "capital",
              "capital_reserve",
              "profit_reserve",
              "retained",
              "result",
              "provisions",
              "bank_debt",
              "advances",
              "trade_payables",
              "other_liabilities",
              "prepaid_liabilities"
            ],
            "additionalProperties": false
          },
          "source_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source": {
            "$ref": "#/components/schemas/BalanceSource"
          },
          "current": {
            "$ref": "#/components/schemas/BalancePeriod"
          },
          "comparison": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BalancePeriod"
              },
              {
                "$ref": "#/components/schemas/BalanceMissingYear"
              }
            ]
          },
          "snapshot_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "mapping_history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceMappingHistory"
            }
          }
        },
        "required": [
          "contract",
          "schema_name",
          "scope",
          "rule_hash",
          "legal_sources",
          "sources_checked_on",
          "tenant_id",
          "generated_at",
          "locale",
          "options",
          "mappings",
          "rows",
          "source_hash",
          "source",
          "current",
          "comparison",
          "snapshot_hash"
        ],
        "additionalProperties": false
      },
      "BalanceState": {
        "type": "object",
        "properties": {
          "report": {
            "$ref": "#/components/schemas/BalanceSnapshot"
          },
          "binding": {
            "type": "string"
          },
          "stale": {
            "type": "boolean"
          }
        },
        "required": [
          "report",
          "binding",
          "stale"
        ],
        "additionalProperties": false
      },
      "BalanceEnvelope": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/BalanceState"
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": true
      },
      "BalanceReadRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "binding": {
                "type": "string",
                "maxLength": 16000000
              }
            },
            "required": [
              "binding"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "as_of": {
                "type": "string",
                "format": "date"
              },
              "schema": {
                "const": "summator-balance-sheet/2"
              },
              "mappings": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BalanceMappingInput"
                }
              }
            },
            "required": [
              "as_of",
              "schema"
            ],
            "additionalProperties": false
          }
        ]
      },
      "BalanceMapRequest": {
        "type": "object",
        "properties": {
          "binding": {
            "type": "string"
          },
          "account_id": {
            "type": "integer"
          },
          "row": {
            "type": "string",
            "enum": [
              "intangible",
              "tangible",
              "financial",
              "inventory",
              "trade_receivables",
              "other_assets",
              "securities",
              "cash_bank",
              "prepaid_assets",
              "capital",
              "capital_reserve",
              "profit_reserve",
              "retained",
              "provisions",
              "bank_debt",
              "advances",
              "trade_payables",
              "other_liabilities",
              "prepaid_liabilities"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 10,
            "maxLength": 1000
          },
          "origin": {
            "type": "string",
            "minLength": 5,
            "maxLength": 1000
          }
        },
        "required": [
          "binding",
          "account_id",
          "row",
          "reason",
          "origin"
        ],
        "additionalProperties": false
      },
      "BalanceDownloadRequest": {
        "type": "object",
        "properties": {
          "binding": {
            "type": "string"
          },
          "snapshot_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "format": {
            "enum": [
              "html",
              "csv",
              "json"
            ]
          },
          "confidential": {
            "const": true
          },
          "historical": {
            "type": "boolean"
          }
        },
        "required": [
          "binding",
          "snapshot_hash",
          "format",
          "confidential"
        ],
        "additionalProperties": false
      },
      "BalanceError": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": true
      },
      "BalanceResultComponent": {
        "type": "object",
        "properties": {
          "closure_id": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "source_year_id": {
            "type": "integer"
          },
          "target_year_id": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "cents": {
            "type": "integer"
          },
          "closure_uuid": {
            "type": "string"
          },
          "journal_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        },
        "required": [
          "closure_id",
          "revision",
          "source_year_id",
          "target_year_id",
          "account_id",
          "cents",
          "closure_uuid",
          "journal_ids"
        ],
        "additionalProperties": false
      },
      "CostCenter89": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": "string",
            "pattern": "^[0-9]{1,8}$"
          },
          "name": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "is_active"
        ],
        "additionalProperties": false
      },
      "CostCenterInput89": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "pattern": "^[0-9]{1,8}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "number",
          "name",
          "is_active"
        ],
        "additionalProperties": false
      },
      "CostSplit89": {
        "type": "object",
        "properties": {
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "net_cents": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "cost_center_id",
          "net_cents"
        ],
        "additionalProperties": false
      },
      "CostCenterTotals89": {
        "type": "object",
        "properties": {
          "revenue_cents": {
            "type": "integer"
          },
          "expense_cents": {
            "type": "integer"
          },
          "result_cents": {
            "type": "integer"
          }
        },
        "required": [
          "revenue_cents",
          "expense_cents",
          "result_cents"
        ],
        "additionalProperties": false
      },
      "CostCenterSnapshot89": {
        "type": "object",
        "properties": {
          "contract": {
            "const": "summator-cost-centers/1"
          },
          "tenant_id": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "generated_at": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/CostCenterTotals89"
          },
          "differences": {
            "$ref": "#/components/schemas/CostCenterTotals89"
          },
          "excluded_closing": {
            "$ref": "#/components/schemas/CostCenterTotals89"
          },
          "raw_result_cents": {
            "type": "integer"
          },
          "audit_cutoff": {
            "type": "integer"
          },
          "posted_entry_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostCenterGroup89"
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostCenterLine89"
            }
          },
          "excluded_lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostCenterExcludedLine89"
            }
          },
          "draft_entry_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "source_accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostCenterAccountSource89"
            }
          },
          "tax_account_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "unknown_accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostCenterAccountSource89"
            }
          },
          "status": {
            "const": "provisional"
          },
          "unit": {
            "const": "EUR cent"
          },
          "notice": {
            "type": "string"
          },
          "labels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "missing_original_entry_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        },
        "required": [
          "contract",
          "tenant_id",
          "period",
          "generated_at",
          "total",
          "differences",
          "excluded_closing",
          "raw_result_cents",
          "audit_cutoff",
          "posted_entry_ids",
          "groups",
          "lines",
          "excluded_lines",
          "draft_entry_ids",
          "source_accounts",
          "tax_account_ids",
          "unknown_accounts",
          "status",
          "unit",
          "notice",
          "labels",
          "missing_original_entry_ids"
        ],
        "additionalProperties": false
      },
      "CostCenterReport89": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "snapshot_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "snapshot": {
            "$ref": "#/components/schemas/CostCenterSnapshot89"
          }
        },
        "required": [
          "id",
          "snapshot_hash",
          "snapshot"
        ],
        "additionalProperties": false
      },
      "CostCenterGroup89": {
        "type": "object",
        "properties": {
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{1,8}$"
          },
          "name": {
            "type": "string"
          },
          "is_active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "revenue_cents": {
            "type": "integer"
          },
          "expense_cents": {
            "type": "integer"
          },
          "result_cents": {
            "type": "integer"
          }
        },
        "required": [
          "cost_center_id",
          "number",
          "name",
          "is_active",
          "revenue_cents",
          "expense_cents",
          "result_cents"
        ],
        "additionalProperties": false
      },
      "CostCenterOriginal89": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "original_name": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "id",
          "journal_entry_id",
          "original_name",
          "sha256"
        ],
        "additionalProperties": false
      },
      "CostCenterLine89": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "debit_cents": {
            "type": "integer"
          },
          "credit_cents": {
            "type": "integer"
          },
          "entry_number": {
            "type": "integer"
          },
          "result_cents": {
            "type": "integer"
          },
          "tax_key_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reverses_entry_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cost_center_source_line_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "account_name": {
            "type": "string"
          },
          "account_number": {
            "type": "string"
          },
          "account_type": {
            "type": "string"
          },
          "booking_date": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "cost_center_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "cost_center_name": {
            "type": "string"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostCenterOriginal89"
            }
          }
        },
        "required": [
          "id",
          "position",
          "account_id",
          "journal_entry_id",
          "debit_cents",
          "credit_cents",
          "entry_number",
          "result_cents",
          "tax_key_id",
          "reverses_entry_id",
          "cost_center_id",
          "cost_center_source_line_id",
          "account_name",
          "account_number",
          "account_type",
          "booking_date",
          "created_at",
          "updated_at",
          "description",
          "cost_center_number",
          "cost_center_name",
          "documents"
        ],
        "additionalProperties": false
      },
      "CostCenterExcludedLine89": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "account_id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "debit_cents": {
            "type": "integer"
          },
          "credit_cents": {
            "type": "integer"
          },
          "entry_number": {
            "type": "integer"
          },
          "result_cents": {
            "type": "integer"
          },
          "tax_key_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reverses_entry_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cost_center_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cost_center_source_line_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "account_name": {
            "type": "string"
          },
          "account_number": {
            "type": "string"
          },
          "account_type": {
            "type": "string"
          },
          "booking_date": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostCenterOriginal89"
            }
          },
          "year_end_closure_id": {
            "type": "integer"
          },
          "year_end_kind": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "position",
          "account_id",
          "journal_entry_id",
          "debit_cents",
          "credit_cents",
          "entry_number",
          "result_cents",
          "tax_key_id",
          "reverses_entry_id",
          "cost_center_id",
          "cost_center_source_line_id",
          "account_name",
          "account_number",
          "account_type",
          "booking_date",
          "created_at",
          "updated_at",
          "description",
          "documents",
          "year_end_closure_id",
          "year_end_kind"
        ],
        "additionalProperties": false
      },
      "CostCenterAccountSource89": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "personal_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "chart": {
            "type": "string",
            "enum": [
              "SKR03",
              "SKR04"
            ]
          },
          "vat_box": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat_reportable": {
            "type": "boolean"
          },
          "category_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "type",
          "personal_kind",
          "category",
          "chart",
          "vat_box",
          "vat_reportable",
          "category_code",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "QuotePortalGrant": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "uuid",
          "quote_id",
          "recipient_name",
          "recipient_email",
          "created_at",
          "expires_at",
          "revoked_at",
          "revocation_reason",
          "decision",
          "decided_at",
          "method"
        ],
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid"
          },
          "quote_id": {
            "type": "integer",
            "minimum": 1
          },
          "recipient_name": {
            "type": "string"
          },
          "recipient_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "revocation_reason": {
            "enum": [
              null,
              "revoked",
              "replaced"
            ]
          },
          "decision": {
            "enum": [
              null,
              "accepted",
              "rejected"
            ]
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "method": {
            "enum": [
              null,
              "bearer_explicit_confirmation"
            ]
          }
        }
      },
      "QuotePortalHistory": {
        "type": "object",
        "required": [
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuotePortalGrant"
            }
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        }
      },
      "QuotePortalIssued": {
        "type": "object",
        "required": [
          "data",
          "link"
        ],
        "additionalProperties": false,
        "properties": {
          "data": {
            "$ref": "#/components/schemas/QuotePortalGrant"
          },
          "link": {
            "type": "string",
            "format": "uri",
            "description": "Einmalige geheim zu haltende Fragment-URL; nicht protokollieren oder speichern. Steht nur in der Antwort auf die Freigabe, nie in Listen, MCP oder Delta."
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          }
        }
      },
      "SelfBillingParty": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "street": {
            "type": [
              "string",
              "null"
            ]
          },
          "postal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "vat_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_number": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "street",
          "postal_code",
          "city",
          "country",
          "vat_id"
        ],
        "additionalProperties": false
      },
      "SelfBillingLine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "self_billing_id": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "expense_account_id": {
            "type": "integer"
          },
          "net_cents": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "self_billing_id",
          "position",
          "description",
          "expense_account_id",
          "net_cents"
        ],
        "additionalProperties": false
      },
      "SelfBillingAgreement": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "creditor_id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "document_sha256": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "agreed_on": {
            "type": "string"
          },
          "valid_from": {
            "type": "string"
          },
          "valid_until": {
            "type": "string"
          },
          "profile": {
            "type": "string"
          },
          "supplier": {
            "$ref": "#/components/schemas/SelfBillingParty"
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "creditor_id",
          "document_id",
          "document_sha256",
          "reference",
          "agreed_on",
          "valid_from",
          "valid_until",
          "profile",
          "supplier",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "SelfBillingEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "self_billing_id": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "occurred_on": {
            "type": "string"
          },
          "document_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "document_sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_by": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "self_billing_id",
          "kind",
          "reason",
          "occurred_on",
          "document_id",
          "document_sha256",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "SelfBilling": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "agreement_id": {
            "type": "integer"
          },
          "creditor_id": {
            "type": "integer"
          },
          "document_date": {
            "type": "string"
          },
          "service_from": {
            "type": "string"
          },
          "service_until": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "output_profile": {
            "type": "string"
          },
          "recipient": {
            "$ref": "#/components/schemas/SelfBillingParty"
          },
          "supplier": {
            "$ref": "#/components/schemas/SelfBillingParty"
          },
          "net_cents": {
            "type": "integer"
          },
          "tax_cents": {
            "type": "integer"
          },
          "gross_cents": {
            "type": "integer"
          },
          "tax_key_id": {
            "type": "integer"
          },
          "tax_account_id": {
            "type": "integer"
          },
          "correction_of_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "correction_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "document_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "document_sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "facts_sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "journal_entry_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_by": {
            "type": "integer"
          },
          "issued_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "issued_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SelfBillingLine"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SelfBillingEvent"
            }
          }
        },
        "required": [
          "id",
          "status",
          "agreement_id",
          "creditor_id",
          "document_date",
          "service_from",
          "service_until",
          "currency",
          "output_profile",
          "recipient",
          "supplier",
          "net_cents",
          "tax_cents",
          "gross_cents",
          "tax_key_id",
          "tax_account_id",
          "correction_of_id",
          "correction_reason",
          "revision",
          "number",
          "document_id",
          "document_sha256",
          "facts_sha256",
          "journal_entry_id",
          "created_by",
          "issued_by",
          "issued_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "SelfBillingInput": {
        "type": "object",
        "properties": {
          "agreement_id": {
            "type": "integer"
          },
          "document_date": {
            "type": "string",
            "format": "date"
          },
          "service_from": {
            "type": "string",
            "format": "date"
          },
          "service_until": {
            "type": "string",
            "format": "date"
          },
          "currency": {
            "const": "EUR"
          },
          "output_profile": {
            "const": "pdf"
          },
          "tax_key_id": {
            "type": "integer"
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                },
                "expense_account_id": {
                  "type": "integer"
                },
                "net_cents": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100000000000
                }
              },
              "required": [
                "description",
                "expense_account_id",
                "net_cents"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "agreement_id",
          "document_date",
          "service_from",
          "service_until",
          "currency",
          "output_profile",
          "tax_key_id",
          "lines"
        ],
        "additionalProperties": false
      },
      "SelfBillingAgreementInput": {
        "type": "object",
        "properties": {
          "creditor_id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "reference": {
            "type": "string"
          },
          "agreed_on": {
            "type": "string"
          },
          "valid_from": {
            "type": "string"
          },
          "valid_until": {
            "type": "string"
          },
          "profile": {
            "const": "de_eur_regular19_pdf_synthetic_v1"
          }
        },
        "required": [
          "creditor_id",
          "document_id",
          "reference",
          "agreed_on",
          "valid_from",
          "valid_until",
          "profile"
        ],
        "additionalProperties": false
      },
      "SelfBillingError": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "missing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Problem"
            }
          },
          "error": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "eingerichtet": {
            "type": "boolean"
          },
          "period": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              }
            },
            "required": [
              "key",
              "label",
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "setup": {
            "type": "object",
            "properties": {
              "complete": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "complete",
              "message",
              "missing"
            ],
            "additionalProperties": false
          },
          "billing": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "overdue",
                  "payment_failed"
                ]
              },
              "can_write": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "due_by": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "amount_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "transfer": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "required": [
              "status",
              "can_write",
              "message",
              "due_by",
              "amount_cents",
              "reference",
              "transfer"
            ],
            "additionalProperties": false
          },
          "code": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "anyOf": [
          {
            "required": [
              "message"
            ]
          },
          {
            "required": [
              "code"
            ]
          }
        ]
      },
      "FxRate": {
        "type": "object",
        "properties": {
          "rate": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,3})(?:\\.[0-9]{1,8})?$"
          },
          "direction": {
            "type": "string",
            "enum": [
              "EUR_per_USD",
              "USD_per_EUR"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "source": {
            "type": "string",
            "minLength": 8,
            "maxLength": 2000
          }
        },
        "required": [
          "rate",
          "direction",
          "date",
          "source"
        ],
        "additionalProperties": false
      },
      "FxFrozenRate": {
        "type": "object",
        "properties": {
          "rate": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,3})(?:\\.[0-9]{1,8})?$"
          },
          "direction": {
            "type": "string",
            "enum": [
              "EUR_per_USD",
              "USD_per_EUR"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "source": {
            "type": "string",
            "minLength": 8,
            "maxLength": 2000
          },
          "precision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8
          },
          "rounding": {
            "const": "half_up_cent"
          }
        },
        "required": [
          "rate",
          "direction",
          "date",
          "source",
          "precision",
          "rounding"
        ],
        "additionalProperties": false
      },
      "FxTerms": {
        "type": "object",
        "properties": {
          "commercial": {
            "$ref": "#/components/schemas/FxRate"
          },
          "tax": {
            "$ref": "#/components/schemas/FxRate"
          },
          "tax_method": {
            "enum": [
              "bmf_monthly",
              "permitted_daily"
            ]
          },
          "tax_permission": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "gain_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "loss_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          }
        },
        "required": [
          "commercial",
          "tax",
          "tax_method",
          "gain_account_id",
          "loss_account_id"
        ],
        "additionalProperties": false
      },
      "FxDraftTerms": {
        "type": "object",
        "description": "Ein UI-Entwurf darf noch unvollständige Kursfelder tragen; fx_preview bleibt dann null und missing nennt die Abhilfe.",
        "additionalProperties": true
      },
      "FxSnapshot": {
        "type": "object",
        "properties": {
          "contract": {
            "const": "summator-fx/1"
          },
          "document_currency": {
            "const": "USD"
          },
          "functional_currency": {
            "const": "EUR"
          },
          "terms": {
            "$ref": "#/components/schemas/FxTerms"
          },
          "commercial": {
            "$ref": "#/components/schemas/FxFrozenRate"
          },
          "tax": {
            "$ref": "#/components/schemas/FxFrozenRate"
          },
          "source_draft_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "scope": {
            "type": "string"
          },
          "net_usd_cents": {
            "type": "integer"
          },
          "tax_usd_cents": {
            "type": "integer"
          },
          "gross_usd_cents": {
            "type": "integer"
          },
          "net_eur_cents": {
            "type": "integer"
          },
          "tax_eur_cents": {
            "type": "integer"
          },
          "gross_eur_cents": {
            "type": "integer"
          },
          "initial_difference_eur_cents": {
            "type": "integer"
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tax_key_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$"
                    }
                  ]
                },
                "code": {
                  "type": "string"
                },
                "rate_bp": {
                  "type": "integer"
                },
                "net_cents": {
                  "type": "integer"
                },
                "tax_cents": {
                  "type": "integer"
                },
                "commercial_net_eur_cents": {
                  "type": "integer"
                },
                "tax_net_eur_cents": {
                  "type": "integer"
                },
                "tax_eur_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "tax_key_id",
                "code",
                "rate_bp",
                "net_cents",
                "tax_cents",
                "commercial_net_eur_cents",
                "tax_net_eur_cents",
                "tax_eur_cents"
              ],
              "additionalProperties": true
            }
          }
        },
        "required": [
          "contract",
          "document_currency",
          "functional_currency",
          "terms",
          "commercial",
          "tax",
          "source_draft_hash",
          "scope",
          "net_usd_cents",
          "tax_usd_cents",
          "gross_usd_cents",
          "net_eur_cents",
          "tax_eur_cents",
          "gross_eur_cents",
          "initial_difference_eur_cents",
          "groups"
        ],
        "additionalProperties": false
      },
      "FxSettlementRequest": {
        "type": "object",
        "properties": {
          "operation": {
            "enum": [
              "preview",
              "confirm"
            ]
          },
          "invoice_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "bank_transaction_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "usd_cents": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000000000
          },
          "rate": {
            "$ref": "#/components/schemas/FxRate"
          },
          "uuid": {
            "type": "string",
            "format": "uuid"
          },
          "expected_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "operation",
          "invoice_id",
          "bank_transaction_id",
          "usd_cents",
          "rate",
          "uuid"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "operation": {
                  "const": "confirm"
                }
              }
            },
            "then": {
              "required": [
                "expected_hash"
              ]
            }
          }
        ]
      },
      "FxSettlementPlan": {
        "type": "object",
        "properties": {
          "contract": {
            "const": "summator-fx/1"
          },
          "request": {
            "type": "object",
            "properties": {
              "invoice_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              },
              "bank_transaction_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              },
              "usd_cents": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000000000
              },
              "rate": {
                "$ref": "#/components/schemas/FxRate"
              },
              "uuid": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "invoice_id",
              "bank_transaction_id",
              "usd_cents",
              "rate",
              "uuid"
            ],
            "additionalProperties": false
          },
          "invoice": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              },
              "currency": {
                "const": "USD"
              },
              "fx_snapshot": {
                "$ref": "#/components/schemas/FxSnapshot"
              },
              "gross_cents": {
                "type": "integer"
              },
              "account_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              },
              "journal_entry_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              },
              "document_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              }
            },
            "required": [
              "id",
              "currency",
              "fx_snapshot",
              "gross_cents",
              "account_id",
              "journal_entry_id",
              "document_id"
            ],
            "additionalProperties": true
          },
          "bank": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              },
              "currency": {
                "const": "EUR"
              },
              "amount_cents": {
                "type": "integer"
              },
              "booked_on": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "currency",
              "amount_cents",
              "booked_on"
            ],
            "additionalProperties": true
          },
          "bank_account": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              },
              "currency": {
                "const": "EUR"
              },
              "account_id": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              }
            },
            "required": [
              "id",
              "currency",
              "account_id"
            ],
            "additionalProperties": true
          },
          "invoice_line_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$"
                    }
                  ]
                },
                "uuid": {
                  "type": "string"
                },
                "journal_entry_id": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$"
                    }
                  ]
                },
                "usd_cents": {
                  "type": "integer"
                },
                "carrying_eur_cents": {
                  "type": "integer"
                },
                "received_eur_cents": {
                  "type": "integer"
                },
                "difference_eur_cents": {
                  "type": "integer"
                },
                "source_hash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              },
              "required": [
                "id",
                "uuid",
                "journal_entry_id",
                "usd_cents",
                "carrying_eur_cents",
                "received_eur_cents",
                "difference_eur_cents",
                "source_hash"
              ],
              "additionalProperties": false
            }
          },
          "rate": {
            "$ref": "#/components/schemas/FxFrozenRate"
          },
          "carrying_eur_cents": {
            "type": "integer"
          },
          "received_eur_cents": {
            "type": "integer"
          },
          "difference_eur_cents": {
            "type": "integer"
          },
          "difference_account_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "remaining_usd_cents": {
            "type": "integer"
          },
          "remaining_eur_cents": {
            "type": "integer"
          },
          "rounding": {
            "const": "cumulative-original-carrying-half-up-cent"
          },
          "request_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "contract",
          "request",
          "invoice",
          "bank",
          "bank_account",
          "invoice_line_id",
          "original_sha256",
          "history",
          "rate",
          "carrying_eur_cents",
          "received_eur_cents",
          "difference_eur_cents",
          "difference_account_id",
          "remaining_usd_cents",
          "remaining_eur_cents",
          "rounding"
        ],
        "additionalProperties": false
      },
      "FxSettlement": {
        "type": "object",
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "invoice_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "bank_transaction_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "journal_entry_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "invoice_line_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "payment_line_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            ]
          },
          "uuid": {
            "type": "string",
            "format": "uuid"
          },
          "snapshot": {
            "$ref": "#/components/schemas/FxSettlementPlan"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "created_by": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          },
          "usd_cents": {
            "type": "integer"
          },
          "carrying_eur_cents": {
            "type": "integer"
          },
          "received_eur_cents": {
            "type": "integer"
          },
          "difference_eur_cents": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "invoice_id",
          "bank_transaction_id",
          "journal_entry_id",
          "invoice_line_id",
          "payment_line_id",
          "uuid",
          "snapshot",
          "source_hash",
          "created_by",
          "created_at",
          "usd_cents",
          "carrying_eur_cents",
          "received_eur_cents",
          "difference_eur_cents"
        ],
        "additionalProperties": false
      },
      "FxSettlementResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "scope": {
                "type": "string"
              },
              "fingerprint": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "plan": {
                "$ref": "#/components/schemas/FxSettlementPlan"
              },
              "setup": {
                "type": "object"
              },
              "billing": {
                "type": "object"
              }
            },
            "required": [
              "scope",
              "fingerprint",
              "plan"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "replayed": {
                "type": "boolean"
              },
              "settlement": {
                "$ref": "#/components/schemas/FxSettlement"
              },
              "setup": {
                "type": "object"
              },
              "billing": {
                "type": "object"
              }
            },
            "required": [
              "replayed",
              "settlement"
            ],
            "additionalProperties": false
          }
        ]
      },
      "IncomingValidationMessage": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "display_text": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "stage",
          "severity",
          "text",
          "location"
        ],
        "additionalProperties": false
      },
      "IncomingValidationReport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "document_id": {
            "type": "integer",
            "minimum": 1
          },
          "tenant_id": {
            "type": "string"
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "xml_sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "ruleset_id": {
            "type": "string"
          },
          "ruleset": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "validator": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "manifest_sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "additionalProperties": true
          },
          "status": {
            "enum": [
              "valid",
              "warning",
              "invalid",
              "unknown",
              "not_checkable"
            ]
          },
          "stage": {
            "type": "string"
          },
          "syntax": {
            "type": "string"
          },
          "syntax_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "declared_profile": {
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncomingValidationMessage"
            }
          },
          "report_sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "checked_at": {
            "type": "string"
          },
          "requested_by": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "execution": {
            "type": "object",
            "properties": {
              "duration_ms": {
                "type": "integer",
                "minimum": 0
              },
              "exit_code": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scenario": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "schema": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "duration_ms",
              "exit_code",
              "scenario",
              "schema"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "document_id",
          "tenant_id",
          "original_sha256",
          "xml_sha256",
          "ruleset_id",
          "ruleset",
          "status",
          "stage",
          "syntax",
          "syntax_version",
          "declared_profile",
          "carrier",
          "messages",
          "report_sha256",
          "checked_at",
          "requested_by",
          "execution"
        ],
        "additionalProperties": false
      },
      "IncomingValidationRawReport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "document_id": {
            "type": "integer",
            "minimum": 1
          },
          "tenant_id": {
            "type": "string"
          },
          "original_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "xml_sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "ruleset_id": {
            "type": "string"
          },
          "ruleset": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "validator": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "manifest_sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "additionalProperties": true
          },
          "status": {
            "enum": [
              "valid",
              "warning",
              "invalid",
              "unknown",
              "not_checkable"
            ]
          },
          "stage": {
            "type": "string"
          },
          "syntax": {
            "type": "string"
          },
          "syntax_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "declared_profile": {
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncomingValidationMessage"
            }
          },
          "report_sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "checked_at": {
            "type": "string"
          },
          "requested_by": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "execution": {
            "type": "object",
            "properties": {
              "duration_ms": {
                "type": "integer",
                "minimum": 0
              },
              "exit_code": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "scenario": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "schema": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "duration_ms",
              "exit_code",
              "scenario",
              "schema"
            ],
            "additionalProperties": false
          },
          "raw_report": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "xml_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "document_id",
          "tenant_id",
          "original_sha256",
          "xml_sha256",
          "ruleset_id",
          "ruleset",
          "status",
          "stage",
          "syntax",
          "syntax_version",
          "declared_profile",
          "carrier",
          "messages",
          "report_sha256",
          "checked_at",
          "requested_by",
          "execution",
          "raw_report",
          "xml_content"
        ],
        "additionalProperties": false
      },
      "IncomingValidationState": {
        "type": "object",
        "properties": {
          "latest": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IncomingValidationReport"
              },
              {
                "type": "null"
              }
            ]
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncomingValidationReport"
            }
          },
          "booking": {
            "type": "object",
            "properties": {
              "action": {
                "enum": [
                  "blocked",
                  "reason_required",
                  "allowed",
                  "not_checked"
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "action",
              "message"
            ],
            "additionalProperties": false
          },
          "recorded_booking_decisions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "journal_entry_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "entry_number": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "report_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "created_at": {
                  "type": "string"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "journal_entry_id",
                "entry_number",
                "report_id",
                "created_at",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "notice": {
            "type": "string"
          }
        },
        "required": [
          "latest",
          "history",
          "booking",
          "recorded_booking_decisions",
          "notice"
        ],
        "additionalProperties": false
      },
      "IncomingValidationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/IncomingValidationState"
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": true
      },
      "BankBalanceGap": {
        "type": "object",
        "description": "Der früheste Anfangssaldo plus alle Umsätze ergibt nicht den spätesten Schlusssaldo. Heben sich fehlende Umsätze auf, fällt das nicht auf.",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "difference_cents": {
            "type": "integer",
            "description": "Abweichung in ganzzahligen Cent"
          }
        },
        "required": [
          "from",
          "to",
          "difference_cents"
        ],
        "additionalProperties": false
      },
      "BankDataStatus": {
        "type": "object",
        "description": "Aus den eingelesenen Auszügen abgeleitet. Sagt, bis wann etwas vorliegt, nie dass es aktuell oder vollständig ist.",
        "properties": {
          "through": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "imported_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "balances_checked": {
            "type": "boolean"
          },
          "gap": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BankBalanceGap"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "through",
          "imported_at",
          "source",
          "balances_checked",
          "gap"
        ],
        "additionalProperties": false
      },
      "Source_fx_settlements": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "uuid": {
            "type": "string",
            "format": "uuid"
          },
          "invoice_id": {
            "type": "integer"
          },
          "bank_transaction_id": {
            "type": "integer"
          },
          "journal_entry_id": {
            "type": "integer"
          },
          "invoice_line_id": {
            "type": "integer"
          },
          "payment_line_id": {
            "type": "integer"
          },
          "usd_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "carrying_eur_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "received_eur_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "difference_eur_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "snapshot": {
            "type": "object",
            "additionalProperties": true
          },
          "source_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "Zeitstempel als Text mit Zeitzonenoffset."
          }
        },
        "required": [
          "id",
          "uuid",
          "invoice_id",
          "bank_transaction_id",
          "journal_entry_id",
          "invoice_line_id",
          "payment_line_id",
          "usd_cents",
          "carrying_eur_cents",
          "received_eur_cents",
          "difference_eur_cents",
          "snapshot",
          "source_hash",
          "created_by",
          "created_at"
        ],
        "additionalProperties": false
      },
      "DocumentVisibilityEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "document_id": {
            "type": "integer",
            "minimum": 1
          },
          "hidden": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "actor_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "document_id",
          "hidden",
          "reason",
          "actor_id",
          "created_at"
        ],
        "additionalProperties": false
      },
      "VatXmlPreview": {
        "type": "object",
        "description": "Vorschau ohne XML-Bytes. Die Datei entsteht erst nach der ausdrücklichen Bestätigung.",
        "properties": {
          "range": {
            "type": "object",
            "description": "Der gewählte abgeschlossene Zeitraum.",
            "properties": {
              "key": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              },
              "label": {
                "type": "string"
              },
              "frequency": {
                "type": "string"
              }
            },
            "required": [
              "key",
              "from",
              "to",
              "label",
              "frequency"
            ],
            "additionalProperties": true
          },
          "options": {
            "type": "object",
            "properties": {
              "period": {
                "type": "string"
              },
              "corrected": {
                "type": "boolean"
              }
            },
            "required": [
              "period",
              "corrected"
            ],
            "additionalProperties": false
          },
          "company": {
            "type": "object",
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "street": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postal_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "elster_tax_number": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "name",
              "street",
              "postal_code",
              "city",
              "country",
              "elster_tax_number"
            ],
            "additionalProperties": false
          },
          "version": {
            "type": "string"
          },
          "previewed_at": {
            "type": "string",
            "format": "date-time"
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "fields": {
            "type": "array",
            "description": "Kennzahlen der Datei.",
            "items": {
              "type": "object",
              "properties": {
                "box": {
                  "type": "string"
                },
                "source_cents": {
                  "type": "integer"
                },
                "xml_value": {
                  "type": "string"
                },
                "difference_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "box",
                "source_cents",
                "xml_value",
                "difference_cents"
              ],
              "additionalProperties": false
            }
          },
          "obstacles": {
            "description": "Sperren je Feld, leer wenn die Datei entstehen kann.",
            "anyOf": [
              {
                "type": "array",
                "maxItems": 0
              },
              {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "report": {
            "type": "object",
            "properties": {
              "data_fingerprint": {
                "type": "string"
              }
            },
            "required": [
              "data_fingerprint"
            ],
            "additionalProperties": false
          },
          "validation": {
            "type": "object",
            "properties": {
              "xsd": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed"
                ]
              },
              "annual_scope": {
                "type": "string"
              },
              "eric": {
                "type": "string",
                "enum": [
                  "not_performed"
                ]
              },
              "rules": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "xsd",
              "annual_scope",
              "eric",
              "rules"
            ],
            "additionalProperties": false
          },
          "xml_export_allowed": {
            "type": "boolean"
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "severity": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "remedy": {
                  "type": "string"
                },
                "entry_id": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "line_id": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "code",
                "severity",
                "message",
                "remedy"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "range",
          "options",
          "company",
          "version",
          "previewed_at",
          "fingerprint",
          "fields",
          "obstacles",
          "report",
          "validation",
          "xml_export_allowed",
          "findings"
        ],
        "additionalProperties": false
      },
      "VatXmlExport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "created"
            ],
            "description": "Eine Abgabe wird nie vermerkt, Summator übermittelt nichts an ELSTER."
          },
          "period": {
            "type": "string"
          },
          "period_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "corrected": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "writer_version": {
            "type": "string"
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "data_fingerprint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "previewed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "fields": {
            "type": "array",
            "description": "Kennzahlen der Datei.",
            "items": {
              "type": "object",
              "properties": {
                "box": {
                  "type": "string"
                },
                "source_cents": {
                  "type": "integer"
                },
                "xml_value": {
                  "type": "string"
                },
                "difference_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "box",
                "source_cents",
                "xml_value",
                "difference_cents"
              ],
              "additionalProperties": false
            }
          },
          "xsd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "status",
          "period",
          "period_label",
          "from",
          "to",
          "corrected",
          "created_at",
          "created_by",
          "created_by_name",
          "sha256",
          "writer_version",
          "fingerprint",
          "data_fingerprint",
          "previewed_at",
          "fields",
          "xsd"
        ],
        "additionalProperties": false
      },
      "NotificationDevice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "type": "string",
            "enum": [
              "ios",
              "android"
            ]
          },
          "app_version": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "preferences": {
            "type": "object",
            "properties": {
              "document-review": {
                "type": "boolean"
              },
              "bank-work": {
                "type": "boolean"
              }
            },
            "additionalProperties": false,
            "required": [
              "document-review",
              "bank-work"
            ]
          },
          "permission": {
            "type": "string",
            "enum": [
              "granted",
              "denied",
              "undetermined"
            ]
          },
          "lease_expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive",
              "revoked"
            ]
          }
        },
        "required": [
          "id",
          "platform",
          "app_version",
          "version",
          "preferences",
          "permission",
          "lease_expires_at",
          "status"
        ],
        "additionalProperties": false
      },
      "NotificationTarget": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "target": {
                "type": "string",
                "enum": [
                  "document-review"
                ]
              },
              "state": {
                "type": "string",
                "enum": [
                  "open",
                  "done"
                ]
              },
              "document_id": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "target",
              "state",
              "document_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "target": {
                "type": "string",
                "enum": [
                  "bank-open"
                ]
              },
              "state": {
                "type": "string",
                "enum": [
                  "open",
                  "done"
                ]
              },
              "bank_statement_id": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "target",
              "state",
              "bank_statement_id"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AssetRegister": {
        "type": "object",
        "description": "Anlagenverzeichnis zum Stichtag. Je Anlage gilt Stand Jahresbeginn + Zugang - AfA im Jahr - Abgang = Restbuchwert. Massgeblich ist das Buchungsdatum im Journal. Der Abgang ist der Betrag seiner Buchung auf dem Anlagekonto. Liegt eine AfA oder ein Storno derselben Anlage danach, steht der Unterschied bis dorthin als Restbuchwert, auch negativ. Eine Korrekturfassung ist Zugang im Jahr ihrer Eröffnungsbuchung.",
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date"
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "asset_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "name": {
                  "type": "string"
                },
                "origin": {
                  "type": "string",
                  "enum": [
                    "new",
                    "linked",
                    "opening"
                  ]
                },
                "acquired_on": {
                  "type": "string",
                  "format": "date"
                },
                "asset_account_id": {
                  "type": "integer",
                  "minimum": 1
                },
                "asset_account_number": {
                  "type": "string"
                },
                "closed_on": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date",
                  "description": "Buchungstag des Vollabgangs, wenn er bis zum Stichtag gebucht ist."
                },
                "cost_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "start_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "additions_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "year_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "depreciation_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "disposed_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                },
                "remaining_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent"
                }
              },
              "additionalProperties": false,
              "required": [
                "asset_id",
                "name",
                "origin",
                "acquired_on",
                "asset_account_id",
                "asset_account_number",
                "closed_on",
                "cost_cents",
                "start_cents",
                "additions_cents",
                "year_cents",
                "depreciation_cents",
                "disposed_cents",
                "remaining_cents"
              ]
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "cost_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "start_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "additions_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "year_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "depreciation_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "disposed_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              },
              "remaining_cents": {
                "type": "integer",
                "description": "Ganzzahlige Cent"
              }
            },
            "additionalProperties": false,
            "required": [
              "cost_cents",
              "start_cents",
              "additions_cents",
              "year_cents",
              "depreciation_cents",
              "disposed_cents",
              "remaining_cents"
            ]
          },
          "reconciliation": {
            "$ref": "#/components/schemas/AssetReconciliation"
          }
        },
        "required": [
          "as_of",
          "rows",
          "totals",
          "reconciliation"
        ],
        "additionalProperties": false
      },
      "PaymentOrderItem": {
        "type": "object",
        "properties": {
          "line_id": {
            "type": "integer"
          },
          "recipient_name": {
            "type": "string"
          },
          "iban": {
            "type": "string"
          },
          "bic": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "purpose": {
            "type": "string"
          },
          "end_to_end_id": {
            "type": "string"
          },
          "bank_transaction_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "settled": {
            "type": "boolean"
          }
        },
        "required": [
          "line_id",
          "recipient_name",
          "iban",
          "bic",
          "amount_cents",
          "purpose",
          "end_to_end_id",
          "bank_transaction_id",
          "settled"
        ],
        "additionalProperties": false
      },
      "PaymentOrder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "reference": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "vorbereitet",
              "gesendet",
              "tan_offen",
              "angenommen",
              "abgelehnt",
              "unbekannt",
              "abgebrochen"
            ]
          },
          "status_label": {
            "type": "string"
          },
          "bank_account_id": {
            "type": "integer"
          },
          "debtor_iban": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR"
            ]
          },
          "total_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent"
          },
          "batch": {
            "type": "boolean"
          },
          "instant": {
            "type": "boolean",
            "description": "true: Sofortüberweisung (SCT Inst). Gesendet wird sie nur von der gekoppelten Summator-App."
          },
          "payee_check": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "bank_response": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "sent_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentOrderItem"
            }
          }
        },
        "required": [
          "id",
          "reference",
          "status",
          "status_label",
          "bank_account_id",
          "debtor_iban",
          "currency",
          "total_cents",
          "batch",
          "instant",
          "payee_check",
          "bank_response",
          "sent_at",
          "created_at",
          "items"
        ],
        "additionalProperties": false
      },
      "AccountSemantics": {
        "type": "object",
        "properties": {
          "purpose": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "default_tax_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "examples": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 5
          },
          "exclusions": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "account": {
                  "type": "string"
                }
              },
              "required": [
                "text"
              ],
              "additionalProperties": false
            }
          },
          "vendors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 10
          },
          "source": {
            "type": "string",
            "enum": [
              "manuell",
              "ki_vorschlag",
              "standard"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "channel": {
            "type": "string"
          }
        },
        "required": [
          "purpose",
          "default_tax_key",
          "examples",
          "exclusions",
          "vendors",
          "source",
          "version",
          "created_at",
          "created_by",
          "channel"
        ],
        "additionalProperties": false
      },
      "DmsDocument": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "pdf",
              "bild",
              "office",
              "text",
              "xml",
              "mail"
            ]
          },
          "document_id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "sealed": {
            "type": "boolean"
          },
          "received_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "filed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "filed_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "text_recognized": {
            "type": "boolean"
          },
          "text_source": {
            "type": "string",
            "enum": [
              "pdf",
              "office",
              "text",
              "xml",
              "mail",
              "keine",
              "ocr"
            ]
          },
          "text_recognition": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "offen",
                  "laeuft",
                  "erkannt",
                  "ohne_text",
                  "nicht_moeglich"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Stand der Texterkennung für Scans (D3b); null, wenn keine nötig war. offen und laeuft werden im Hintergrund erledigt, auch nach einem Ausfall des KI-Servers."
          },
          "file_url": {
            "type": "string",
            "format": "uri"
          },
          "text": {
            "type": "string",
            "description": "Nur in der Einzelansicht: der gewonnene Text, höchstens 200 000 Zeichen."
          },
          "integrity_ok": {
            "type": "boolean",
            "description": "Nur in der Einzelansicht: die Datei passt zu ihrem Fingerabdruck."
          },
          "rank": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Nur in der Suche: Rang des Treffers."
          },
          "excerpt": {
            "type": "string",
            "description": "Nur in der Suche: Ausschnitt um die gefundenen Wörter."
          },
          "match": {
            "type": "string",
            "enum": [
              "text",
              "meaning",
              "both"
            ],
            "description": "Nur in der Suche: text — trägt die gesuchten Wörter; meaning — passt dem Sinn nach, ohne die Wörter; both — beides."
          },
          "document_type": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "minimum": 1
              },
              "key": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "key",
              "name"
            ],
            "additionalProperties": false,
            "description": "Dokumentart; key ist die Kennung, etwa vertrag."
          },
          "folder": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "minimum": 1
              },
              "path": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "path"
            ],
            "additionalProperties": false,
            "description": "Ordner mit Pfad, etwa Rechnungen / Eingang / 2026."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Schlagworte."
          },
          "classification": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "suggested",
                  "confirmed"
                ]
              },
              "source": {
                "type": "string",
                "enum": [
                  "rule",
                  "memory",
                  "feature",
                  "default",
                  "user"
                ]
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "status",
              "source",
              "reason"
            ],
            "additionalProperties": false,
            "description": "suggested: ein Vorschlag, noch nicht bestätigt; source sagt, woher er kommt."
          },
          "sender": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Erkannter oder mitgegebener Absender."
          },
          "mail": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "sender": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subject": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "received_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sent_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "address",
                      "mailbox"
                    ]
                  },
                  "inbox_message_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "sender",
                  "subject",
                  "received_at",
                  "sent_at",
                  "source",
                  "inbox_message_id"
                ],
                "description": "Woher das Dokument per Mail kam (Mail-Eingang); null bei Ablage von Hand."
              },
              {
                "type": "null"
              }
            ]
          },
          "retention": {
            "type": "object",
            "description": "Aufbewahrung: Festschreibung, Fristende, Papierkorb und Löschung. locked: festgeschrieben, vor retain_until nicht änder- oder löschbar.",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "open",
                  "locked",
                  "expired",
                  "discarded",
                  "deleted"
                ]
              },
              "locked": {
                "type": "boolean"
              },
              "locked_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "retain_until": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rule": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "deletable_from": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "discarded_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "deleted_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "summary": {
                "type": "string"
              }
            },
            "required": [
              "status",
              "locked",
              "locked_at",
              "retain_until",
              "rule",
              "deletable_from",
              "discarded_at",
              "deleted_at",
              "summary"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "title",
          "type",
          "document_id",
          "name",
          "mime_type",
          "size_bytes",
          "sha256",
          "sealed",
          "received_at",
          "filed_at",
          "filed_by",
          "text_recognized",
          "text_source",
          "text_recognition",
          "file_url",
          "document_type",
          "folder",
          "tags",
          "classification",
          "sender",
          "mail",
          "retention"
        ],
        "additionalProperties": false
      },
      "DmsFolder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "path": {
            "type": "string"
          },
          "by_year": {
            "type": "boolean"
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Übergeordneter Ordner (Struktur)."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Jahresordner: das Eingangsjahr (Struktur)."
          },
          "locked": {
            "type": "boolean",
            "description": "Gesperrt, selbst oder darüber (Struktur)."
          }
        },
        "required": [
          "id",
          "path",
          "by_year"
        ],
        "additionalProperties": false
      },
      "DmsDocumentType": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "retention_years": {
            "type": "integer",
            "minimum": 0
          },
          "minimum_retention_years": {
            "type": "integer",
            "minimum": 0
          },
          "default_folder": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "path": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "path"
            ],
            "additionalProperties": false
          },
          "bookkeeping_relevant": {
            "type": "boolean"
          },
          "trigger": {
            "type": "string",
            "enum": [
              "dokumentdatum",
              "vertragsende",
              "uebergabe"
            ]
          },
          "approval": {
            "type": "boolean"
          },
          "lock": {
            "type": "boolean",
            "description": "Dokumente dieser Art werden festgeschrieben, wenn der GoBD-Teil an ist."
          },
          "custom": {
            "type": "boolean",
            "description": "Eigene Art des Mandanten (V-113)."
          },
          "based_on": {
            "type": [
              "string",
              "null"
            ],
            "description": "Kennung der vorgegebenen Art, der eine eigene Art folgt; sonst null."
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "retention_years",
          "minimum_retention_years",
          "default_folder",
          "bookkeeping_relevant",
          "trigger",
          "approval",
          "lock",
          "custom",
          "based_on"
        ],
        "additionalProperties": false
      },
      "DmsRule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "field": {
            "type": "string",
            "enum": [
              "sender",
              "title",
              "text"
            ]
          },
          "contains": {
            "type": "string"
          },
          "document_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "folder_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "automatic": {
            "type": "boolean"
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "field",
          "contains",
          "document_type",
          "folder_id",
          "tags",
          "automatic",
          "active"
        ],
        "additionalProperties": false
      },
      "DmsStructure": {
        "type": "object",
        "properties": {
          "document_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmsDocumentType"
            }
          },
          "folders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmsFolder"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmsRule"
            }
          },
          "set_up": {
            "type": "boolean"
          },
          "retention_enabled": {
            "type": "boolean",
            "description": "GoBD-Teil (Festschreibung und Fristen) des Mandanten."
          }
        },
        "required": [
          "document_types",
          "folders",
          "tags",
          "rules",
          "set_up",
          "retention_enabled"
        ],
        "additionalProperties": false
      },
      "DmsMailbox": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "encryption": {
            "type": "string",
            "enum": [
              "ssl",
              "starttls",
              "keine"
            ]
          },
          "username": {
            "type": "string"
          },
          "folder": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "last_fetch_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "verbindung",
                  "tls",
                  "anmeldung",
                  "ordner",
                  "protokoll",
                  "unverschluesselt",
                  "nicht_berechtigt"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "new_messages": {
            "type": "integer",
            "description": "Nur nach fetch: neu angenommene Mails."
          }
        },
        "required": [
          "id",
          "name",
          "host",
          "port",
          "encryption",
          "username",
          "folder",
          "active",
          "last_fetch_at",
          "last_success_at",
          "error"
        ],
        "description": "Ein abgerufenes IMAP-Postfach. Das Zugangsgeheimnis steht nie in einer Antwort."
      },
      "DmsInbox": {
        "type": "object",
        "properties": {
          "address": {
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "active": {
                "type": "boolean"
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "email"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "since": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "available",
              "active",
              "email",
              "since"
            ]
          },
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "sender": {
                  "type": "string"
                },
                "subject_contains": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "attachment_pattern": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "store_eml": {
                  "type": "boolean"
                },
                "active": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "sender",
                "subject_contains",
                "attachment_pattern",
                "store_eml",
                "active"
              ]
            }
          },
          "mailboxes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmsMailbox"
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "address",
                    "mailbox"
                  ]
                },
                "mailbox": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sender": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "subject": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "received_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "sent_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "angenommen",
                    "fremd",
                    "unlesbar",
                    "zu_gross",
                    "doppelt"
                  ]
                },
                "rule_id": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "attachments": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "size_bytes": {
                        "type": "integer"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "abgelegt",
                          "dublette",
                          "abgewiesen"
                        ]
                      },
                      "reason": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "leer",
                              "unlesbar",
                              "zu_gross",
                              "zu_viele",
                              "eingebettet",
                              "muster",
                              "dateiart",
                              "fehler"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "document_id": {
                        "anyOf": [
                          {
                            "type": "integer"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "size_bytes",
                      "status",
                      "reason",
                      "document_id"
                    ]
                  }
                }
              },
              "required": [
                "id",
                "source",
                "mailbox",
                "sender",
                "subject",
                "received_at",
                "sent_at",
                "status",
                "rule_id",
                "attachments"
              ]
            }
          },
          "next_before_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "address",
          "rules",
          "mailboxes",
          "messages",
          "next_before_id"
        ]
      },
      "DmsImport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "sha256": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "wartet",
              "laeuft",
              "fertig"
            ],
            "description": "wartet, laeuft (läuft im Hintergrund) oder fertig"
          },
          "total": {
            "type": "integer",
            "description": "Dateien im ZIP ohne Ordner und Beigaben von Betriebssystemen"
          },
          "processed": {
            "type": "integer"
          },
          "progress_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "filed": {
            "type": "integer"
          },
          "duplicates": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          },
          "started_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "issues": {
            "type": "array",
            "description": "Nur bei GET /imports/{id}: Meldungen je Datei, die nicht abgelegt wurde (höchstens 1000).",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "result": {
                  "type": "string",
                  "enum": [
                    "dublette",
                    "abgewiesen"
                  ]
                },
                "message": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "document_id": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "path",
                "result",
                "message",
                "document_id"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "name",
          "size_bytes",
          "sha256",
          "status",
          "total",
          "processed",
          "progress_percent",
          "filed",
          "duplicates",
          "rejected",
          "started_by",
          "started_at",
          "finished_at"
        ],
        "additionalProperties": false
      },
      "DmsWeclappConnection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "account": {
            "type": "string",
            "description": "<konto>.weclapp.com"
          },
          "user": {
            "type": "string",
            "description": "Name des weclapp-Benutzers, nur zur Anzeige."
          },
          "active": {
            "type": "boolean"
          },
          "fetch_from": {
            "type": "string",
            "format": "date"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "description": "Nur mit Recht Dokumente ablegen."
              },
              {
                "type": "null"
              }
            ]
          },
          "last_fetch_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "anmeldung",
                  "rechte",
                  "grenze",
                  "verbindung",
                  "antwort",
                  "nicht_berechtigt",
                  "pruefung",
                  "nicht_gefunden",
                  "leer",
                  "zu_gross",
                  "ablage"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "wait_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "new_documents": {
            "type": "integer",
            "description": "Nur nach fetch: neu abgelegte Dokumente."
          }
        },
        "required": [
          "id",
          "name",
          "account",
          "user",
          "active",
          "fetch_from",
          "webhook_url",
          "last_fetch_at",
          "last_success_at",
          "error",
          "wait_until"
        ]
      },
      "DmsWeclappFile": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "rechnung",
              "e_rechnung",
              "storno",
              "anlage"
            ]
          },
          "weclapp_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "abgelegt",
              "dublette",
              "abgewiesen"
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "dateiart",
                  "virus",
                  "zu_gross",
                  "leer"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "document_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "role",
          "weclapp_type",
          "status",
          "reason",
          "document_id"
        ]
      },
      "DmsWeclappInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "weclapp_id": {
            "type": "string"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": {
            "type": "string",
            "description": "salesInvoiceType von weclapp, CREDIT_NOTE = Gutschrift"
          },
          "status": {
            "type": "string",
            "enum": [
              "DOCUMENT_CREATED",
              "OPEN_ITEM_CREATED",
              "CANCELLED"
            ]
          },
          "cancelled": {
            "type": "boolean"
          },
          "cancellation_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "preceding_weclapp_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "retry": {
            "type": "boolean",
            "description": "Eine Datei kam nicht an; der nächste Abruf versucht es wieder."
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "anmeldung",
                  "rechte",
                  "grenze",
                  "verbindung",
                  "antwort",
                  "nicht_berechtigt",
                  "pruefung",
                  "nicht_gefunden",
                  "leer",
                  "zu_gross",
                  "ablage"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmsWeclappFile"
            }
          }
        },
        "required": [
          "id",
          "weclapp_id",
          "number",
          "type",
          "status",
          "cancelled",
          "cancellation_number",
          "preceding_weclapp_id",
          "retry",
          "error",
          "updated_at",
          "files"
        ]
      },
      "DmsWeclapp": {
        "type": "object",
        "properties": {
          "connection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DmsWeclappConnection"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmsWeclappInvoice"
            },
            "description": "Die zuletzt geänderten 25 Rechnungen."
          }
        },
        "required": [
          "connection",
          "invoices"
        ]
      },
      "DmsZahlung": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "offen",
              "teilweise",
              "bezahlt",
              "skonto"
            ]
          },
          "status_label": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "payable",
              "receivable"
            ]
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "paid_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "discount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "open_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "partner": {
            "type": "string"
          },
          "iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "due_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount_percent": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "discount_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "allocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DmsZuordnung"
            }
          }
        },
        "required": [
          "status",
          "amount_cents",
          "paid_cents",
          "discount_cents",
          "open_cents",
          "partner"
        ]
      },
      "DmsUmsatz": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "booked_on": {
            "type": "string",
            "format": "date"
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "counterparty": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "counterparty_iban": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "purpose": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "booked_on",
          "amount_cents"
        ]
      },
      "DmsZuordnung": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "transaction_id": {
            "type": "integer"
          },
          "event": {
            "type": "string",
            "enum": [
              "assigned",
              "cancelled"
            ]
          },
          "amount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "discount_cents": {
            "type": "integer",
            "description": "Ganzzahlige Cent, keine Euro-Gleitkommazahl."
          },
          "cancels": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "oberflaeche",
              "api",
              "mcp"
            ]
          },
          "user_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "transaction": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DmsUmsatz"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "document_id",
          "transaction_id",
          "event",
          "amount_cents",
          "discount_cents"
        ]
      },
      "DmsPrePosting": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "document_id": {
            "type": "integer"
          },
          "version": {
            "type": "integer"
          },
          "previous_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "correction_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "confirmed",
              "handed_over"
            ]
          },
          "partner": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "number": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "number",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "gross_cents_read": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "suggestion": {
            "type": "object",
            "properties": {
              "source": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reason": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "source",
              "reason"
            ],
            "additionalProperties": false
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account_id": {
                  "type": "integer"
                },
                "account": {
                  "type": "string"
                },
                "account_name": {
                  "type": "string"
                },
                "tax_key_id": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "tax_key": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "amount_cents": {
                  "type": "integer",
                  "description": "Ganzzahlige Cent, brutto."
                }
              },
              "required": [
                "account_id",
                "account",
                "account_name",
                "tax_key_id",
                "tax_key",
                "amount_cents"
              ],
              "additionalProperties": false
            }
          },
          "total_cents": {
            "type": "integer"
          },
          "questions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "handover": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "document_id",
          "version",
          "previous_id",
          "correction_reason",
          "direction",
          "status",
          "partner",
          "document_date",
          "invoice_number",
          "text",
          "service_date",
          "gross_cents_read",
          "suggestion",
          "lines",
          "total_cents",
          "questions",
          "handover",
          "confirmed_at"
        ],
        "additionalProperties": false
      },
      "DmsDatevHandover": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "number": {
            "type": "string"
          },
          "fiscal_year": {
            "type": "integer"
          },
          "count": {
            "type": "integer"
          },
          "total_cents": {
            "type": "integer"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "retain_until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "manifest_sha256": {
            "type": "string"
          },
          "uploaded_marked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "number",
          "fiscal_year",
          "count",
          "total_cents",
          "created_at",
          "retain_until",
          "manifest_sha256",
          "uploaded_marked_at"
        ],
        "additionalProperties": false
      },
      "DmsFreigabe": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "partner": {
            "type": "string"
          },
          "invoice_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount_cents": {
            "type": "integer"
          },
          "due_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "discount_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "clarification",
              "rejected",
              "approved",
              "none"
            ]
          },
          "status_label": {
            "type": "string"
          },
          "stage": {
            "type": "integer"
          },
          "stages": {
            "type": "integer"
          },
          "stage_name": {
            "type": "string"
          },
          "waiting_since": {
            "type": "string",
            "format": "date-time"
          },
          "responsible": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "clarification": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "to": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "to_user_id": {
                "type": "integer"
              },
              "from": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "question": {
                "type": "string"
              }
            }
          },
          "can_approve": {
            "type": "boolean"
          },
          "can_reject": {
            "type": "boolean"
          },
          "can_answer": {
            "type": "boolean"
          },
          "is_asked": {
            "type": "boolean"
          },
          "on_behalf_of": {
            "type": [
              "string",
              "null"
            ]
          },
          "hint": {
            "type": [
              "string",
              "null"
            ]
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "event": {
                  "type": "string",
                  "enum": [
                    "freigegeben",
                    "abgelehnt",
                    "klaerung",
                    "antwort"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "stage": {
                  "type": "integer"
                },
                "user": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "on_behalf_of": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "text": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string",
                  "enum": [
                    "oberflaeche",
                    "api",
                    "mcp"
                  ]
                }
              }
            }
          }
        },
        "required": [
          "document_id",
          "status"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "geraet",
      "description": "Geräteschnittstelle für die Summator-App und die Browser-Erweiterung"
    },
    {
      "name": "dms",
      "description": "Summator DMS: Dokumente ablegen, ordnen und suchen"
    }
  ]
}
