Rivane

Accounting
made smart

ERP Use CasesTier 1Published March 24, 2026

BAI2 / MT940 Bank Statement File Import

BAI2 / MT940 Bank Statement File Import for US and UK finance teams: ERP requirements, controls, audit evidence, data model, APIs, state transitions, and implementation checks.

Banking / Statement Import is where ERP discipline either begins or breaks.

BAI2 / MT940 Bank Statement File Import looks operational from far away. In a real finance team, it is a chain of assertions: the right actor started the work, the required records existed, the control policy was applied, the state change was preserved, and the outcome can be explained later without rebuilding the transaction from emails and spreadsheets.

The expected business outcome is specific: Zero manual re-keying of bank statement data; full audit trail from raw bank file to reconciled GL entry.

The control flow a finance team actually needs.

Workflow map showing control steps, exceptions, and evidence for this ERP process.Parse BAI2 Versi...Start conditionValidate Trailer...Required checksDetect And Rejec...Owner and SLAMap BAI2 Type Co...System updateFiles Up To 500 MBException handlingAudit packetEvidence trailException loopBanking / Statement Import should preserve every override and rejection.
Workflow map for this ERP process, including exception handling and audit evidence.

Step 1

Parse BAI2 Version 2 And MT940 SWIFT...

Step 2

Validate Trailer Record Totals Against...

Step 3

Detect And Reject Duplicate File By...

Step 4

Map BAI2 Type Codes 100 - 990 To...

Step 5

Files Up To 500 MB

The ERP surface involved.

Module

Banking / Statement Import

Actors

Treasury Analyst, File Import Service, Bank Statement Files

Tier

Tier 1

Finance area

Cash Management, Treasury & Banking

Region lens

US and UK finance teams

Publication date

March 24, 2026

Parse BAI2 version 2 and MT940 SWIFT format without preprocessing; validate trailer record totals against sum of imported transactions - reject entire file on mismatch; detect and reject duplicate file by SHA-256 hash with informative error; map BAI2 type codes 100 - 990 to internal categories per configurable lookup table; support files up to 500 MB; import 100,000 transaction lines in <60 seconds; store raw file bytes for audit replay; log import user, timestamp, file name, hash, and record count.

US and UK teams have different compliance hooks, but the same control problem.

US teams usually care about clean evidence for audit support, vendor records, payment controls, tax reporting, and management review. UK teams usually care about VAT-ready records, approval evidence, digital-record discipline, and traceable postings. The country-specific details differ, but the operating pattern is the same: the ERP needs controlled records, explicit ownership, defensible state changes, and evidence that survives beyond the person who completed the task.

The control matrix.

Control areaRequirementAcceptance proof
Control 1Parse BAI2 version 2 and MT940 SWIFT format without preprocessingGiven a valid BAI2 v2 or MT940 file is uploaded
Control 2validate trailer record totals against sum of imported transactions - reject entire file on mismatchwhen the parser runs
Control 3detect and reject duplicate file by SHA-256 hash with informative errorthen trailer control totals are validated against imported transaction sums before any lines are committed, BAI2 type codes are mapped to internal categories via configurable lookup, duplicate files detected by SHA-256 hash are rejected with informative error, and 100,000 lines import in <60 seconds
Control 4map BAI2 type codes 100 - 990 to internal categories per configurable lookup tablenegative) when trailer total mismatches the sum of imported transactions then the entire file is rejected with 422 and no lines are persisted.
Control 5support files up to 500 MBZero manual re-keying of bank statement data; full audit trail from raw bank file to reconciled GL entry.
Control 6import 100,000 transaction lines in <60 secondsZero manual re-keying of bank statement data; full audit trail from raw bank file to reconciled GL entry.

Audit evidence is a chain, not a folder.

Evidence layerWhat should be preserved
Business eventThe treasury analyst uploads a BAI2 or MT940 file received from the bank via SFTP or manual upload. The parser validates file structure, header record, and trailer control totals before processing. Each transaction record is mapped to a bank statement line with BAI2 type code or MT940 transaction code translated to internal transaction category. Duplicate files are detected by file hash and rejected. Successfully imported lines are queued for reconciliation matching. The analyst receives a summary report with import count, rejected lines, and control total variance.
Control rulesParse BAI2 version 2 and MT940 SWIFT format without preprocessing; validate trailer record totals against sum of imported transactions - reject entire file on mismatch; detect and reject duplicate file by SHA-256 hash with informative error; map BAI2 type codes 100 - 990 to internal categories per configurable lookup table; support files up to 500 MB; import 100,000 transaction lines in <60 seconds; store raw file bytes for audit replay; log import user, timestamp, file name, hash, and record count.
Acceptance proofGiven a valid BAI2 v2 or MT940 file is uploaded; when the parser runs; then trailer control totals are validated against imported transaction sums before any lines are committed, BAI2 type codes are mapped to internal categories via configurable lookup, duplicate files detected by SHA-256 hash are rejected with informative error, and 100,000 lines import in <60 seconds; (negative) when trailer total mismatches the sum of imported transactions then the entire file is rejected with 422 and no lines are persisted.
Data record
statement_import { import_id: string, entity_id: string, bank_account_id: string, file_format: enum(BAI2, MT940), file_hash: string, file_size_bytes: int, record_count: int, status: enum(PENDING, VALIDATED, IMPORTED, REJECTED), imported_at: timestamp, external_id: string };
bank_statement_line { line_id: string, import_id: string, amount_minor: int64, currency_code: char(3), type_code: string, internal_category: string, external_id: string };
(reference, product may differ).
System event
POST /v1/banking/statement-imports { bank_account_id, file: multipart } -> 202 { import_id };
GET /v1/banking/statement-imports/{id} -> { status, record_count, rejected_count, control_total_variance_minor };
emits banking.statement_imported and banking.statement_import_failed events;
idempotent via file_hash deduplication.
Lifecycle state
PENDING -> VALIDATED -> IMPORTED;
terminal REJECTED;
guard: file rejected atomically on control-total mismatch or duplicate SHA-256 hash.

The useful version of this workflow is not only fast. It is inspectable. A controller, auditor, or operator should be able to move from source event to system record to state transition to final business outcome without guessing.

Implementation contracts.

Reference data model

`statement_import` { import_id: string, entity_id: string, bank_account_id: string, file_format: enum(BAI2, MT940), file_hash: string, file_size_bytes: int, record_count: int, status: enum(PENDING, VALIDATED, IMPORTED, REJECTED), imported_at: timestamp, external_id: string }; `bank_statement_line` { line_id: string, import_id: string, amount_minor: int64, currency_code: char(3), type_code: string, internal_category: string, external_id: string }; (reference, product may differ).

API and events

`POST /v1/banking/statement-imports` { bank_account_id, file: multipart } -> 202 { import_id }; `GET /v1/banking/statement-imports/{id}` -> { status, record_count, rejected_count, control_total_variance_minor }; emits `banking.statement_imported` and `banking.statement_import_failed` events; idempotent via file_hash deduplication.

State transitions

`PENDING -> VALIDATED -> IMPORTED`; terminal `REJECTED`; guard: file rejected atomically on control-total mismatch or duplicate SHA-256 hash.

Common implementation traps.

Treating the workflow as data entry

If the ERP only stores the final record, the team loses the decision trail that explains how the record became valid.

Hiding exception logic

Exceptions need owners, reason codes, and time stamps. A vague pending state is not a control.

Posting without recovery design

Retries, duplicate submissions, and partial failures must be explicit so the system does not create inconsistent records.

Skipping evidence design

A workflow that cannot produce evidence on demand will eventually push finance teams back into manual screenshots and spreadsheets.

Where Rivane fits.

Rivane is built for finance workflows where automation must stay tied to source documents, approvals, state transitions, ledger impact, reporting, and audit evidence. Use this guide as a checklist for evaluating whether an ERP workflow is merely digitized or actually controlled.

References and source basis.

These sources provide the standards, regulatory, or government context around the flow. They are included so the guide is useful to finance operators, auditors, and implementation teams, not only buyers reading software copy.

Back to ERP use cases