{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/frihet-io/json-schema/frihet-io-bank-transaction-schema.json",
  "title": "BankTransaction",
  "description": "A bank transaction. Positive amount = income, negative = expense.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/frihet-io-banking-api-openapi.yml#/components/schemas/BankTransaction",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "connectionId": {
      "type": "string",
      "description": "ID of the owning bank account (accountId)."
    },
    "transactionId": {
      "type": "string",
      "description": "Provider transaction ID (manual-* for API-created entries)."
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "amount": {
      "type": "number",
      "description": "Positive for income, negative for expenses."
    },
    "currency": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "category": {
      "type": [
        "string",
        "null"
      ]
    },
    "counterparty": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "accountNumber": {
          "type": "string"
        },
        "iban": {
          "type": "string"
        }
      }
    },
    "reconciled": {
      "type": "boolean"
    },
    "reconciledWith": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "invoice",
        "expense"
      ]
    },
    "reconciledId": {
      "type": [
        "string",
        "null"
      ]
    },
    "reconciledAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "raw",
        "recognized",
        "matched",
        "categorized",
        "excluded"
      ]
    },
    "source": {
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updatedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}