# StructMint Invoice XML, Table & PDF-Text to JSON (`structmint/structured-document-invoice-extractor`) Actor

Extract & math-reconcile UBL 2.1 / Peppol XML e-invoices, tables & extracted PDF text into strict JSON + RAG Markdown chunks ($0 external LLM).

- **URL**: https://apify.com/structmint/structured-document-invoice-extractor.md
- **Developed by:** [StructMint](https://apify.com/structmint) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.20 / 1,000 documents parsed & reconciled

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

## StructMint Invoice XML, Table & PDF-Text to JSON

> **Zero external paid AI/LLM fees · Instant structured JSON in <2s · `$0.0020` Actor start + `$0.00400/document parsed & reconciled`**

Extract & math-reconcile UBL 2.1 / Peppol XML e-invoices, tables & extracted PDF text into strict JSON + RAG Markdown chunks ($0 external LLM).

### Instant Input -> Output Preview (Try It Now)

Send clean JSON in, get strict audit-ready JSON out — **no prompt engineering, no HTML CSS breakage, no monthly subscription**.

**Input:**

```json
{
  "documents": [
    {
      "documentId": "inv-demo-001",
      "format": "invoice-text",
      "content": "Invoice #: INV-2026-089\nIssue Date: 2026-12-01\nSeller: CloudScale Europe GmbH\nVAT ID: DE298441920\nBuyer: Acme Operations Ltd\nSubtotal: EUR 1000.00\nTax: EUR 190.00\nTotal: EUR 1190.00"
    }
  ]
}
```

**Verified Output Snapshot:**

```json
{
  "parsedCount": 1,
  "reconciledCount": 1,
  "documents": [
    {
      "documentId": "inv-demo-001",
      "invoiceNumber": "INV-2026-089",
      "currency": "EUR",
      "subtotal": 1000,
      "taxAmount": 190,
      "totalAmount": 1190,
      "mathReconciled": true,
      "sellerVatId": "DE298441920"
    }
  ]
}
```

### Why Engineering & RevOps Teams Switch to StructMint

| Feature | **StructMint (`structured-document-invoice-extractor`)** | Typical `$99+/mo` SaaS APIs | Brittle Custom / HTML Scrapers |
|---|---|---|---|
| **Pricing Model** | Pay-Per-Event (`$0.0020` start + `$0.00400/unit`) | `$49–$299/mo` fixed seat lock-in | Hidden server + maintenance hours |
| **Maintenance Risk** | **0 HTML DOM selectors (deterministic logic)** | Vendor API deprecations | Breaks every site layout change |
| **Security & Privacy** | \`LIMITED_PERMISSIONS\` · Deterministic schema | Shared multi-tenant logs | Full-account token exposure |
| **AI Agent & n8n Ready** | Native **Apify MCP** + Open-Source [n8n Kit](https://github.com/stqnbapxao-source/structmint-b2b-automation-kit) | Manual OAuth + glue code | Unstructured text cleanup |

### Core Capabilities

- **Supports UBL 2.1 / Peppol XML, invoice text blocks, Markdown tables, and CSV**
- **Built-in subtotal + tax = total arithmetic reconciliation flag**
- **Zero external LLM API tokens spent: runs deterministically inside container**

### 1-Click Integration: cURL, Claude / Cursor MCP & n8n Workflows

#### Option A — Synchronous REST API Call (Returns JSON Dataset Directly)

```bash
curl -X POST "https://api.apify.com/v2/acts/structmint~structured-document-invoice-extractor/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"documents":[{"documentId":"inv-demo-001","format":"invoice-text","content":"Invoice #: INV-2026-089\nIssue Date: 2026-12-01\nSeller: CloudScale Europe GmbH\nVAT ID: DE298441920\nBuyer: Acme Operations Ltd\nSubtotal: EUR 1000.00\nTax: EUR 190.00\nTotal: EUR 1190.00"}]}'
```

#### Option B — Claude Desktop / Cursor / AI Agent MCP Config

```json
{
  "mcpServers": {
    "structmint-structured-document-invoice-extractor": {
      "url": "https://mcp.apify.com?actors=structmint/structured-document-invoice-extractor",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

#### Option C — Ready-to-Import n8n Workflows & Typed TypeScript SDK

Clone our free MIT-licensed [StructMint B2B Automation Kit on GitHub](https://github.com/stqnbapxao-source/structmint-b2b-automation-kit) for **ready-to-import `n8n` workflow JSON templates**, pre-built MCP configs, and a typed TypeScript SDK calling [apify.com/structmint](https://apify.com/structmint).

### Transparent Pay-Per-Event Pricing (`document-parsed`)

- **Actor Start Event**: `$0.0020 USD` per container run (volume discounts automatically applied for Bronze–Diamond tiers)
- **Unit Event (`document-parsed`)**: `$0.00400 USD` per document parsed & reconciled
- **Free Tier External API Cost**: `$0.00` (strictly self-contained deterministic processing)
- **Permissions Mode**: `LIMITED_PERMISSIONS` (isolated per-run storage; zero access to unrelated account datasets)

### Pre-Configured Automation Presets (10 Search-Ready Tasks)

1. **UBL & Peppol XML Invoice Parser** (`ubl-peppol-xml-invoice-parser`): Deterministic zero-LLM parser preset for ubl-peppol-xml-invoice-parser ($0.004/document).
2. **EU Factur-X E-Invoice Extractor** (`eu-factur-x-e-invoice-extractor`): Deterministic zero-LLM parser preset for eu-factur-x-e-invoice-extractor ($0.004/document).
3. **Invoice Subtotal & Tax Math Checker** (`invoice-math-reconciliation-api`): Deterministic zero-LLM parser preset for invoice-math-reconciliation-api ($0.004/document).
4. **Markdown Table to JSON Parser** (`markdown-table-to-json-parser`): Deterministic zero-LLM parser preset for markdown-table-to-json-parser ($0.004/document).
5. **CSV to RAG Markdown Chunker** (`csv-to-rag-markdown-chunker`): Deterministic zero-LLM parser preset for csv-to-rag-markdown-chunker ($0.004/document).
6. **VAT ID & Line-Item Extractor** (`vat-id-and-line-item-extractor`): Deterministic zero-LLM parser preset for vat-id-and-line-item-extractor ($0.004/document).
7. **Extracted PDF Text Invoice Parser** (`pdf-text-stream-invoice-parser`): Deterministic zero-LLM parser preset for pdf-text-stream-invoice-parser ($0.004/document).
8. **B2B Accounts Payable Invoice Parser** (`b2b-ap-automation-doc-extractor`): Deterministic zero-LLM parser preset for b2b-ap-automation-doc-extractor ($0.004/document).
9. **MCP Structured Invoice JSON Reader** (`mcp-invoice-json-reader`): Deterministic zero-LLM parser preset for mcp-invoice-json-reader ($0.004/document).
10. **n8n Zero-LLM Document Parser** (`n8n-document-parser-no-llm`): Deterministic zero-LLM parser preset for n8n-document-parser-no-llm ($0.004/document).

### Complete StructMint 15-Tool B2B Extractors & Data Hygiene Suite

Chain these B2B extractors and data hygiene utilities together in n8n, Make, or Apify MCP without paying monthly SaaS subscriptions:

| StructMint Utility | Transparent PPE Rate | Sandbox Mode |
|---|---|---|
| [Lever Jobs & B2B Hiring Velocity API Extractor](https://apify.com/structmint/lever-jobs-hiring-velocity-extractor) | `$0.0040 / lever job posting signal` | `LIMITED_PERMISSIONS` |
| [Ashby Jobs & Compensation Tiers API Extractor](https://apify.com/structmint/ashby-jobs-compensation-tiers-extractor) | `$0.0040 / ashby job & compensation signal` | `LIMITED_PERMISSIONS` |
| [Greenhouse Jobs & Department Hiring Signals API](https://apify.com/structmint/greenhouse-jobs-department-signals-api) | `$0.0040 / greenhouse department job signal` | `LIMITED_PERMISSIONS` |
| [Shopify App Store Delta & Developer Tracker](https://apify.com/structmint/shopify-app-store-delta-tracker) | `$0.0050 / shopify app catalog delta record` | `LIMITED_PERMISSIONS` |
| [SEC EDGAR Corporate Filings & Form D Extractor](https://apify.com/structmint/sec-edgar-corporate-form-d-extractor) | `$0.0050 / sec edgar corporate filing notice` | `LIMITED_PERMISSIONS` |
| [StructMint B2B Email, MX, SPF & DMARC Deliverability Verifier](https://apify.com/structmint/b2b-email-dns-deliverability-verifier) | `$0.0008 / email address verified` | `LIMITED_PERMISSIONS` |
| [StructMint B2B Lead Dataset Deduplicator & Normalizer](https://apify.com/structmint/dataset-lead-dedupe-normalizer) | `$0.0006 / lead record normalized & deduped` | `LIMITED_PERMISSIONS` |
| **(This Tool)** [StructMint Invoice XML, Table & PDF-Text to JSON](https://apify.com/structmint/structured-document-invoice-extractor) | `$0.0040 / document parsed & reconciled` | `LIMITED_PERMISSIONS` |
| [StructMint E.164 Phone Formatter & Timezone Validator](https://apify.com/structmint/phone-e164-region-validator) | `$0.0005 / phone number normalized & enriched` | `LIMITED_PERMISSIONS` |
| [StructMint RSS, Podcast & App Store Feed Normalizer](https://apify.com/structmint/rss-podcast-appstore-feed-json) | `$0.0008 / feed item parsed & deduplicated` | `LIMITED_PERMISSIONS` |
| [StructMint Bulk Domain RDAP, DNS & SSL Expiry Auditor](https://apify.com/structmint/domain-rdap-dns-ssl-auditor) | `$0.0008 / domain rdap, dns & tls certificate audited` | `LIMITED_PERMISSIONS` |
| [StructMint Website Tech Stack & Security Header Grader](https://apify.com/structmint/tech-stack-security-header-detector) | `$0.0010 / website tech stack & security headers graded` | `LIMITED_PERMISSIONS` |
| [StructMint Bulk URL Redirect, 404 & UTM Hygiene Auditor](https://apify.com/structmint/url-redirect-broken-link-utm-auditor) | `$0.0005 / url canonicalized & redirect chain audited` | `LIMITED_PERMISSIONS` |
| [StructMint JSON-LD Schema, OpenGraph & AI SEO Auditor](https://apify.com/structmint/jsonld-opengraph-seo-schema-auditor) | `$0.0010 / page json-ld schema & seo metadata audited` | `LIMITED_PERMISSIONS` |
| [StructMint Global IBAN, SWIFT/BIC, EU VAT & Tax Validator](https://apify.com/structmint/iban-vat-bic-tax-id-validator) | `$0.0005 / iban, bic, eu vat or tax id mathematically verified` | `LIMITED_PERMISSIONS` |

### Reliability & Privacy Policy

- Every release passes deterministic golden and adversarial schema checks before deployment.
- Continuous automated health probes verify schema integrity and uptime.
- Stateless hygiene processing: input arrays containing business contacts or URLs are processed solely inside your isolated run container and never persisted or resold outside your ephemeral Apify dataset.

# Actor input Schema

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

List parameter for documents.

## Actor input object example

```json
{
  "documents": [
    {
      "documentId": "inv-demo-001",
      "format": "invoice-text",
      "content": "Invoice #: INV-2026-089\nIssue Date: 2026-12-01\nSeller: CloudScale Europe GmbH\nVAT ID: DE298441920\nBuyer: Acme Operations Ltd\nSubtotal: EUR 1000.00\nTax: EUR 190.00\nTotal: EUR 1190.00"
    }
  ]
}
```

# Actor output Schema

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

Normalized and validated structured JSON items.

# 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 = {
    "documents": [
        {
            "documentId": "inv-demo-001",
            "format": "invoice-text",
            "content": "Invoice #: INV-2026-089\nIssue Date: 2026-12-01\nSeller: CloudScale Europe GmbH\nVAT ID: DE298441920\nBuyer: Acme Operations Ltd\nSubtotal: EUR 1000.00\nTax: EUR 190.00\nTotal: EUR 1190.00"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("structmint/structured-document-invoice-extractor").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 = { "documents": [{
            "documentId": "inv-demo-001",
            "format": "invoice-text",
            "content": """Invoice #: INV-2026-089
Issue Date: 2026-12-01
Seller: CloudScale Europe GmbH
VAT ID: DE298441920
Buyer: Acme Operations Ltd
Subtotal: EUR 1000.00
Tax: EUR 190.00
Total: EUR 1190.00""",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("structmint/structured-document-invoice-extractor").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 '{
  "documents": [
    {
      "documentId": "inv-demo-001",
      "format": "invoice-text",
      "content": "Invoice #: INV-2026-089\\nIssue Date: 2026-12-01\\nSeller: CloudScale Europe GmbH\\nVAT ID: DE298441920\\nBuyer: Acme Operations Ltd\\nSubtotal: EUR 1000.00\\nTax: EUR 190.00\\nTotal: EUR 1190.00"
    }
  ]
}' |
apify call structmint/structured-document-invoice-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,structmint/structured-document-invoice-extractor"
        }
    }
}
```

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/8vc4vRfrRitW6j9zl/builds/QDtApMT5isWThv5dU/openapi.json
