{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/declararfacil-com/json-schema/declararfacil-com-bank-statement-input-schema.json",
  "title": "BankStatementInput",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/declararfacil-com-openapi.json#/components/schemas/BankStatementInput",
  "type": "object",
  "required": [
    "transactions"
  ],
  "properties": {
    "bankName": {
      "type": [
        "string",
        "null"
      ]
    },
    "bankBIC": {
      "type": [
        "string",
        "null"
      ]
    },
    "accountIBAN": {
      "type": [
        "string",
        "null"
      ]
    },
    "periodStart": {
      "type": [
        "string",
        "null"
      ],
      "description": "YYYY-MM-DD"
    },
    "periodEnd": {
      "type": [
        "string",
        "null"
      ],
      "description": "YYYY-MM-DD"
    },
    "openingBalance": {
      "type": [
        "number",
        "null"
      ]
    },
    "closingBalance": {
      "type": [
        "number",
        "null"
      ]
    },
    "source_file": {
      "type": [
        "string",
        "null"
      ]
    },
    "transactions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "date",
          "concept",
          "amount"
        ],
        "properties": {
          "date": {
            "type": "string",
            "description": "YYYY-MM-DD"
          },
          "valueDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "concept": {
            "type": "string",
            "description": "The statement line text, complete"
          },
          "counterpartyName": {
            "type": [
              "string",
              "null"
            ]
          },
          "counterpartyIBAN": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount": {
            "type": "number",
            "description": "Negative for debits, positive for credits, in EUR"
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "description": "SEGURIDAD_SOCIAL, COMISIONES_BANCARIAS, IMPUESTOS, ALQUILER, SUMINISTROS, OTROS, or null"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}