Peppol Validator for AI Agents

Validate Peppol UBL and CII XML invoices from any AI coding agent. Free API, no signup. Prevent rejected invoices before they reach the Peppol network.

By Peppol Validator · Last updated

Why AI agents must validate invoices

An invalid e-invoice is a rejected invoice. When a UBL XML invoice violates EN16931 business rules or Peppol BIS 3.0 constraints, the sender's Access Point rejects it before it ever reaches the buyer. No delivery, no payment, no compliance.

AI agents that generate, modify, or process UBL XML invoices operate in a domain with zero tolerance for structural errors. Unlike a web page or an API response where minor issues can be tolerated, a Peppol invoice must pass over 311 schematron rules to be accepted by the network. A missing field, a wrong code list value, or a calculation mismatch is enough to block the entire document.

With e-invoicing now mandatory in Belgium (January 2026), Germany (receiving since January 2025, sending from 2027), and France (from September 2026), the volume of programmatically generated invoices is growing fast. AI agents building or maintaining invoice generation code need validation as a first-class tool.

What happens when validation fails

1

Invoice rejected at Access Point

The sender's Peppol Access Point validates every document before transmission. If it fails, the invoice never enters the network. The buyer never receives it.

2

Payment delayed

A rejected invoice means the payment clock doesn't start. The seller must identify the error, fix the XML, and resend. This can delay payment by days or weeks.

3

Compliance violation

In countries with mandatory e-invoicing, failing to send a valid e-invoice can trigger regulatory penalties. Belgium, Germany, and France all have enforcement provisions.

4

Silent data corruption

Some errors don't cause rejection but lead to incorrect processing: wrong tax amounts, mismatched totals, or invalid currency codes that cause downstream accounting issues.

API endpoint

Send a UBL or CII XML invoice and receive validation results as JSON. The format is detected automatically. No API key, no signup, no rate limits for normal usage.

POST https://peppolvalidator.com/api/v1/validate

curl

curl -X POST https://peppolvalidator.com/api/v1/validate \
  -H "Content-Type: application/xml" \
  -d @invoice.xml

JavaScript / Node.js

const xml = fs.readFileSync("invoice.xml", "utf-8");

const res = await fetch("https://peppolvalidator.com/api/v1/validate", {
  method: "POST",
  headers: { "Content-Type": "application/xml" },
  body: xml,
});

const result = await res.json();
// result.status → "valid" | "invalid" | "error"
// result.errors → [{ rule, message, location }]

Python

import requests

with open("invoice.xml", "r") as f:
    xml = f.read()

res = requests.post(
    "https://peppolvalidator.com/api/v1/validate",
    data=xml,
    headers={"Content-Type": "application/xml"},
)

result = res.json()
print(result["status"])  # "valid" | "invalid" | "error"

Response format

The API returns JSON with a status field ( "valid", "invalid", or "error"), arrays of errors/warnings with rule IDs and XPath locations, and invoice metadata. See the full API reference for field descriptions and example responses.

What gets validated

Every invoice is checked against 311+ schematron rules across two rule sets. These are the same rules that Peppol Access Points use to accept or reject invoices.

1

EN16931 Business Rules (BR-*)

European standard compliance: mandatory fields (seller name, buyer reference, invoice number), calculation checks (line totals, tax amounts, rounding), VAT category logic, and code list validation. 180+ rules.

2

Peppol BIS Billing 3.0 Rules (PEPPOL-EN16931-*)

Network-specific constraints: electronic address scheme IDs, process identifiers, empty element detection, attachment MIME types, and Peppol code list restrictions. 130+ rules.

See the full reference of all 311 validation rules with plain-language explanations and fixes.

MCP Server

Peppol Validator exposes a Model Context Protocol (MCP) server at https://peppolvalidator.com/mcp. AI agents like Claude Desktop, Cursor, and Windsurf can connect directly and call validate_invoice, xml_to_pdf, and submit_feedback as native tools. No API key needed. Agents can also report validation accuracy issues back via HATCHA-verified feedback.

See the MCP setup guide on the developer docs page for configuration instructions.

Agent Skill: one-file integration

An Agent Skill is a structured instruction file that teaches AI coding agents how to use a tool. Add this file to your project and your agent automatically knows how to validate Peppol invoices: the endpoint, request format, and how to interpret results.

Download and place in your project. For Claude Code, use .claude/skills/. For other agents, use .agents/skills/.

.claude/skills/validating-peppol-invoices/SKILL.md

Or create the file manually with these contents:

---
name: validating-peppol-invoices
description: Validates Peppol UBL XML invoices and credit notes
  against EN16931 (CEN) and Peppol BIS Billing 3.0 schematron
  rules via the Peppol Validator API. Use when validating
  e-invoices, checking Peppol compliance, debugging UBL XML
  validation errors, or verifying invoices before sending via
  the Peppol network.
---

# Validating Peppol Invoices

POST XML to the Peppol Validator API and parse the JSON result.

## Endpoint

\`POST https://peppolvalidator.com/api/v1/validate\`

Send raw XML with \`Content-Type: application/xml\`:

```bash
curl -X POST https://peppolvalidator.com/api/v1/validate \
  -H "Content-Type: application/xml" \
  -d @invoice.xml
```

Returns JSON with status ("valid" / "invalid" / "error"),
errors, warnings, and invoice metadata.

What your agent can do with it

  • Validate XML invoices during development and flag issues inline
  • Run validation in CI/CD before deploying invoice generation code
  • Debug Peppol validation errors by examining rule IDs and XPath locations
  • Verify fixes by re-validating after code changes
  • Catch calculation mismatches, missing fields, and invalid code list values before they reach production
  • Generate valid test invoices by iterating on validation feedback

Common use cases

Invoice generation systems

ERP integrations, billing platforms, and SaaS tools that generate UBL XML invoices. Validate every invoice before sending via Peppol.

CI/CD pipelines

Automated testing for invoice generation code. Fail the build if generated test invoices don't pass EN16931 and Peppol BIS validation.

E-invoicing migration

Companies migrating from PDF to structured e-invoicing. Use validation to verify that converted invoices conform to Peppol requirements.

Access Point development

Peppol Access Point providers building validation into their inbound and outbound processing pipelines.

HTTP status codes

A 200 response means validation completed; check the status field for the result. Error codes (400, 500, 503) indicate request or server issues. See the developer docs for the full reference.

Try it now

Validate an invoice via the web UI or send one to the API. No signup needed.

Common questions

Why should an AI agent validate Peppol invoices?

An invalid UBL XML invoice will be rejected by the Peppol network. Access Points validate every document before transmission. If your invoice violates EN16931 business rules or Peppol BIS 3.0 constraints, it will not be delivered. AI agents that generate or modify invoices must validate them before sending to avoid rejection, payment delays, and compliance failures.

What happens if I send an invalid invoice via Peppol?

The sender's Access Point validates the invoice before transmission. If it fails validation, the invoice is rejected and never reaches the buyer. This means: no delivery confirmation, no payment trigger, and the seller must fix and resend. In jurisdictions with mandatory e-invoicing (Belgium, Germany, France), this can also create compliance issues and delays in VAT reporting.

Is the API free?

Yes. The Peppol Validator API is free with no signup or API key required. There are no rate limits for normal usage. It is designed for developer workflows, CI/CD pipelines, and AI agent integrations.

What is an Agent Skill?

An Agent Skill is a structured instruction file (typically Markdown with YAML frontmatter) that tells AI coding agents how to use a specific tool. By adding the Peppol Validator skill to your project, your AI agent automatically knows how to validate invoices, including the API endpoint, request format, and how to interpret the response. It works with Claude Code, Cursor, Windsurf, GitHub Copilot, and other compatible agents.

Can I validate invoices in my CI/CD pipeline?

Yes. Use curl, fetch, or any HTTP client to POST invoice XML to the API endpoint. Check the status field in the JSON response. If it is not 'valid', fail the pipeline. This catches validation errors before deployment, preventing invalid invoices from reaching production.

What file formats are supported?

UBL 2.1 XML invoices and credit notes (Peppol BIS Billing 3.0) and CII XML invoices (EN16931 / Factur-X / ZUGFeRD). The format is detected automatically from the XML root element and namespace. PDF files are not supported; extract the XML first.

What is the difference between an error and a warning?

Errors indicate rule violations that will cause the invoice to be rejected by a Peppol Access Point. These must be fixed before sending. Warnings indicate potential issues that may cause problems with some receivers but will not prevent transmission. An invoice with status 'valid' may still have warnings.

What is EN16931?

EN16931 is the European standard for the semantic data model of an electronic invoice, published by CEN (European Committee for Standardization). It defines what information an invoice must contain using business terms (BT-*) and business groups (BG-*). Peppol BIS Billing 3.0 implements EN16931 using UBL 2.1 XML as its syntax. The EN16931 business rules (BR-*) are the first layer of validation applied to every invoice.