{
  "openapi": "3.1.0",
  "info": {
    "title": "LedgerLou REST API",
    "version": "0.1.0",
    "description": "Automatisch generierte Baseline-Spezifikation aus den Fastify-Routendeklarationen. Exakte Request-/Response-Payloads entnimm der Endpoint-Implementierung."
  },
  "servers": [
    {
      "url": "https://api.ledgerlou.de"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "paths": {
    "/v1/accounts": {
      "get": {
        "operationId": "get_v1_accounts",
        "summary": "Kontenplan abrufen",
        "tags": [
          "journal"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Max. Ergebnisse pro Seite (1–500, Standard: 500)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Offset für Pagination (Standard: 0)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "post_v1_accounts",
        "summary": "Konto hinzufügen",
        "tags": [
          "journal"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "type": "string",
                    "description": "Kontonummer (numerisch, max 8 Stellen)"
                  },
                  "name": {
                    "type": "string",
                    "description": "Kontobezeichnung (max 255)"
                  },
                  "type": {
                    "type": "string",
                    "description": "`\"asset\"`, `\"liability\"`, `\"equity\"`, `\"revenue\"` oder `\"expense\"`"
                  },
                  "category": {
                    "type": "string",
                    "description": "Kategorie (max 100)"
                  },
                  "report_group": {
                    "type": "string",
                    "description": "Report-Gruppierung für BWA/Bilanz/GuV-Klassifizierung (max 40). Kanonische Werte: `revenue`, `material_expense`, `personnel_expense`, `depreciation`, `other_opex`, `cash`, `receivables`, `liabilities`, etc."
                  }
                },
                "required": [
                  "number",
                  "name",
                  "type"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{number}/entries": {
      "get": {
        "operationId": "get_v1_accounts_number_entries",
        "summary": "Kontobewegungen & Saldo",
        "tags": [
          "journal"
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Ab Datum (YYYY-MM-DD)"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bis Datum (YYYY-MM-DD)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Max. Ergebnisse"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/accounts/search": {
      "get": {
        "operationId": "get_v1_accounts_search",
        "summary": "Konten suchen",
        "tags": [
          "journal"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Suchbegriff (Nummernpräfix oder Namensbestandteil)"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optionaler Kontotyp: `\"asset\"`, `\"liability\"`, `\"equity\"`, `\"revenue\"` oder `\"expense\"`"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-accounts": {
      "get": {
        "operationId": "get_v1_bank_accounts",
        "summary": "Alle Bankkonten auflisten",
        "tags": [
          "bank"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "post_v1_bank_accounts",
        "summary": "Neues Bankkonto anlegen",
        "tags": [
          "bank"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Kontobezeichnung (max 255)"
                  },
                  "iban": {
                    "type": "string",
                    "description": "IBAN (15–34 Zeichen)"
                  },
                  "bic": {
                    "type": "string",
                    "description": "BIC (max 11)"
                  },
                  "account_number": {
                    "type": "string",
                    "description": "SKR04-Kontonummer (1–8 Stellen, muss als Aktivkonto im Kontenplan existieren und darf noch keinem anderen Bankkonto zugeordnet sein)"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Währung (3 Zeichen, Default: EUR)"
                  }
                },
                "required": [
                  "name",
                  "iban",
                  "account_number"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/bank-accounts/{id}": {
      "get": {
        "operationId": "get_v1_bank_accounts_id",
        "summary": "Einzelnes Bankkonto abrufen",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "put_v1_bank_accounts_id",
        "summary": "Bankkonto aktualisieren",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Kontobezeichnung (max 255)"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/bank-accounts/{id}/reconciliation": {
      "get": {
        "operationId": "get_v1_bank_accounts_id_reconciliation",
        "summary": "Abstimmstatus abrufen",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-accounts/{id}/upload": {
      "post": {
        "operationId": "post_v1_bank_accounts_id_upload",
        "summary": "Kontoauszug hochladen",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-accounts/balance-history": {
      "get": {
        "operationId": "get_v1_bank_accounts_balance_history",
        "summary": "Saldo-Verlauf abrufen",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Anzahl Tage (1–365, Default: 90)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-match-groups": {
      "post": {
        "operationId": "post_v1_bank_match_groups",
        "summary": "Sammelabstimmung für mehrere Banktransaktionen anlegen",
        "tags": [
          "bank"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bank_transaction_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Mindestens eine offene Banktransaktion desselben Bankkontos"
                  },
                  "allocations": {
                    "type": "array",
                    "description": "Aufteilungen auf offene Posten"
                  },
                  "adjustments": {
                    "type": "array",
                    "description": "Explizite Gegenzeilen für Gebühren, Skonto, Write-offs oder sonstige Restdifferenzen"
                  }
                },
                "required": [
                  "bank_transaction_ids",
                  "allocations"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/bank-match-groups/{id}/unmatch": {
      "post": {
        "operationId": "post_v1_bank_match_groups_id_unmatch",
        "summary": "Sammelabstimmung aufheben",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-transactions": {
      "get": {
        "operationId": "get_v1_bank_transactions",
        "summary": "Transaktionen filtern und auflisten",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "bank_account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Nach Bankkonto filtern"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Ab Datum (YYYY-MM-DD)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bis Datum (YYYY-MM-DD)"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Suche in counterparty_name, reference"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`\"unreconciled\"`, `\"reconciled\"` oder `\"excluded\"`"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Max. Ergebnisse (Default: 200, Max: 500)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Offset für Paginierung"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "post_v1_bank_transactions",
        "summary": "Transaktionen importieren",
        "tags": [
          "bank"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bank_account_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Ziel-Bankkonto"
                  },
                  "transactions": {
                    "type": "array",
                    "description": "Transaktionen (max 1000)"
                  }
                },
                "required": [
                  "bank_account_id",
                  "transactions"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/bank-transactions/{id}": {
      "get": {
        "operationId": "get_v1_bank_transactions_id",
        "summary": "Einzelne Transaktion abrufen",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-transactions/{id}/dismiss": {
      "post": {
        "operationId": "post_v1_bank_transactions_id_dismiss",
        "summary": "0-Euro-Transaktion als erledigt markieren",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-transactions/{id}/evidence": {
      "get": {
        "operationId": "get_v1_bank_transactions_id_evidence",
        "summary": "Belegnachweis einer Transaktion abrufen",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "put_v1_bank_transactions_id_evidence",
        "summary": "Belegnachweis hinterlegen",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "evidence_type": {
                    "type": "string",
                    "description": "`\"bank_statement\"`, `\"uploaded_document\"` oder `\"eigenbeleg\"`"
                  },
                  "title": {
                    "type": "string",
                    "description": "Titel (max 200)"
                  },
                  "note": {
                    "type": "string",
                    "description": "Notiz (max 4000, Pflicht bei `eigenbeleg`)"
                  },
                  "document_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Dokument-ID (Pflicht bei `uploaded_document`)"
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Zusätzliche Metadaten"
                  }
                },
                "required": [
                  "evidence_type"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/bank-transactions/{id}/reconcile": {
      "post": {
        "operationId": "post_v1_bank_transactions_id_reconcile",
        "summary": "Transaktion einer Buchung zuordnen",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "intent_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Buchungs-Intent"
                  },
                  "candidate_kind": {
                    "type": "string",
                    "description": "`\"bank_booking\"`, `\"open_receivable\"` oder `\"open_liability\"`"
                  },
                  "open_item_account": {
                    "type": "string",
                    "description": "Erforderlich bei `open_receivable` / `open_liability`"
                  }
                },
                "required": [
                  "intent_id",
                  "candidate_kind"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/bank-transactions/{id}/unmatch": {
      "post": {
        "operationId": "post_v1_bank_transactions_id_unmatch",
        "summary": "Zuordnung aufheben",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-transactions/batch-reconcile": {
      "post": {
        "operationId": "post_v1_bank_transactions_batch_reconcile",
        "summary": "Batch-Abstimmung ausführen",
        "tags": [
          "bank"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pairs": {
                    "type": "array",
                    "description": "Zuordnungspaare (min. 1)"
                  }
                },
                "required": [
                  "pairs"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/bank-transactions/import-file": {
      "post": {
        "operationId": "post_v1_bank_transactions_import_file",
        "summary": "Kontoauszug per Datei-Upload importieren",
        "tags": [
          "bank"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-transactions/suggestions": {
      "get": {
        "operationId": "get_v1_bank_transactions_suggestions",
        "summary": "Matching-Vorschläge abrufen",
        "tags": [
          "bank"
        ],
        "parameters": [
          {
            "name": "bank_account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Bankkonto-ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bank-transactions/unreconciled-count": {
      "get": {
        "operationId": "get_v1_bank_transactions_unreconciled_count",
        "summary": "Offene Transaktionen zählen",
        "tags": [
          "bank"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/bookings": {
      "post": {
        "operationId": "post_v1_bookings",
        "summary": "Buchungs-Intent direkt erstellen",
        "tags": [
          "journal"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "booking_date": {
                    "type": "string",
                    "description": "Buchungsdatum (YYYY-MM-DD)"
                  },
                  "description": {
                    "type": "string",
                    "description": "Buchungstext"
                  },
                  "lines": {
                    "type": "array",
                    "description": "Eine oder mehrere Buchungszeilen; insgesamt muss Soll = Haben gelten"
                  },
                  "skip_duplicate_check": {
                    "type": "boolean",
                    "description": "Duplikatprüfung überspringen"
                  },
                  "adjustment_period": {
                    "type": "number",
                    "description": "`13` oder `14` für Abschlussperioden"
                  },
                  "fx": {
                    "type": "string",
                    "description": "Fremdwährungsblock für Buchungen in Nicht-EUR-Währungen. Alle fünf Felder sind Pflicht, wenn `fx` angegeben wird. EUR-Buchungen lassen `fx` weg oder setzen es auf `null`."
                  },
                  "external_reference": {
                    "type": "string",
                    "description": "Freitext-Referenz zu einem externen System (Rechnungsnummer, Stripe-ID, ERP-Referenz). Max. 500 Zeichen. Unveränderlich nach Erstellung."
                  },
                  "custom_metadata": {
                    "type": "string",
                    "description": "Flaches Key-Value-Objekt für beliebigen Aufruferkontext (Kostenstelle, Projekt, Tags). Max. 20 Schlüssel, Schlüssel max. 64 Zeichen, String-Werte max. 256 Zeichen, Gesamt max. 4 KB. Werte dürfen `string`, `number`, `boolean` oder `null` sein. Unveränderlich nach Erstellung."
                  },
                  "document_id": {
                    "type": "string",
                    "description": "Optionale Referenz auf ein zuvor hochgeladenes Dokument. Die UUID stammt aus `POST /v1/documents`."
                  }
                },
                "required": [
                  "booking_date",
                  "description",
                  "lines"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/bookings/opening-balances": {
      "post": {
        "operationId": "post_v1_bookings_opening_balances",
        "summary": "Eröffnungsbilanzwerte (EB-Werte) buchen",
        "tags": [
          "journal"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "booking_date": {
                    "type": "string",
                    "description": "Buchungsdatum der EB-Werte (YYYY-MM-DD), typischerweise der erste Tag des neuen Geschäftsjahres"
                  },
                  "balances": {
                    "type": "array",
                    "description": "Saldenvorträge. Jeder Eintrag hat genau einen Betrag > 0 (entweder Soll oder Haben). Einträge mit Soll = Haben = 0 werden ignoriert."
                  }
                },
                "required": [
                  "booking_date",
                  "balances"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/contact": {
      "post": {
        "operationId": "post_v1_contact",
        "summary": "Kontaktanfrage absenden",
        "tags": [
          "public"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Absendername (1-100 Zeichen)"
                  },
                  "email": {
                    "type": "string",
                    "description": "gültige E-Mail-Adresse"
                  },
                  "message": {
                    "type": "string",
                    "description": "Nachricht (10-2000 Zeichen)"
                  },
                  "_honeypot": {
                    "type": "string",
                    "description": "Bot-Falle; wird bei legitimen Clients leer gelassen oder weggelassen"
                  }
                },
                "required": [
                  "name",
                  "email",
                  "message"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/customers": {
      "get": {
        "operationId": "get_v1_customers",
        "summary": "Debitoren auflisten",
        "tags": [
          "receivables"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Freitextsuche in Name und USt-IdNr."
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`\"true\"` oder `\"false\"` (Default: alle)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max. Ergebnisse (1–500, Default: 50)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Offset fuer Paginierung (Default: 0)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "post_v1_customers",
        "summary": "Debitor anlegen",
        "tags": [
          "receivables"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name des Debitors (max 255)"
                  },
                  "tax_id": {
                    "type": "string",
                    "description": "Steuernummer (max 20)"
                  },
                  "vat_id": {
                    "type": "string",
                    "description": "USt-IdNr. (max 20)"
                  },
                  "iban": {
                    "type": "string",
                    "description": "IBAN (max 34)"
                  },
                  "bic": {
                    "type": "string",
                    "description": "BIC (max 11)"
                  },
                  "address": {
                    "type": "object",
                    "description": "Adresse mit `street`, `city`, `zip`, `country`"
                  },
                  "default_account": {
                    "type": "string",
                    "description": "Standard-Erloeskonto (muss im Kontenplan existieren)"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Freitext-Notizen (max 2000)"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/customers/{id}": {
      "delete": {
        "operationId": "delete_v1_customers_id",
        "summary": "Debitor deaktivieren",
        "tags": [
          "receivables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "get_v1_customers_id",
        "summary": "Debitor-Details abrufen",
        "tags": [
          "receivables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "put_v1_customers_id",
        "summary": "Debitor aktualisieren",
        "tags": [
          "receivables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name (max 255)"
                  },
                  "tax_id": {
                    "type": "string",
                    "description": "Steuernummer"
                  },
                  "vat_id": {
                    "type": "string",
                    "description": "USt-IdNr."
                  },
                  "iban": {
                    "type": "string",
                    "description": "IBAN"
                  },
                  "bic": {
                    "type": "string",
                    "description": "BIC"
                  },
                  "address": {
                    "type": "string",
                    "description": "Adresse"
                  },
                  "default_account": {
                    "type": "string",
                    "description": "Standard-Erloeskonto"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Freitext-Notizen"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents": {
      "post": {
        "operationId": "post_v1_documents",
        "summary": "Dokument hochladen",
        "tags": [
          "journal"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Beleg-Datei (PDF/JPG/PNG, max. 10 MB). MIME-Typ wird zusätzlich über Magic Bytes validiert."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/documents/{id}/file": {
      "get": {
        "operationId": "get_v1_documents_id_file",
        "summary": "Dokument herunterladen",
        "tags": [
          "journal"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/documents/{id}/preview": {
      "get": {
        "operationId": "get_v1_documents_id_preview",
        "summary": "Inline-Dokumentvorschau",
        "tags": [
          "journal"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/inbox": {
      "get": {
        "operationId": "get_v1_inbox",
        "summary": "Eingangsbelege auflisten",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filtert nach Status: pending, processing, confirmed, rejected. Standard: pending"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Maximale Anzahl Ergebnisse (1–200). Standard: 50"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Offset für Paginierung. Standard: 0"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/inbox/{id}": {
      "get": {
        "operationId": "get_v1_inbox_id",
        "summary": "Eingangsbeleg-Details abrufen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/inbox/{id}/confirm": {
      "post": {
        "operationId": "post_v1_inbox_id_confirm",
        "summary": "Eingangsbeleg bestätigen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/inbox/{id}/reject": {
      "post": {
        "operationId": "post_v1_inbox_id_reject",
        "summary": "Eingangsbeleg ablehnen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Optionaler Ablehnungsgrund."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/inbox/address": {
      "get": {
        "operationId": "get_v1_inbox_address",
        "summary": "Eingangs-E-Mail-Adresse abrufen",
        "tags": [
          "payables"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/invoice-review-cases": {
      "get": {
        "operationId": "get_v1_invoice_review_cases",
        "summary": "Rechnungs-Review-Faelle auflisten",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "queue_state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`\"approval\"`, `\"correction\"`, `\"exception\"`, `\"approved\"`, `\"rejected\"` oder `\"posting_failed\"`"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max. Ergebnisse (1-200, Default: 50)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Offset fuer Paginierung (Default: 0)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/invoice-review-cases/{id}": {
      "get": {
        "operationId": "get_v1_invoice_review_cases_id",
        "summary": "Review-Fall-Details abrufen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "patch_v1_invoice_review_cases_id",
        "summary": "Review-Fall aktualisieren",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendor_id": {
                    "type": "string",
                    "description": "Kreditor, gegen den der Review-Fall gebucht werden soll (oder `null` zum Leeren)."
                  },
                  "normalized_invoice": {
                    "type": "object",
                    "description": "Vollstaendiges normalisiertes Rechnungsobjekt (Kreditor, Rechnungsnummer, Daten, Summen, Positionen)."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoice-review-cases/{id}/approve": {
      "post": {
        "operationId": "post_v1_invoice_review_cases_id_approve",
        "summary": "Review-Fall freigeben",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/invoice-review-cases/{id}/reject": {
      "post": {
        "operationId": "post_v1_invoice_review_cases_id_reject",
        "summary": "Review-Fall ablehnen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Freitext-Ablehnungsgrund (max 1000)."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoices": {
      "get": {
        "operationId": "get_v1_invoices",
        "summary": "Rechnungen auflisten",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "vendor_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Nach Kreditor filtern"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`\"draft\"`, `\"open\"`, `\"partially_paid\"`, `\"paid\"` oder `\"overdue\"`"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Ab Rechnungsdatum (YYYY-MM-DD)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bis Rechnungsdatum (YYYY-MM-DD)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max. Ergebnisse (1–500, Default: 100)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Offset fuer Paginierung (Default: 0)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "post_v1_invoices",
        "summary": "Rechnung anlegen",
        "tags": [
          "payables"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendor_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Kreditor-ID"
                  },
                  "document_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Verknuepftes Dokument (z.B. OCR-Scan)"
                  },
                  "invoice_number": {
                    "type": "string",
                    "description": "Rechnungsnummer (max 100)"
                  },
                  "invoice_date": {
                    "type": "string",
                    "description": "Rechnungsdatum (YYYY-MM-DD)"
                  },
                  "due_date": {
                    "type": "string",
                    "description": "Faelligkeitsdatum (YYYY-MM-DD)"
                  },
                  "total_net": {
                    "type": "number",
                    "description": "Nettobetrag"
                  },
                  "total_tax": {
                    "type": "number",
                    "description": "Steuerbetrag"
                  },
                  "total_gross": {
                    "type": "number",
                    "description": "Bruttobetrag"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Waehrung (3 Zeichen, Default: EUR)"
                  },
                  "intent_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Verknuepfter Journal-Intent (setzt Status auf open)"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Freitext-Notizen (max 2000)"
                  },
                  "lines": {
                    "type": "array",
                    "description": "Rechnungspositionen (min. 1)"
                  }
                },
                "required": [
                  "vendor_id",
                  "invoice_number",
                  "invoice_date",
                  "total_net",
                  "total_tax",
                  "total_gross",
                  "lines"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/invoices/{id}": {
      "get": {
        "operationId": "get_v1_invoices_id",
        "summary": "Rechnungsdetails abrufen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "patch_v1_invoices_id",
        "summary": "Rechnung aktualisieren",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "intent_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Journal-Intent verknuepfen (nur einmal setzbar)"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Freitext-Notizen"
                  },
                  "due_date": {
                    "type": "string",
                    "description": "Faelligkeitsdatum (YYYY-MM-DD)"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoices/open-items": {
      "get": {
        "operationId": "get_v1_invoices_open_items",
        "summary": "Offene Posten (Verbindlichkeiten)",
        "tags": [
          "payables"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/journal": {
      "get": {
        "operationId": "get_v1_journal",
        "summary": "Journalzeilen listen",
        "tags": [
          "journal"
        ],
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Nach Kontonummer filtern"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Ab Datum (YYYY-MM-DD)"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bis Datum (YYYY-MM-DD)"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Suche in Beschreibung, Kontonummern und external_reference"
          },
          {
            "name": "externalReference",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exakter Filter auf `external_reference`"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Max. Ergebnisse (Default: 200, Max: 1000)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/journal/{intent_id}": {
      "get": {
        "operationId": "get_v1_journal_intent_id",
        "summary": "Intent abrufen",
        "tags": [
          "journal"
        ],
        "parameters": [
          {
            "name": "intent_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/journal/reverse": {
      "post": {
        "operationId": "post_v1_journal_reverse",
        "summary": "Intent stornieren (Gegenbuchung)",
        "tags": [
          "journal"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "intent_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "ID des zu stornierenden Intents"
                  },
                  "reason": {
                    "type": "string",
                    "description": "Stornogrund"
                  },
                  "posting_mode": {
                    "type": "string",
                    "description": "Default: current_period. original_period bucht in die offene Ursprungsperiode."
                  }
                },
                "required": [
                  "intent_id"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/ocr/extract": {
      "post": {
        "operationId": "post_v1_ocr_extract",
        "summary": "Rechnung per OCR extrahieren",
        "tags": [
          "payables"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/outgoing-invoices": {
      "get": {
        "operationId": "get_v1_outgoing_invoices",
        "summary": "Ausgangsrechnungen auflisten",
        "tags": [
          "receivables"
        ],
        "parameters": [
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Nach Debitor filtern"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`\"draft\"`, `\"open\"`, `\"partially_paid\"`, `\"paid\"` oder `\"overdue\"`"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`\"invoice\"` oder `\"credit_note\"`"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Ab Rechnungsdatum (YYYY-MM-DD)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Bis Rechnungsdatum (YYYY-MM-DD)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max. Ergebnisse (1–500, Default: 100)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Offset fuer Paginierung (Default: 0)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "post_v1_outgoing_invoices",
        "summary": "Ausgangsrechnung anlegen",
        "tags": [
          "receivables"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Debitor-ID"
                  },
                  "document_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Verknuepftes Dokument (z.B. OCR-Scan)"
                  },
                  "invoice_number": {
                    "type": "string",
                    "description": "Rechnungsnummer (max 100)"
                  },
                  "invoice_date": {
                    "type": "string",
                    "description": "Rechnungsdatum (YYYY-MM-DD)"
                  },
                  "due_date": {
                    "type": "string",
                    "description": "Faelligkeitsdatum (YYYY-MM-DD)"
                  },
                  "total_net": {
                    "type": "number",
                    "description": "Nettobetrag"
                  },
                  "total_tax": {
                    "type": "number",
                    "description": "Steuerbetrag"
                  },
                  "total_gross": {
                    "type": "number",
                    "description": "Bruttobetrag"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Waehrung (3 Zeichen, Default: EUR)"
                  },
                  "type": {
                    "type": "string",
                    "description": "`\"invoice\"` oder `\"credit_note\"`"
                  },
                  "intent_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Verknuepfter Journal-Intent (setzt Status auf open)"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Freitext-Notizen (max 2000)"
                  },
                  "lines": {
                    "type": "array",
                    "description": "Rechnungspositionen (min. 1)"
                  }
                },
                "required": [
                  "customer_id",
                  "invoice_number",
                  "invoice_date",
                  "total_net",
                  "total_tax",
                  "total_gross",
                  "type",
                  "lines"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/outgoing-invoices/{id}": {
      "get": {
        "operationId": "get_v1_outgoing_invoices_id",
        "summary": "Ausgangsrechnung abrufen",
        "tags": [
          "receivables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "patch_v1_outgoing_invoices_id",
        "summary": "Ausgangsrechnung aktualisieren",
        "tags": [
          "receivables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "intent_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Journal-Intent verknuepfen (nur einmal setzbar)"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Freitext-Notizen"
                  },
                  "due_date": {
                    "type": "string",
                    "description": "Faelligkeitsdatum (YYYY-MM-DD)"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/outgoing-invoices/open-items": {
      "get": {
        "operationId": "get_v1_outgoing_invoices_open_items",
        "summary": "Offene Posten (Forderungen)",
        "tags": [
          "receivables"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/payables/ingestion-log": {
      "get": {
        "operationId": "get_v1_payables_ingestion_log",
        "summary": "Eingehende E-Mail-Verarbeitungsversuche auflisten",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max. Ergebnisse (1-200, Default: 100)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Offset fuer Paginierung (Default: 0)"
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`\"ingested\"`, `\"skipped_duplicate\"`, `\"rejected_invalid\"` oder `\"failed\"`. Kann mehrfach gesetzt werden, um mehrere Outcomes zu filtern."
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/payment-runs": {
      "get": {
        "operationId": "get_v1_payment_runs",
        "summary": "Zahlungsläufe auflisten",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filtern nach Status: draft, approved, exported, completed, cancelled."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max. Ergebnisse (1–500, Default: 100)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Offset für Paginierung (Default: 0)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "post_v1_payment_runs",
        "summary": "Zahlungslauf erstellen",
        "tags": [
          "payables"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bank_account_id": {
                    "type": "string",
                    "description": "Bankkonto für die Zahlung."
                  },
                  "execution_date": {
                    "type": "string",
                    "description": "Gewünschtes SEPA-Ausführungsdatum."
                  },
                  "invoice_ids": {
                    "type": "string",
                    "description": "Rechnungs-UUIDs die eingeschlossen werden sollen."
                  },
                  "label": {
                    "type": "string",
                    "description": "Optionale Bezeichnung für den Lauf."
                  }
                },
                "required": [
                  "bank_account_id",
                  "execution_date",
                  "invoice_ids"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/payment-runs/{id}": {
      "get": {
        "operationId": "get_v1_payment_runs_id",
        "summary": "Zahlungslauf abrufen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/payment-runs/{id}/approve": {
      "post": {
        "operationId": "post_v1_payment_runs_id_approve",
        "summary": "Zahlungslauf genehmigen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/payment-runs/{id}/cancel": {
      "post": {
        "operationId": "post_v1_payment_runs_id_cancel",
        "summary": "Zahlungslauf stornieren",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/payment-runs/{id}/complete": {
      "post": {
        "operationId": "post_v1_payment_runs_id_complete",
        "summary": "Zahlungslauf abschließen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/payment-runs/{id}/export": {
      "post": {
        "operationId": "post_v1_payment_runs_id_export",
        "summary": "Zahlungslauf exportieren (SEPA XML)",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/payment-runs/eligible-invoices": {
      "get": {
        "operationId": "get_v1_payment_runs_eligible_invoices",
        "summary": "Zahlungsfähige Rechnungen auflisten",
        "tags": [
          "payables"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/periods": {
      "get": {
        "operationId": "get_v1_periods",
        "summary": "Perioden auflisten",
        "tags": [
          "periods"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/periods/{period}/lock": {
      "post": {
        "operationId": "post_v1_periods_period_lock",
        "summary": "Lock-Anfrage erstellen (Vier-Augen-Prinzip)",
        "tags": [
          "periods"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/periods/{period}/lock/{requestId}/approve": {
      "post": {
        "operationId": "post_v1_periods_period_lock_requestId_approve",
        "summary": "Lock-Anfrage genehmigen",
        "tags": [
          "periods"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/periods/{period}/lock/{requestId}/cancel": {
      "post": {
        "operationId": "post_v1_periods_period_lock_requestId_cancel",
        "summary": "Lock-Anfrage abbrechen",
        "tags": [
          "periods"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/periods/{period}/lock/status": {
      "get": {
        "operationId": "get_v1_periods_period_lock_status",
        "summary": "Lock-Anfrage Status",
        "tags": [
          "periods"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/periods/{period}/reopen": {
      "post": {
        "operationId": "post_v1_periods_period_reopen",
        "summary": "Soft-Lock aufheben",
        "tags": [
          "periods"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/periods/{period}/soft-lock": {
      "post": {
        "operationId": "post_v1_periods_period_soft_lock",
        "summary": "Soft-Lock setzen",
        "tags": [
          "periods"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/reports": {
      "get": {
        "operationId": "get_v1_reports",
        "summary": "Finanzberichte abrufen",
        "tags": [
          "reports"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`\"guv\"`, `\"bilanz\"` oder `\"susa\"`"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Start-Datum (YYYY-MM-DD)"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "End-Datum (YYYY-MM-DD)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/reports/datev-export": {
      "get": {
        "operationId": "get_v1_reports_datev_export",
        "summary": "DATEV-Export erzeugen",
        "tags": [
          "reports"
        ],
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Start-Datum (YYYY-MM-DD)"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "End-Datum (YYYY-MM-DD)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/reports/monthly-revenue-expenses": {
      "get": {
        "operationId": "get_v1_reports_monthly_revenue_expenses",
        "summary": "Monatliche Erträge und Aufwendungen abrufen",
        "tags": [
          "reports"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/tax-codes": {
      "get": {
        "operationId": "get_v1_tax_codes",
        "summary": "Steuercodes auflisten",
        "tags": [
          "config"
        ],
        "parameters": [
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional `true`, um auch deaktivierte Steuercodes zurückzugeben"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "post_v1_tax_codes",
        "summary": "Custom-Steuercode anlegen",
        "tags": [
          "config"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Mandantenweit eindeutiger Code, max. 20 Zeichen, alphanumerisch plus `-`"
                  },
                  "label": {
                    "type": "string",
                    "description": "Anzeigename des Steuercodes, max. 120 Zeichen"
                  },
                  "description": {
                    "type": "string",
                    "description": "Optionale Beschreibung, wann dieser Steuercode zu verwenden ist (max. 500 Zeichen)"
                  },
                  "rate": {
                    "type": "number",
                    "description": "Steuersatz in Prozent"
                  },
                  "vat_account": {
                    "type": "string",
                    "description": "Vorsteuer-/Umsatzsteuerkonto im tenant-spezifischen Kontenplan"
                  },
                  "self_assess_account": {
                    "type": "string",
                    "description": "Optionales Gegenkonto für Selbstveranlagung / Reverse Charge"
                  }
                },
                "required": [
                  "code",
                  "label",
                  "rate",
                  "vat_account"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/tax-codes/{code}": {
      "delete": {
        "operationId": "delete_v1_tax_codes_code",
        "summary": "Steuercode deaktivieren",
        "tags": [
          "config"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "patch_v1_tax_codes_code",
        "summary": "Steuercode aktualisieren",
        "tags": [
          "config"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "description": "Neues Label"
                  },
                  "description": {
                    "type": "string",
                    "description": "Neue Beschreibung oder `null` zum Entfernen"
                  },
                  "rate": {
                    "type": "number",
                    "description": "Neuer Steuersatz"
                  },
                  "vat_account": {
                    "type": "string",
                    "description": "Neues Steuerkonto"
                  },
                  "self_assess_account": {
                    "type": "string",
                    "description": "Neues Gegenkonto oder `null`, um Selbstveranlagung zu entfernen"
                  },
                  "is_active": {
                    "type": "boolean",
                    "description": "Aktivstatus des Codes"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tenant": {
      "get": {
        "operationId": "get_v1_tenant",
        "summary": "Tenant-Stammdaten abrufen",
        "tags": [
          "config"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "patch_v1_tenant",
        "summary": "Tenant-Stammdaten aktualisieren",
        "tags": [
          "config"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_name": {
                    "type": "string",
                    "description": "Firmenname (max 200)"
                  },
                  "tax_id": {
                    "type": "string",
                    "description": "Steuernummer (max 50)"
                  },
                  "vat_id": {
                    "type": "string",
                    "description": "USt-IdNr. (max 50)"
                  },
                  "account_framework": {
                    "type": "string",
                    "description": "Kontenrahmen: `\"SKR04\"` (DE-Standard), `\"SKR03\"` (DE-Alternative) oder `\"CUSTOM\"` (minimales Skelett für Nicht-DE-Tenants; der Mandant baut den Kontenplan selbst auf)."
                  },
                  "fiscal_year_start": {
                    "type": "number",
                    "description": "Startmonat des Wirtschaftsjahrs (1-12)"
                  },
                  "vat_registered": {
                    "type": "boolean",
                    "description": "Umsatzsteuer-pflichtig"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/vendors": {
      "get": {
        "operationId": "get_v1_vendors",
        "summary": "Kreditoren auflisten",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Freitextsuche in Name und USt-IdNr."
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`\"true\"` oder `\"false\"` (Default: alle)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max. Ergebnisse (1–500, Default: 50)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Offset fuer Paginierung (Default: 0)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "post_v1_vendors",
        "summary": "Kreditor anlegen",
        "tags": [
          "payables"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name des Kreditors (max 255)"
                  },
                  "tax_id": {
                    "type": "string",
                    "description": "Steuernummer (max 20)"
                  },
                  "vat_id": {
                    "type": "string",
                    "description": "USt-IdNr. (max 20)"
                  },
                  "iban": {
                    "type": "string",
                    "description": "IBAN (max 34)"
                  },
                  "bic": {
                    "type": "string",
                    "description": "BIC (max 11)"
                  },
                  "address": {
                    "type": "object",
                    "description": "Adresse mit `street`, `city`, `zip`, `country`"
                  },
                  "default_account": {
                    "type": "string",
                    "description": "Standard-Aufwandskonto (muss im Kontenplan existieren)"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Freitext-Notizen (max 2000)"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/vendors/{id}": {
      "delete": {
        "operationId": "delete_v1_vendors_id",
        "summary": "Kreditor deaktivieren",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "get_v1_vendors_id",
        "summary": "Kreditor-Details abrufen",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "put_v1_vendors_id",
        "summary": "Kreditor aktualisieren",
        "tags": [
          "payables"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name (max 255)"
                  },
                  "tax_id": {
                    "type": "string",
                    "description": "Steuernummer"
                  },
                  "vat_id": {
                    "type": "string",
                    "description": "USt-IdNr."
                  },
                  "iban": {
                    "type": "string",
                    "description": "IBAN"
                  },
                  "bic": {
                    "type": "string",
                    "description": "BIC"
                  },
                  "address": {
                    "type": "string",
                    "description": "Adresse"
                  },
                  "default_account": {
                    "type": "string",
                    "description": "Standard-Aufwandskonto"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Freitext-Notizen"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
