{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/finisma-de/json-schema/finisma-de-payment-file-result-schema.json",
  "title": "PaymentFileResult",
  "description": "JSON-Hülle der Zahlungsdatei-Endpoints. Kommt nur bei ausdrücklichem Accept: application/json (ohne */*-Platzhalter), sonst antwortet der Endpoint direkt mit dem XML.",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/finisma-de-openapi.json#/components/schemas/PaymentFileResult",
  "type": "object",
  "properties": {
    "filename": {
      "type": "string",
      "description": "Vorgeschlagener Dateiname, gleiches Schema wie der Content-Disposition-Name der XML-Antwort (sepa-inland-<Datum>.xml bzw. axz-ausland-<Datum>.xml)."
    },
    "summary": {
      "type": "object",
      "properties": {
        "payments": {
          "type": "integer",
          "description": "Anzahl der Zahlungen."
        },
        "controlSum": {
          "type": "string",
          "description": "Kontrollsumme, identisch mit CtrlSum im XML."
        },
        "requestedExecutionDate": {
          "type": "string",
          "description": "Ausführungsdatum (yyyy-mm-dd)."
        }
      },
      "required": [
        "payments",
        "controlSum",
        "requestedExecutionDate"
      ]
    },
    "warnings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PaymentIssue"
      },
      "description": "Nicht blockierende Meldungen (severity warning oder info)."
    },
    "verification": {
      "type": "string",
      "enum": [
        "autoritativ",
        "eingeschränkt"
      ],
      "description": "autoritativ = die Datei hat das QA-Gate (DK-TVS bzw. AXZ-TVS) durchlaufen; eingeschränkt = kein Validator konfiguriert, geprüft wurden nur Schema und Geschäftsregeln."
    }
  },
  "required": [
    "xml",
    "filename",
    "summary",
    "warnings",
    "verification"
  ],
  "$defs": {
    "PaymentIssue": {
      "type": "object",
      "description": "Eine Meldung der Zahllauf-Prüfung. error blockiert die Datei (422), warning und info nicht (sie stehen in der JSON-Antwort als warnings).",
      "properties": {
        "code": {
          "type": "string",
          "description": "Maschinencode, z. B. \"PAY_IBAN_INVALID\"."
        },
        "message": {
          "type": "string",
          "description": "Deutsche Fehlermeldung."
        },
        "path": {
          "type": "string",
          "description": "Punkt-Pfad in den Zahllauf, z. B. \"payments.0.creditorIban\"."
        },
        "severity": {
          "type": "string",
          "enum": [
            "error",
            "warning",
            "info"
          ]
        }
      },
      "required": [
        "code",
        "message",
        "severity"
      ]
    }
  }
}