Parse Bank Statement
Parse bank statements and other financial documents from PDF, XML, EDI, and Excel formats
Parse Bank Statement
Parse bank statements and other financial documents from various file formats. The function automatically detects file type, selects the appropriate parser, and extracts account information, transactions, and fee details.
Technical Name: ParseStatementFunc
Properties
- Execution Mode: SYNC
- Type: NATIVE
- Category: System Functions
- Function ID:
66e31772-bde2-4a8f-801d-c215b5cdc321
Input Schema
Required Parameters
| Parameter | Type | Description |
|---|---|---|
fileId | string (uuid) | UUID of the uploaded file to parse (must exist in file storage) |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
bankName | string | Name of the bank for statement identification and parser selection |
parserName | string | Specific parser bean name to use (e.g., "chaseBankParser") |
parserPatternId | string (uuid) | UUID of a parser pattern configuration to use for pattern-based parsing |
currency | string | Currency code to use (e.g., "USD", "EUR") |
country | string | Country alpha-2 code (e.g., "US", "GB") |
usePatternParser | boolean | Force use of pattern-based parser instead of bank-specific parsers |
[Image placeholder: ParseStatement function configuration panel]
Input Example
Basic Parsing
{
"fileId": "a7b9c4d2-3e5f-4a1b-9c8d-7e6f5a4b3c2d"
}With Bank Name
{
"fileId": "a7b9c4d2-3e5f-4a1b-9c8d-7e6f5a4b3c2d",
"bankName": "Chase Bank",
"currency": "USD",
"country": "US"
}Using Specific Parser
{
"fileId": "a7b9c4d2-3e5f-4a1b-9c8d-7e6f5a4b3c2d",
"parserName": "chaseBankParser"
}Using Pattern-Based Parser
{
"fileId": "a7b9c4d2-3e5f-4a1b-9c8d-7e6f5a4b3c2d",
"parserPatternId": "pattern-uuid-here",
"usePatternParser": true
}Supported File Types
- PDF (
application/pdf) - Bank statement PDFs - XML (
application/xml,text/xml) - CAMT.053, ISO 20022 formats - EDI (
.edi) - Electronic Data Interchange formats - Excel (
.xlsx,.xls) - Spreadsheet-based statements
Output Schema
| Field | Type | Description |
|---|---|---|
statementGroup | object | Group information about the parsed statement (metadata) |
statementAccounts | array | Account information including balances and account details |
statementServices | array | Service/transaction details including fees and charges |
The output structure contains:
- Statement Metadata: Bank name, account numbers, statement period, currency
- Account Balances: Opening/closing balances, ledger balances
- Activity Details: Transactions, service charges, fees
- Conversion Rates: Exchange rates if applicable
- Tax Details: Tax information if present
Output Example
{
"statementGroup": {
"bankName": "Chase Bank",
"fileName": "statement_2024_01.pdf",
"statementFrom": "2024-01-01",
"statementTo": "2024-01-31",
"duplicate": false
},
"statementAccounts": [
{
"accountNumber": "1234567890",
"accountType": "DETAIL",
"openingBalance": 10000.00,
"closingBalance": 9500.00,
"currency": "USD"
}
],
"statementServices": [
{
"serviceDescription": "Wire Transfer",
"unitPrice": 25.00,
"volume": 5,
"totalCharges": 125.00,
"accountNumber": "1234567890"
}
]
}[Image placeholder: Parsed statement visualization]
How It Works
- File Type Detection: Automatically detects file type (PDF, XML, EDI, Excel)
- Parser Selection:
- If
parserNameprovided: Uses specified parser - If
parserPatternIdorusePatternParser=true: Uses pattern-based generic parser - If
bankNameprovided: Attempts to find bank-specific parser or pattern - Otherwise: Tries all available parsers until one succeeds
- If
- Parsing: Extracts statement data based on file format
- Data Enrichment:
- Resolves bank metadata
- Populates currency and country information
- Validates account numbers
- Checks for duplicate statements
- Output: Returns structured statement data
Use Cases
Parse Uploaded Statement
Parse a bank statement uploaded by a user:
{
"fileId": "{{context.uploadedFileId}}",
"bankName": "Wells Fargo",
"currency": "USD"
}Process Multiple Statements
Parse multiple statements in a workflow:
Start → UploadFile → ParseStatement → ProcessFees → EndUse Pattern-Based Parsing
Parse statements using a custom parser pattern:
{
"fileId": "file-uuid",
"parserPatternId": "custom-pattern-uuid",
"usePatternParser": true
}[Image placeholder: Workflow examples]
Parser Selection Strategy
The function uses the following strategy to select a parser:
- Explicit Parser: If
parserNameis provided, uses that parser - Pattern Parser: If
parserPatternIdorusePatternParser=true, uses pattern-based parser - Bank-Specific: If
bankNameis provided, searches for bank-specific parser or pattern - Fallback: Tries all available parsers sequentially until one succeeds
- Generic Parser: Falls back to generic PDF parser if all specific parsers fail
Error Handling
File Not Found
{
"error": "File not found with ID: invalid-uuid"
}Unsupported File Type
{
"error": "Unsupported file type: image/jpeg"
}Bank Not Found
{
"error": "No bank metadata found for bank: Unknown Bank"
}Best Practices
- Provide bankName when known to improve parser selection accuracy
- Use parserPatternId for custom statement formats
- Set currency and country for proper data enrichment
- Handle duplicate detection - check
duplicateflag in output - Validate parsed data before processing further
Related Functions
- Statement Processor - Process parsed statements by mapping categories, forex rates, and other data
- Statement Parser - Alternative parser function
- Parse CSV/Excel File - Parse CSV and Excel files for general data
- ECR Analysis - Analyze ECR data from parsed statements