Skip to main content

Goal

Turn a bank statement into normalized JSON with citations for the fields your application needs.

Sample Document

Use the built-in Bank Statement Platform example. The example includes a saved schema with fields for account_number, account_holder, summary, transactions, and checks_paid.

Use This Workflow

Use Extract -> Schema because a bank statement usually has one document-level structure: account identity, statement period, summary balances, transaction rows, and checks.

Platform Steps

1

Upload the statement

Open New Extraction, upload a representative statement, and run Extract.
2

Add Schema

Add a Schema step and define fields for account metadata, balances, transactions, and checks.
3

Test citations

Review the Schema result and click citations to confirm each value came from the right part of the document.
4

Save a schema preset

Once the output is stable, save the schema preset and use Show Code for the production implementation.

Schema

{
  "type": "object",
  "properties": {
    "account_number": {
      "type": "string",
      "description": "The bank account number shown on the statement"
    },
    "account_holder": {
      "type": "string",
      "description": "The person or business that owns the account"
    },
    "summary": {
      "type": "object",
      "description": "Opening balance, deposits, withdrawals, fees, and closing balance",
      "properties": {
        "opening_balance": { "type": "number" },
        "closing_balance": { "type": "number" },
        "total_deposits": { "type": "number" },
        "total_withdrawals": { "type": "number" }
      }
    },
    "transactions": {
      "type": "array",
      "description": "Individual transaction rows in the statement",
      "items": {
        "type": "object",
        "properties": {
          "date": { "type": "string" },
          "description": { "type": "string" },
          "amount": { "type": "number" },
          "type": { "type": "string", "enum": ["credit", "debit"] }
        }
      }
    }
  },
  "required": ["account_number", "account_holder", "summary", "transactions"]
}

Python

from pulse import Pulse

client = Pulse(api_key="YOUR_API_KEY")

schema = {
    "type": "object",
    "properties": {
        "account_number": {"type": "string", "description": "The account number"},
        "account_holder": {"type": "string", "description": "The owner of the account"},
        "summary": {
            "type": "object",
            "properties": {
                "opening_balance": {"type": "number"},
                "closing_balance": {"type": "number"},
                "total_deposits": {"type": "number"},
                "total_withdrawals": {"type": "number"},
            },
        },
        "transactions": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "date": {"type": "string"},
                    "description": {"type": "string"},
                    "amount": {"type": "number"},
                    "type": {"type": "string", "enum": ["credit", "debit"]},
                },
            },
        },
    },
    "required": ["account_number", "account_holder", "summary", "transactions"],
}

extract_result = client.extract(
    file_url="https://platform.runpulse.com/api/examples/637e5678-30b1-45fa-acc4-877f2d636419/pdf"
)

schema_result = client.schema(
    extraction_id=extract_result.extraction_id,
    schema_config={
        "input_schema": schema,
        "schema_prompt": "Extract statement metadata, balances, transactions, and checks.",
    },
)

print(schema_result.schema_output["values"])

TypeScript

import { PulseClient } from "pulse-ts-sdk";

const client = new PulseClient({ apiKey: "YOUR_API_KEY" });

const extractResult = await client.extract({
  fileUrl: "https://platform.runpulse.com/api/examples/637e5678-30b1-45fa-acc4-877f2d636419/pdf",
});

const schemaResult = await client.schema({
  extraction_id: extractResult.extraction_id,
  schema_config: {
    input_schema: {
      type: "object",
      properties: {
        account_number: { type: "string", description: "The account number" },
        account_holder: { type: "string", description: "The owner of the account" },
        summary: {
          type: "object",
          properties: {
            opening_balance: { type: "number" },
            closing_balance: { type: "number" },
            total_deposits: { type: "number" },
            total_withdrawals: { type: "number" },
          },
        },
        transactions: {
          type: "array",
          items: {
            type: "object",
            properties: {
              date: { type: "string" },
              description: { type: "string" },
              amount: { type: "number" },
              type: { type: "string", enum: ["credit", "debit"] },
            },
          },
        },
      },
      required: ["account_number", "account_holder", "summary", "transactions"],
    },
    schema_prompt: "Extract statement metadata, balances, transactions, and checks.",
  },
});

console.log(schemaResult.schema_output?.values);

Checks

  • Reconcile extracted transaction totals against the statement summary before writing to a system of record.
  • Keep debits, credits, fees, and checks explicit; do not rely on sign alone if your downstream ledger expects labels.
  • Review citations for any transaction used in compliance, underwriting, lending, or audit workflows.
  • Save a schema preset after testing several statement formats.

Extract -> Schema

Build this visually in the Platform.

Schema Guidelines

Improve structured output quality.