# Bank Statement Standards Bridge — CAMT.053 & MT940 (`ceddl/bank-statement-standards-bridge`) Actor

Validate and convert CAMT.053 and MT940 statements to deterministic JSON and reconciled CSV with stable transaction IDs — no bank login or OCR.

- **URL**: https://apify.com/ceddl/bank-statement-standards-bridge.md
- **Developed by:** [Cedric Günther](https://apify.com/ceddl) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 statement validateds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Bank Statement Standards Bridge

Convert CAMT.053 and a documented MT940 subset into stable transaction JSON and
RFC 4180 CSV, with deterministic IDs and explicit balance evidence. This Actor
is for accounting automation that already has machine-readable bank exports. It
does not log in to banks and does not perform OCR.

### Typical workflow

1. Export one or more CAMT.053 or MT940 statements.
2. Send inline content (recommended for confidential data) or a public HTTPS
   URL. Choose `strict` or `tolerant` processing and bounded limits.
3. Consume statement/transaction rows from the default dataset. Download the
   full canonical bundle from `CANONICAL_JSON` and CSV from `TRANSACTIONS_CSV`.
4. Route `PASS`, `FAIL`, and `INCONCLUSIVE` reconciliation results explicitly.

```json
{
    "statements": [
        {
            "sourceId": "client-a-september-2026",
            "format": "AUTO",
            "content": ":20:STMT-1\n:25:DE02120300000000202051\n:60F:C260901EUR100,00\n:61:2609150915C12,34NTRFREF-1//BANK-1\n:86:Invoice 1\n:62F:C260930EUR112,34\n-"
        }
    ],
    "mode": "strict",
    "maxFileBytes": 2000000,
    "maxTransactionsPerStatement": 10000
}
```

Exactly one of `content` or `url` is required per statement. URL inputs must be
credential-free public HTTPS URLs on the default port; redirects and private or
reserved address resolution are rejected.

### Supported input

- CAMT.053 namespace variants `camt.053.001.02`, `.04`, and `.08` proven by the
  included synthetic corpus.
- MT940 subset containing `:20:`, optional `:25:`, `:60F:`/`:60M:`, `:61:`,
  optional following `:86:`, and `:62F:`/`:62M:` records.
- Up to 100 statements/run, 10 MB/statement, and 50,000 entries/statement
  within the configurable lower defaults.

Support does not imply that every bank-specific narrative convention has a
semantic mapping. Unrecognized optional data stays outside the canonical MVP.

### Output contract

The dataset uses two stable `recordType` values:

- `statement`: parse status, format/version, IDs, balances, transaction count,
  reconciliation status/difference, and stable error fields.
- `transaction`: stable `transactionId`, booking/value date, decimal amount as
  a string, currency, direction, references, and description.

Decimal amounts remain strings to avoid binary floating-point loss. No current
timestamp participates in IDs or outputs. Reprocessing identical content with
the same `sourceId` produces identical results.

### Failure behavior

Invalid top-level configuration fails before processing. A malformed statement
becomes a `FAILED` statement row while other batch items continue. XML with a
DOCTYPE/entity declaration, unsupported namespace, oversized file, invalid
decimal/date, unsafe URL, or entry-limit breach fails closed. Missing opening or
closing balance yields `INCONCLUSIVE`; it is never reported as reconciled.

### Privacy and security

Statements can contain sensitive financial data. Prefer inline Actor input and
set retention appropriate to your Apify account. The Actor sends no statement
content to third-party services. It uses only Apify storage selected by the run.
There are no credentials in source and no bank/network integration.

### Scope boundary

This is conversion and consistency evidence, not accounting, tax, fraud, legal,
or audit advice. It does not certify a statement, categorize transactions,
initiate payments, connect to banks/SFTP, parse PDFs, or perform OCR.

### Development

```sh
npm install
npm test
npm run quality
npm run benchmark
```

Runtime dependencies are exactly pinned. The synthetic corpus contains no real
account or personal data. New namespaces are opt-in releases with fixtures.

### Changelog

- `0.1.0` — Initial CAMT.053/MT940 subset, deterministic IDs, reconciliation,
  canonical JSON, CSV, schemas, limits, and isolated batch failures.

# Actor input Schema

## `statements` (type: `array`):

Inline CAMT.053/MT940 content or public HTTPS URLs. Exactly one source per item.

## `mode` (type: `string`):

Strict rejects profile violations; tolerant preserves bounded non-fatal evidence.

## `maxFileBytes` (type: `integer`):

Fail a statement when its UTF-8 input exceeds this byte limit.

## `maxTransactionsPerStatement` (type: `integer`):

Fail a statement when its parsed transaction count exceeds this limit.

## `fetchTimeoutSecs` (type: `integer`):

Maximum seconds allowed to fetch one public URL input.

## Actor input object example

```json
{
  "statements": [
    {
      "sourceId": "store-qa-synthetic-statement",
      "format": "MT940",
      "content": ":20:STORE-QA-1\n:25:DE00000000000000000000\n:60F:C260901EUR100,00\n:61:2609150915C12,34NTRFSTORE-QA//DEMO-1\n:86:Synthetic Store QA invoice\n:62F:C260930EUR112,34\n-"
    }
  ],
  "mode": "strict",
  "maxFileBytes": 2000000,
  "maxTransactionsPerStatement": 10000,
  "fetchTimeoutSecs": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `canonicalJson` (type: `string`):

No description

## `csv` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "statements": [
        {
            "sourceId": "store-qa-synthetic-statement",
            "format": "MT940",
            "content": ":20:STORE-QA-1\n:25:DE00000000000000000000\n:60F:C260901EUR100,00\n:61:2609150915C12,34NTRFSTORE-QA//DEMO-1\n:86:Synthetic Store QA invoice\n:62F:C260930EUR112,34\n-"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ceddl/bank-statement-standards-bridge").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "statements": [{
            "sourceId": "store-qa-synthetic-statement",
            "format": "MT940",
            "content": """:20:STORE-QA-1
:25:DE00000000000000000000
:60F:C260901EUR100,00
:61:2609150915C12,34NTRFSTORE-QA//DEMO-1
:86:Synthetic Store QA invoice
:62F:C260930EUR112,34
-""",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("ceddl/bank-statement-standards-bridge").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "statements": [
    {
      "sourceId": "store-qa-synthetic-statement",
      "format": "MT940",
      "content": ":20:STORE-QA-1\\n:25:DE00000000000000000000\\n:60F:C260901EUR100,00\\n:61:2609150915C12,34NTRFSTORE-QA//DEMO-1\\n:86:Synthetic Store QA invoice\\n:62F:C260930EUR112,34\\n-"
    }
  ]
}' |
apify call ceddl/bank-statement-standards-bridge --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ceddl/bank-statement-standards-bridge"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gMJE4X9cdj96RIoAl/builds/qv0S3e6ea0TJadBOk/openapi.json
