Bank Statement

Extract account info, transactions, and balances.

Schema Key

bank-statement

Usage

Use this template when creating a schema via the API or SDK:

const schema = await client.schemas.create('my-workspace', {
  schemaKey: 'bank-statement',
  name: 'Bank Statement',
  definition: { /* see definition below */ },
});

Definition

{
  "type": "object",
  "properties": {
    "account": {
      "type": "object",
      "description": "Bank account information.",
      "properties": {
        "holder_name": {
          "type": "string",
          "description": "Name of the account holder."
        },
        "account_number": {
          "type": "string",
          "description": "Account number (may be partially masked)."
        },
        "bank_name": {
          "type": "string",
          "description": "Name of the bank or financial institution."
        },
        "account_type": {
          "type": "string",
          "description": "Type of account (e.g. Checking, Savings)."
        },
        "currency": {
          "type": "string",
          "description": "Currency code (e.g. USD, EUR)."
        }
      },
      "required": [
        "holder_name",
        "account_number",
        "bank_name"
      ],
      "additionalProperties": false
    },
    "statement_period": {
      "type": "object",
      "description": "Period covered by the statement.",
      "properties": {
        "start": {
          "type": "object",
          "properties": {
            "year": {
              "type": "integer",
              "description": "Year (e.g. 2024)."
            },
            "month": {
              "type": "integer",
              "description": "Month (1-12).",
              "minimum": 1,
              "maximum": 12
            },
            "day": {
              "type": "integer",
              "description": "Day of the month.",
              "minimum": 1,
              "maximum": 31
            }
          },
          "required": [
            "year",
            "month",
            "day"
          ],
          "additionalProperties": false
        },
        "end": {
          "type": "object",
          "properties": {
            "year": {
              "type": "integer",
              "description": "Year (e.g. 2024)."
            },
            "month": {
              "type": "integer",
              "description": "Month (1-12).",
              "minimum": 1,
              "maximum": 12
            },
            "day": {
              "type": "integer",
              "description": "Day of the month.",
              "minimum": 1,
              "maximum": 31
            }
          },
          "required": [
            "year",
            "month",
            "day"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false
    },
    "opening_balance": {
      "type": "number",
      "description": "Account balance at the start of the period."
    },
    "closing_balance": {
      "type": "number",
      "description": "Account balance at the end of the period."
    },
    "transactions": {
      "type": "array",
      "description": "List of transactions during the statement period.",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "object",
            "description": "Date of the transaction.",
            "properties": {
              "year": {
                "type": "integer",
                "description": "Year (e.g. 2024)."
              },
              "month": {
                "type": "integer",
                "description": "Month (1-12).",
                "minimum": 1,
                "maximum": 12
              },
              "day": {
                "type": "integer",
                "description": "Day of the month.",
                "minimum": 1,
                "maximum": 31
              }
            },
            "required": [
              "year",
              "month",
              "day"
            ],
            "additionalProperties": false
          },
          "description": {
            "type": "string",
            "description": "Transaction description or reference."
          },
          "amount": {
            "type": "number",
            "description": "Transaction amount (positive for credits, negative for debits)."
          },
          "type": {
            "type": "string",
            "description": "Transaction type (e.g. Deposit, Withdrawal, Transfer, Fee)."
          },
          "balance": {
            "type": "number",
            "description": "Running balance after this transaction."
          }
        },
        "required": [
          "date",
          "description",
          "amount"
        ],
        "additionalProperties": false
      }
    },
    "total_deposits": {
      "type": "number",
      "description": "Sum of all deposits/credits during the period."
    },
    "total_withdrawals": {
      "type": "number",
      "description": "Sum of all withdrawals/debits during the period."
    }
  },
  "required": [
    "account",
    "statement_period",
    "opening_balance",
    "closing_balance",
    "transactions"
  ],
  "additionalProperties": false
}