data.commerce.bank-line.parse ​
Parse an OFX or CSV bank statement into normalized, pseudonymized lines
Read an OFX or CSV statement into pseudonymized, matchable lines.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-commerce |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
statement_format | string | Yes | — | 'ofx' or 'csv'. |
content | string | Yes | — | The statement document as text. Bounded; parse a page at a time. |
account_id | string | No | — | The bank's own account identifier, used ONLY to derive a pseudonym and never returned. Required for CSV, which carries no account; optional for OFX, where it overrides <ACCTID>. |
column_map | json | No | — | CSV only. Maps a role to the header carrying it, e.g. {'posted_at': 'Data', 'amount': 'Valor'}. Roles: external_ref, posted_at, value_date, amount, credit, debit, counterparty, description, balance_after |
currency | string | No | BRL | Fallback when the document does not declare one. |
include_descriptions | boolean | No | False | Off by default. A bank memo routinely carries a person's name and is never a matching key, so it is dropped unless asked for. |
max_lines | integer | No | 500 | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
statement_format | string | Yes | — | — |
account_ref | string | Yes | — | Keyed organization-scoped pseudonym. Never the account number. |
items | list | Yes | — | Normalized lines, shaped as data.commerce.bank-line.persist-batch items. |
item_count | integer | Yes | — | — |
rejected_items | list | Yes | — | — |
rejected_count | integer | Yes | — | — |
currency | string | Yes | — | — |
net_amount | string | Yes | — | — |
earliest_posted_at | string | No | — | — |
latest_posted_at | string | No | — | — |
descriptions_included | boolean | Yes | — | — |
parsed_at | string | Yes | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | json | No | — | — |
failed_layer | json | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_at | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | complete | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | complete | completed | — |
pending | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "data.commerce.bank-line.parse",
"initial_data": {
"organization_uuid": "value",
"statement_format": "value",
"content": "value"
}
}