Validate statement (dry run)
validate_statementValidates a bank statement text to confirm it is well-formed and parseable. Returns pass/fail status and transaction count without extracting data.
Instructions
Dry-run parse an inline statement to check it parses cleanly.
Use this to confirm a payload is well-formed and parseable before
committing to a full read; it returns a structured pass/fail with the
transaction count but never the rows themselves, and never raises on a
parse error. To actually read the transactions use ``parse_statement``.
Args:
content: The raw statement text.
filename: Original filename; its extension selects the format.
format: Explicit format override.
Returns:
A dict with ``is_valid``, the resolved ``format``, the
``transaction_count`` on success, and an ``error`` on failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Explicit format identifier that overrides detection from the filename. One of: 'camt' (CAMT.053), 'pain001', 'csv', 'ofx', 'qfx', 'mt940'. When omitted, the format is inferred from the filename extension. | |
| content | Yes | The raw statement text to validate, inline (not a file path). Accepts ISO 20022 CAMT.053 and pain.001 XML, SWIFT MT940, CSV exports, and OFX/QFX payloads. | |
| filename | No | Original filename of the payload; its extension (.xml, .csv, .ofx, .qfx, .mt940, .sta) selects the format when 'format' is omitted. Defaults to 'statement.xml'. | statement.xml |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||