# Invoice, Receipt & Bank Statement OCR to QuickBooks & Peppol (`bifrost-data/invoice-bank-statement-ocr-erp-reconciler`) Actor

Math-verified Invoice, Receipt & Bank Statement OCR API + MCP Server. Audits Decimal line totals, VAT/IBAN checksums & multi-page running balances; exports QuickBooks/Xero CSV, Peppol UBL 2.1, Factur-X CII & SAP Ariba cXML.

- **URL**: https://apify.com/bifrost-data/invoice-bank-statement-ocr-erp-reconciler.md
- **Developed by:** [SEOK HOON HONG](https://apify.com/bifrost-data) (community)
- **Categories:** Business, Automation, Developer tools
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $12.00 / 1,000 reconciled digital pdf pages (vector + math audit + erp/xml)

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/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

## Invoice, Receipt & Bank Statement OCR to QuickBooks, Xero & Peppol XML (Math-Verified API & MCP)

**Actor Slug**: `bifrost-data/invoice-bank-statement-ocr-erp-reconciler` (`v1.0.0`)

Turn digital PDFs, encrypted bank e-Statements, and smartphone receipt photos into **mathematically verified** accounting entries and compliant e-Invoices in a single synchronous webhook or MCP call—with **$0 monthly minimum commitment** and **100% Zero-Retention** in-memory security.

### Why Automation Teams & Bookkeepers Switch to This Engine

| Capability | Generic Cloud OCR (`Textract` / Basic OCR Actors) | Legacy Financial OCR SaaS (`Veryfi` / `Mindee`) | **Bifrost Fin-Doc Reconcile Engine (`v1.0`)** |
| :--- | :--- | :--- | :--- |
| **Pricing Commitment** | Raw text blocks only (`$0.015–$0.070/p`) | `$500/mo` (`Veryfi`) or `$53–$134/mo` (`Mindee`) minimums | **Pure Pay-Per-Event**: `$0.015/p` (digital) · `$0.030/p` (OCR) |
| **Double-Entry & Balance Math Guard** | None (silent OCR digit errors) | Partial header heuristics | **Exact `Decimal` verification** (`qty × unit_price`, tax rates, continuous bank running balances) |
| **Multi-Page & Encrypted Bank PDFs** | Breaks across page boundaries | Extra add-on tier | **Built-in AES-256 `pdfPassword` unlock** + ascending/descending running-balance proof |
| **ERP & EU E-Invoicing Outputs** | Raw JSON text blocks | Proprietary JSON only | **5 Simultaneous Compilers**: QuickBooks CSV, Xero CSV, **Peppol BIS 3.0 UBL 2.1**, **Factur-X 1.07 CII**, **SAP Ariba/Coupa cXML 1.2** |
| **Invalid / Duplicate File Billing** | Charged per API call | Charged per upload | **`$0.00` Zero-Charge Safety Gate** + `RFC 9457` `copy_paste_patch` |

### 4-Layer Software Architecture

1. **Layer 1 — Hybrid Preflight Router & Secure Ingest**:
   - Inspects per-page vector text density in `<10ms`: native digital PDFs take the lossless `pdfplumber` coordinate table route (`digital_vector`), while scanned PDFs and camera images (`PNG`, `JPG`, `WebP`, `TIFF`, `HEIC`) run through deskewing + built-in local CPU OCR (`RapidOCR ONNX` + `Tesseract`) and `QR / EPC-QR (SEPA Credit Transfer)` decoding.
   - Zero external paid LLM/OCR API calls (`$0` variable leak) and strict SSRF private-IP protection.
2. **Layer 2 — `Zero-Hallucination Math Guard` (Exact `Decimal`)**:
   - **Invoices & Receipts**: Verifies `round(qty * unit_price, 2) == line_total`, `sum(line_total) == subtotal`, `subtotal + tax_total + shipping_total - discount_total == grand_total`, SEPA EPC-QR amount parity, and EU VAT / Korean BRN / US EIN / IBAN `MOD-97-10` checksums.
   - **Bank & Card Statements**: Auto-detects chronological direction (oldest-first vs newest-first) across multi-page statements and verifies `prev_balance - debit + credit == printed_balance` on every row.
   - Emits `reconciliation_status`: `VERIFIED_EXACT` | `ROUNDING_TOLERANCE_1C` | `DISCREPANCY_FLAGGED` with pinpointed `discrepancy_rows[]`.
3. **Layer 3 — 5 Global Accounting & E-Invoicing Compilers**:
   - `quickbooks_csv` (QuickBooks Online 4-Column/3-Column Bank Feed & Bill Import CSV)
   - `xero_csv` (Official Xero `*Date,*Amount,...` Bank Statement & Bill Import CSV)
   - `peppol_ubl_xml` (EN 16931 **Peppol BIS Billing 3.0** `UBL 2.1 XML`, structurally validated)
   - `facturx_cii_xml` (EU **Factur-X 1.07 / ZUGFeRD 2.3** `EN 16931 CII XML`, structurally validated)
   - `ariba_cxml` (**SAP Ariba / Coupa `cXML 1.2.061 InvoiceDetailRequest`**, 100% compatible with `cxml-ariba-coupa-procurement-bridge`)
4. **Layer 4 — Standby REST Webhook (`POST /reconcile`) + Streamable MCP (`POST /mcp`) + Zero-Retention**:
   - Sub-second warm response for Make.com, n8n, Zapier, Claude Desktop, and Cursor MCP agents.
   - Scratch files are processed exclusively in `/tmp` tmpfs and cryptographically zeroed/unlinked immediately (`retainFiles: false` default).

### Quickstart: Synchronous Standby HTTP (`POST /reconcile`)

```bash
curl -X POST "https://bifrost-data--invoice-bank-statement-ocr-erp-reconciler.apify.actor/reconcile" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "documents": [
      {
        "fileUrl": "https://your-s3-bucket.s3.amazonaws.com/signed-invoice.pdf",
        "documentTypeHint": "auto"
      }
    ],
    "exportFormats": ["json", "quickbooks_csv", "xero_csv", "peppol_ubl_xml", "facturx_cii_xml", "ariba_cxml"],
    "strictMathReconciliation": true
  }'
```

You can also `POST` raw `application/pdf` or `image/jpeg` binary bytes directly from Make/n8n HTTP modules to `/reconcile?fileName=invoice.pdf`.

### Connect via Model Context Protocol (`POST /mcp`)

```json
{
  "mcpServers": {
    "bifrost-fin-reconciler": {
      "type": "streamable-http",
      "url": "https://bifrost-data--invoice-bank-statement-ocr-erp-reconciler.apify.actor/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

### Ready-Made Make.com & n8n Templates

Import directly from the `integrations/` folder:

- `integrations/make_gmail_to_quickbooks_blueprint.json`
- `integrations/n8n_invoice_reconcile_workflow.json`

### Open-Source Local CLI (`Apache-2.0`, <= 25 Pages/Run)

```bash
python3 cli.py ./sample_invoice.pdf --formats json,quickbooks_csv,peppol_ubl_xml --output-dir ./exports
python3 src/main.py --selftest
```

# Actor input Schema

## `documents` (type: `array`):

Array of financial documents. Each item supports 'fileUrl' (HTTPS/presigned URL) OR 'base64Data' + 'fileName', optional 'pdfPassword' (for encrypted bank e-Statements), and 'documentTypeHint' ('auto' | 'invoice' | 'receipt' | 'bank_statement' | 'purchase_order').

## `exportFormats` (type: `array`):

Choose any combination of 'json', 'quickbooks_csv', 'xero_csv', 'peppol_ubl_xml', 'facturx_cii_xml', and 'ariba_cxml'.

## `strictMathReconciliation` (type: `boolean`):

When true, verifies line-item extensions, tax breakdowns, grand totals, VAT/IBAN checksums, and continuous multi-page bank running balances, flagging even a $0.01 discrepancy.

## `ocrLanguages` (type: `array`):

Built-in local CPU OCR language codes ('en', 'de', 'fr', 'es', 'ko', 'ja'). Zero external paid LLM/OCR API calls.

## `dedupeBySha256` (type: `boolean`):

Automatically skip duplicate receipts or invoices sharing an identical SHA-256 hash within the same batch at $0.00.

## `quickbooksCsvColumns` (type: `string`):

Select '4_column' (Date, Description, Credit, Debit) or '3_column' (Date, Description, Signed Amount) for bank statement exports.

## `includeInlineExports` (type: `boolean`):

Attach compiled CSV/XML strings directly inside 'inline_exports' for zero-hop Make/n8n/MCP consumption alongside Key-Value Store URLs.

## `retainFiles` (type: `boolean`):

Default false: overwrites and purges /tmp scratch buffers immediately after processing each batch.

## Actor input object example

```json
{
  "documents": [
    {
      "fileName": "demo_saas_invoice_eur.pdf",
      "base64Data": "JVBERi0xLjQKJZOMi54gUmVwb3J0TGFiIEdlbmVyYXRlZCBQREYgZG9jdW1lbnQgaHR0cDovL3d3dy5yZXBvcnRsYWIuY29tCjEgMCBvYmoKPDwKL0YxIDIgMCBSIC9GMiAzIDAgUiAvRjMgNCAwIFIgL0Y0IDUgMCBSCj4+CmVuZG9iagoyIDAgb2JqCjw8Ci9CYXNlRm9udCAvSGVsdmV0aWNhIC9FbmNvZGluZyAvV2luQW5zaUVuY29kaW5nIC9OYW1lIC9GMSAvU3VidHlwZSAvVHlwZTEgL1R5cGUgL0ZvbnQKPj4KZW5kb2JqCjMgMCBvYmoKPDwKL0Jhc2VGb250IC9IZWx2ZXRpY2EtQm9sZCAvRW5jb2RpbmcgL1dpbkFuc2lFbmNvZGluZyAvTmFtZSAvRjIgL1N1YnR5cGUgL1R5cGUxIC9UeXBlIC9Gb250Cj4+CmVuZG9iago0IDAgb2JqCjw8Ci9CYXNlRm9udCAvSGVsdmV0aWNhLUJvbGRPYmxpcXVlIC9FbmNvZGluZyAvV2luQW5zaUVuY29kaW5nIC9OYW1lIC9GMyAvU3VidHlwZSAvVHlwZTEgL1R5cGUgL0ZvbnQKPj4KZW5kb2JqCjUgMCBvYmoKPDwKL0Jhc2VGb250IC9UaW1lcy1Sb21hbiAvRW5jb2RpbmcgL1dpbkFuc2lFbmNvZGluZyAvTmFtZSAvRjQgL1N1YnR5cGUgL1R5cGUxIC9UeXBlIC9Gb250Cj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TEKPj4Kc3RhcnR4cmVmCjQ5MzIKJSVFT0YK",
      "documentTypeHint": "auto"
    }
  ],
  "exportFormats": [
    "json",
    "quickbooks_csv",
    "xero_csv"
  ],
  "strictMathReconciliation": true,
  "ocrLanguages": [
    "en",
    "de",
    "fr",
    "es",
    "ko",
    "ja"
  ],
  "dedupeBySha256": true,
  "quickbooksCsvColumns": "4_column",
  "includeInlineExports": true,
  "retainFiles": false
}
```

# Actor output Schema

## `documents` (type: `string`):

Normalized invoices, receipts, and bank statements with VERIFIED_EXACT / DISCREPANCY_FLAGGED status and QuickBooks/Xero/Peppol export links.

## `runMetrics` (type: `string`):

Execution telemetry including digital vs OCR pages reconciled, $0 skipped duplicates/errors, and Zero-Retention status.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("bifrost-data/invoice-bank-statement-ocr-erp-reconciler").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("bifrost-data/invoice-bank-statement-ocr-erp-reconciler").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 '{}' |
apify call bifrost-data/invoice-bank-statement-ocr-erp-reconciler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bifrost-data/invoice-bank-statement-ocr-erp-reconciler"
        }
    }
}
```

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/sqbSC0BBTyc9sXHWo/builds/L6gYvIpdPL9w3DbJd/openapi.json
