# Peppol BIS Billing Preflight Validator - UBL & EN 16931 (`kamerozkan/peppol-bis-preflight-validator`) Actor

Validate UBL invoices against active Peppol BIS Billing 3.0.20 rules and preview the mandatory 3.0.21 rules effective 17 August 2026. Offline e-invoice validation for Belgium's B2B einvoicing mandate and any Peppol access point flow, with EN 16931 findings before network submission.

- **URL**: https://apify.com/kamerozkan/peppol-bis-preflight-validator.md
- **Developed by:** [Kamer Ozkan](https://apify.com/kamerozkan) (community)
- **Categories:** Developer tools
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 invoice 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Peppol BIS Billing Preflight Validator - UBL & EN 16931

[![Active rules](https://img.shields.io/badge/Peppol_BIS-3.0.20-005EA8)](https://docs.peppol.eu/poacc/billing/3.0/2025-Q4/)
[![Future rules](https://img.shields.io/badge/Preview-3.0.21_from_2026--08--17-F59E0B)](https://docs.peppol.eu/poacc/billing/3.0/upcoming/)
[![UBL](https://img.shields.io/badge/UBL-2.1-137333)](https://docs.oasis-open.org/ubl/UBL-2.1.html)
[![Billing](https://img.shields.io/badge/Billing-%240.004%20per%20evaluated%20invoice-6f42c1)](https://apify.com/kamerozkan/peppol-bis-preflight-validator)

Validate Peppol BIS Billing UBL invoices before network submission. Every document receives the active 3.0.20 result and a separate 3.0.21 forward-preview result for the mandatory 17 August 2026 transition.

> Technical preflight only. `ACCEPTED` does not establish legal or tax validity, Peppol participant capability, SBDH or AS4 validity, successful network delivery, or recipient acceptance.

[Run the live Actor](https://apify.com/kamerozkan/peppol-bis-preflight-validator)

### Two rule decisions in one call

| Result | Rules |
|---|---|
| `conformanceStatus` | Active UBL 2.1, EN 16931 1.3.15, Peppol BIS Billing 3.0.20 |
| `previewConformanceStatus` | Upcoming UBL 2.1, EN 16931 1.3.16, Peppol BIS Billing 3.0.21 |

The `versions.previewRuleset` block always identifies `Peppol BIS Billing 3.0.21` and `effectiveAt: 2026-08-17`, so an ERP agent can distinguish active and future findings without parsing prose.

The rule packages, Saxon runtime, and Schematron compiler are downloaded only during the build and SHA-256 verified. Every executed XSD and XSLT also has its own SHA-256 in the manifest and is verified again before use. Runtime validation never downloads rules.

### Quick start

The default input validates an official accepted Peppol UBL sample:

```json
{
  "documents": [
    {
      "documentId": "official-peppol-valid-sample",
      "fileName": "base-example.xml",
      "url": "https://raw.githubusercontent.com/itplr-kosit/validator-configuration-bis/release-3.0.20/test-files/good/ubl/base-example.xml"
    }
  ],
  "resultDetail": "FINDINGS",
  "maxFindingsPerDocument": 100,
  "storeXmlReport": false,
  "storeHtmlReport": false
}
```

Each document can use exactly one source:

- Console file upload
- HTTPS URL with public-IP and redirect enforcement
- Inline XML
- Base64 XML
- A record in your Apify key-value store

Invoice and CreditNote roots are supported. The input and output schemas work with the Apify API, MCP clients, Make, n8n, webhooks, and standard SDKs.

### Structured results

<details>
<summary><strong>Accepted now and after 17 August 2026</strong></summary>

```json
{
  "documentId": "official-valid",
  "processingStatus": "SUCCEEDED",
  "conformanceStatus": "ACCEPTED",
  "previewConformanceStatus": "ACCEPTED",
  "validationScope": "OFFLINE_PREFLIGHT",
  "validationFamily": "PEPPOL_BIS_BILLING",
  "syntax": "UBL_INVOICE",
  "profile": "PEPPOL_BIS_BILLING_3",
  "counts": {
    "fatal": 0,
    "error": 0,
    "warning": 0,
    "information": 0
  },
  "previewCounts": {
    "fatal": 0,
    "error": 0,
    "warning": 0,
    "information": 0
  },
  "sha256": "1b7cc3ff1834c8963f2c93f30f171b58002cbf0b2c52dc8765e7e83aebb9f7c9",
  "versions": {
    "activeRuleset": {
      "name": "Peppol BIS Billing 3.0.20",
      "effectiveAt": "2026-02-23"
    },
    "previewRuleset": {
      "name": "Peppol BIS Billing 3.0.21",
      "effectiveAt": "2026-08-17"
    }
  },
  "error": null
}
```

</details>

<details>
<summary><strong>Rejected by active rules</strong></summary>

```json
{
  "documentId": "malformed-invalid",
  "processingStatus": "SUCCEEDED",
  "conformanceStatus": "REJECTED",
  "previewConformanceStatus": "REJECTED",
  "validationScope": "OFFLINE_PREFLIGHT",
  "counts": {
    "fatal": 16,
    "error": 1,
    "warning": 0,
    "information": 0
  },
  "findings": [
    {
      "severity": "ERROR",
      "stage": "XSD",
      "ruleId": "SCHEMAV_ELEMENT_CONTENT"
    },
    {
      "severity": "FATAL",
      "stage": "BUSINESS_RULE",
      "ruleId": "BR-01",
      "message": "[BR-01]-An Invoice shall have a Specification identifier (BT-24)."
    }
  ],
  "findingsTruncated": true,
  "sha256": "05ff26714881a6b4b30f4399b395ce33ee5fb7d635b7ad1a0d0a1ad54895caf6",
  "error": null
}
```

</details>

<details>
<summary><strong>Source failure, not evaluated</strong></summary>

```json
{
  "documentId": "source-error",
  "processingStatus": "FAILED",
  "conformanceStatus": "NOT_EVALUATED",
  "previewConformanceStatus": "NOT_EVALUATED",
  "validationScope": "OFFLINE_PREFLIGHT",
  "counts": {
    "fatal": 0,
    "error": 0,
    "warning": 0,
    "information": 0
  },
  "findings": [],
  "sha256": null,
  "error": {
    "code": "SOURCE_FETCH_FAILED",
    "message": "Only HTTPS source URLs are allowed"
  }
}
```

</details>

Every input produces one dataset item. A technically invalid invoice is a successful evaluation with `REJECTED`. A source or engine failure is `NOT_EVALUATED`.

These compact examples are taken from a real three-document Actor run. Every row also returns `externalStateStatus: NOT_EVALUATED_EXTERNAL_STATE` because participant, network, delivery, and recipient state are outside offline preflight.

### Billing

The `invoice-validated` event costs **$0.004**.

- `ACCEPTED`: billed once
- `REJECTED`: billed once
- `NOT_EVALUATED`: free
- Active and preview decisions share one invoice charge
- Dataset delivery does not add a second charge
- The Actor stops before processing unless the event price is exactly $0.004

One malformed or unavailable source does not kill the remaining batch.

### Release gates

Every build must pass:

1. SHA-pinned official Peppol Invoice and CreditNote examples against the active 3.0.20 and preview 3.0.21 rule packages.
2. A deterministic mutation that must be rejected with `BR-02`.
3. Runtime SHA-256 verification of every executed XSD and Schematron artifact.
4. Source, security, batch-independence, billing-guard, report, and output-contract tests.

### Security and privacy

- DTDs, XML entities, and external references are blocked
- HTTPS URL sources reject private, loopback, link-local, and metadata addresses
- Redirects are revalidated
- Source XML is not copied into dataset results
- Optional reports are disabled by default
- Every loaded document receives a SHA-256 digest
- The container runs as a non-root user

### Transition control

On 17 August 2026, the 3.0.21 package must move from preview to active in one release-gated build. The previous active package will then be retired, the real fixtures rerun, and the README versions block updated.

For custom access-point integration or high-volume support, contact the Actor owner through the Apify profile.

This Actor is also exposed to AI agents through Apify's MCP server
(mcp.apify.com): an agent can discover it by search and run it with the same
pay-per-event billing, with no separate integration.

### E-invoice validator family

Same engine, same output contract, one validator per market:
[XRechnung & ZUGFeRD (Germany)](https://apify.com/kamerozkan/xrechnung-xml-batch-validator-api) | [Poland KSeF FA(3)](https://apify.com/kamerozkan/poland-ksef-preflight-validator) | [France E-Invoice](https://apify.com/kamerozkan/france-einvoice-validator) | [Italy FatturaPA](https://apify.com/kamerozkan/italy-fatturapa-validator)

# Actor input Schema

## `invoiceFiles` (type: `array`):

Upload Peppol BIS Billing UBL 2.1 invoice or credit-note XML files. Source documents are not copied to the output dataset.

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

Each object needs one XML source: url, xml, or base64. HTTPS URLs only. documentId and fileName are optional.

## `sourceKeyValueStoreId` (type: `string`):

Optional. Select a key-value store that contains UBL XML records, then list the record keys below.

## `keyValueStoreKeys` (type: `array`):

Record keys to read from the selected source key-value store.

## `resultDetail` (type: `string`):

FINDINGS returns rule IDs, messages, and locations. SUMMARY returns only status and counts.

## `maxFindingsPerDocument` (type: `integer`):

Caps the findings array without changing the total severity counts.

## `storeXmlReport` (type: `boolean`):

Optional. Stores a normalized XML report covering active and preview rule results. Reports can contain invoice values.

## `storeHtmlReport` (type: `boolean`):

Optional. Stores a human-readable findings report in your run key-value store.

## Actor input object example

```json
{
  "documents": [
    {
      "documentId": "official-peppol-valid-sample",
      "fileName": "base-example.xml",
      "url": "https://raw.githubusercontent.com/itplr-kosit/validator-configuration-bis/release-3.0.20/test-files/good/ubl/base-example.xml"
    }
  ],
  "resultDetail": "FINDINGS",
  "maxFindingsPerDocument": 100,
  "storeXmlReport": false,
  "storeHtmlReport": false
}
```

# Actor output Schema

## `validationResults` (type: `string`):

No description

## `summary` (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 = {
    "documents": [
        {
            "documentId": "official-peppol-valid-sample",
            "fileName": "base-example.xml",
            "url": "https://raw.githubusercontent.com/itplr-kosit/validator-configuration-bis/release-3.0.20/test-files/good/ubl/base-example.xml"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kamerozkan/peppol-bis-preflight-validator").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": "official-peppol-valid-sample",
            "fileName": "base-example.xml",
            "url": "https://raw.githubusercontent.com/itplr-kosit/validator-configuration-bis/release-3.0.20/test-files/good/ubl/base-example.xml",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("kamerozkan/peppol-bis-preflight-validator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": "official-peppol-valid-sample",
      "fileName": "base-example.xml",
      "url": "https://raw.githubusercontent.com/itplr-kosit/validator-configuration-bis/release-3.0.20/test-files/good/ubl/base-example.xml"
    }
  ]
}' |
apify call kamerozkan/peppol-bis-preflight-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=kamerozkan/peppol-bis-preflight-validator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/7hUmsUWO5wpNVeDOz/builds/jO0d70BNxar2a5VkG/openapi.json
