E-Invoice Validator: XRechnung, ZUGFeRD, Factur-X avatar

E-Invoice Validator: XRechnung, ZUGFeRD, Factur-X

Pricing

from $2.60 / 1,000 apify-default-dataset-items

Go to Apify Store
E-Invoice Validator: XRechnung, ZUGFeRD, Factur-X

E-Invoice Validator: XRechnung, ZUGFeRD, Factur-X

Validate e-invoices in bulk against EN 16931 and KoSIT rules. Accepts XRechnung XML (UBL, CII) and ZUGFeRD or Factur-X PDFs. Get a valid or invalid verdict, kind, profile and detailed findings with rule ID and XPath location per invoice.

Pricing

from $2.60 / 1,000 apify-default-dataset-items

Rating

0.0

(0)

Developer

bite-sized-insights

bite-sized-insights

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Features

Limited permissions

Share

Validate e-invoices in bulk - XRechnung (UBL and CII), ZUGFeRD and Factur-X (PDF with embedded XML) against EN 16931 and the KoSIT rules, with every error and warning listed by rule, stage and location.

Send invoices as XML text, base64 XML or a base64 ZUGFeRD / Factur-X PDF and get one result per invoice: valid or not, the syntax (UBL or CII), whether it is an invoice or a credit note, the ZUGFeRD / Factur-X profile, and the full list of findings from the XML Schema check and the EN 16931 and XRechnung Schematron rules. Use it to check supplier invoices before booking them, to test the invoices your own system generates, or to gate an accounts-payable pipeline in Germany, France and the rest of the EU.

No login required. No cookies needed. Pay-per-event pricing.

Why Choose This Actor?

"Know whether an e-invoice will pass before the recipient's system rejects it"

Our E-Invoice Validator provides:

  • XRechnung, ZUGFeRD, Factur-X: UBL Invoice, UBL CreditNote and CII XML, plus PDFs with an embedded invoice
  • Peppol BIS Billing 3.0: UBL invoices and credit notes checked against EN 16931 and the OpenPeppol rules (release 3.0.22), including the national DE, DK, GR, IS, IT, NL, NO and SE rules the BIS carries
  • Polish KSeF FA(3) and Italian FatturaPA: detected from the document and checked against the official XML Schemas (KSeF with a few extra transport and content checks); see the FAQ for what is and is not covered
  • The Reference Rules: XML Schema, then the EN 16931 and XRechnung Schematron rules from the official KoSIT validator configuration (XRechnung 3.0.2, EN 16931 1.3.16)
  • Findings You Can Act On: every error and warning with rule id (BR-CO-16, BR-DE-15, ...), stage (xsd, en16931, xrechnung, peppol), severity, XPath location and message
  • Profile Detection: for PDFs the ZUGFeRD / Factur-X profile and the attachment the XML was read from
  • Bad Invoices Never Stop the Run: a file that is not XML, not well-formed or has no embedded XML comes back with valid: false and a reason
  • Safe by Design: nothing in a PDF is executed or rendered and XML with a DOCTYPE is refused, so there is no entity expansion or network access
  • Cost-Effective: Pay only for the invoices you validate: $4.00 / 1k invoices
  • No Third-Party Dependency: runs on bundled rules, with no upstream service to fail or rate-limit you

Quick Start

{
"invoices": [
{ "name": "skeleton.xml", "value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"/>" }
]
}

This empty skeleton runs as is and comes back with valid: false and the reason that no specification identifier (BT-24) was found. Replace it with your own invoices; the input prefilled in the Console is a complete, valid XRechnung UBL invoice. For a ZUGFeRD / Factur-X PDF pass its base64 as value (see the table below).

Usage Examples

Each entry of invoices is one of:

EntryNotes
Invoice XML as textStarts with <
Base64 of the invoice XML
Base64 of a PDFDetected by the %PDF- header. The XML is read from the attachment factur-x.xml, zugferd-invoice.xml or xrechnung.xml. Encrypted PDFs are not supported
{"value": "...", "name": "invoice-001.pdf"}Wraps any of the above; name is an optional label copied to the result
"https://example.com/invoice.xml"A URL (text starting with http:// or https://): the actor fetches the XML or PDF itself
{"url": "https://example.com/invoice.pdf", "name": "invoice-001.pdf"}The same as an object; name is an optional label copied to the result

Whitespace in base64 is ignored. For documents that are online, pass their URL instead of the content: the actor downloads the XML or PDF itself (at most 5 MB per document) and validates what it received. There is no key-value store input, so for local files read them yourself and pass their content (base64 for binary PDFs).

URLs and content can be mixed in one run:

{
"invoices": [
"https://example.com/invoices/2026-001.xml",
{ "url": "https://example.com/invoices/2026-002.pdf", "name": "2026-002.pdf" }
]
}

Only public http and https URLs on the default ports (80 and 443) are fetched, with up to 5 redirects. Addresses on private or internal networks (loopback, private ranges, link-local and cloud metadata addresses) are blocked, also after a redirect, and no cookies, logins or credentials are sent, so documents behind a login cannot be fetched: pass their content instead. A URL that cannot be fetched (HTTP error, timeout, larger than 5 MB, not XML or PDF, blocked address) gets no record and is not charged; see Pricing.

Output Example

Each invoice that was validated produces one dataset record (long values are abbreviated with … and ... here).

{
"index": 1,
"name": null,
"invoice": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\">…",
"valid": false,
"syntax": "ubl",
"kind": "invoice",
"source": "xml",
"profile": null,
"customization_id": "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0",
"scenario": "XRechnung (UBL Invoice)",
"embedded_filename": null,
"error_count": 1,
"warning_count": 0,
"errors": [
{
"stage": "en16931",
"rule": "BR-CO-16",
"level": "fatal",
"location": "/Q{urn:oasis:names:specification:ubl:schema:xsd:Invoice-2}Invoice[1]/...",
"message": "[BR-CO-16]-Amount due for payment (BT-115) = ..."
}
],
"warnings": [],
"findings_truncated": false,
"reason": "1 validation error(s), first: [BR-CO-16]-Amount due ..."
}

An invoice that is not a readable e-invoice (not XML, not well-formed, no embedded XML, unsupported profile) is validated like any other: valid: false, no findings and the cause in reason. An entry that cannot be validated at all (not text, missing value, over 5 MB, or failed in the rule engine) gets no record and is not charged; see Pricing.

Input Parameters

ParameterTypeRequiredDescription
invoicesarrayYes1-1,000 invoices: XML text, base64 XML, base64 PDF, or {value, name?} objects. At most 5 MB per invoice (after base64 decoding). Each entry can also be a URL ("https://..." or {url, name?})

Output Fields

FieldTypeDescription
indexintegerPosition of the invoice in the input, starting at 1
namenull/stringThe name given with the invoice, otherwise null
urlnull/stringThe URL the invoice was fetched from, null when the invoice was given as content
invoicestringThe start of the invoice as provided, cut to 100 characters. For a URL entry: the start of the URL
validbooleanTrue when there are no errors. Warnings do not make an invoice invalid
syntaxnull/stringubl, cii, ksef (Polish KSeF FA(3)), fatturapa (Italian FatturaPA) or facturae (Spanish Facturae); null when the document was not recognized
kindnull/stringinvoice, credit_note or corrective_invoice (Polish or Spanish correction invoice)
sourcenull/stringxml (XML text or base64 XML) or pdf
profilenull/stringPDFs: the ZUGFeRD / Factur-X profile, null when unknown. Peppol BIS invoices: the ProfileID (BT-23), e.g. urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
customization_idnull/stringThe specification identifier (BT-24); for KSeF the form code (FA (3) 1-0E), for FatturaPA the versione (FPA12)
scenarionull/stringThe validation scenario that was applied
embedded_filenamenull/stringPDFs only: the attachment the XML was read from
error_count, warning_countintegerNumber of entries in errors and warnings
errors, warningsarrayFindings {stage, rule, level, location, message}; at most 100 each
findings_truncatedbooleanTrue when a findings list was cut at 100 entries
reasonnull/stringWhy the invoice is not valid: the first error, or the cause when no verdict was possible

Findings

stage is xsd (XML Schema), en16931, xrechnung, ciusro, hrcius, peppol (the OpenPeppol rules) or ksef (the few KSeF checks beyond the schema). rule is the rule id, and null for schema errors. level is the effective severity: fatal and error findings go to errors, warning and information to warnings, following the KoSIT scenario configuration (for example BR-CL-21 and BR-CL-23 are warnings and UBL-CR-646 is an error in the XRechnung UBL invoice scenario). A failed XML Schema check stops the run for that invoice, since the Schematron rules only run on schema-valid documents.

What is checked, and what is not

The scenario is chosen from the document type and the exact specification identifier: XRechnung, XRechnung Extension, XRechnung CVD and plain EN 16931 (urn:cen.eu:en16931:2017). Peppol BIS Billing 3.0 invoices (urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0) have their own scenario, see the FAQ. ZUGFeRD / Factur-X BASIC, EXTENDED and EN 16931 invoices are checked against the plain EN 16931 rules; the ZUGFeRD-specific profile rules are not checked. The MINIMUM and BASIC WL profiles are outside EN 16931 and are not validated (valid: false with a reason, no findings), as are unknown XRechnung versions and invoices without a specification identifier. The invoice is checked, not archived or signed: there is no PDF/A conformance check, no signature check and no check against a recipient's system.

Pricing

CostDescription
$0.0001 / startCharged per actor run
$4.00 / 1,000 invoicesCharged per invoice validated
DescriptionFreeBronzeSilverGold+
Charged per invoice validated$4.00 / 1,000 invoices$3.80 / 1,000 invoices$3.40 / 1,000 invoices$2.60 / 1,000 invoices

Gold, Platinum and Diamond share one price. The price depends on your Apify subscription plan and applies automatically.

Every record in the dataset is charged, valid or not. Entries that were never validated are not charged: an entry that is not text or has no value, an invoice over 5 MB and an invoice the validation engine failed on are left out of the dataset and listed in the FAILED_RECORDS record of the run's key-value store (with the start of the input, so the record stays small). Retrying them will not change the outcome, so the run does not fail for them. Entries that could not be checked for a temporary reason are also not charged, and the run ends with a message so you can retry them. The same applies to a URL that could not be fetched (HTTP error, timeout, larger than 5 MB, neither XML nor PDF, blocked address, too many redirects): it is listed in FAILED_RECORDS with the error code fetch_failed and a short reason, and is not charged.

API Integration

cURL

curl -X POST "https://api.apify.com/v2/acts/bite-sized-insights~bulk-e-invoice-validator/runs?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"invoices": [{"name": "invoice-001.xml", "value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"/>"}]}'

Python

import base64
from pathlib import Path
from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
pdf = base64.b64encode(Path("rechnung.pdf").read_bytes()).decode()
run = client.actor("bite-sized-insights/bulk-e-invoice-validator").call(
run_input={"invoices": [{"name": "rechnung.pdf", "value": pdf}]}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(f"{item['name']}: valid={item['valid']} errors={item['error_count']} profile={item['profile']}")
for finding in item["errors"]:
print(f" {finding['rule']}: {finding['message']}")

JavaScript

import { ApifyClient } from 'apify-client';
import { readFileSync } from 'node:fs';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('bite-sized-insights/bulk-e-invoice-validator').call({
invoices: [{ name: 'invoice-001.xml', value: readFileSync('invoice-001.xml', 'utf8') }],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(item => {
console.log(`${item.name}: valid=${item.valid} errors=${item.error_count}`);
});

Use Cases

  • Accounts Payable: Reject non-compliant supplier e-invoices before they reach booking or approval
  • ERP and Billing Testing: Check the XRechnung and Factur-X files your system generates against the reference rules in CI or before a release
  • Public Sector Billing: Verify XRechnung invoices before submitting them to a German public-sector portal
  • E-Invoicing Migration: Batch-check an archive of PDF invoices to see which already carry a valid embedded ZUGFeRD / Factur-X XML
  • Service Providers: Add a validation step with a clear findings list to an invoice-exchange or conversion service

FAQ

Is the verdict the same as the KoSIT validator's?

For XRechnung and plain EN 16931 invoices the same configuration is used (XRechnung 3.0.2, EN 16931 1.3.16): XML Schema, then the EN 16931 and XRechnung Schematron rules with the scenario's severity overrides. ZUGFeRD / Factur-X profile-specific rules are not part of that configuration and are not checked.

Does it support Peppol BIS Billing 3.0?

Yes, for UBL invoices and credit notes with the specification identifier urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0: XML Schema, then the EN 16931 rules, then the OpenPeppol rules of release 3.0.22 (PEPPOL-EN16931-*, finding stage peppol), including the national DE, DK, GR, IS, IT, NL, NO and SE rules the BIS carries (they apply by the countries of the parties). The result carries the ProfileID in profile and the scenario Peppol BIS Billing 3.0 (UBL Invoice) or (UBL CreditNote). Not covered: Peppol BIS in CII (the BIS has no CII binding), other Peppol identifiers such as extensions or self-billing (valid: false with a reason, never silently checked against plain EN 16931), the SBDH envelope, Peppol network delivery and participant lookups. An XRechnung invoice sent over Peppol carries its own XRechnung identifier and is validated as XRechnung.

Does it validate Polish KSeF (FA(3)) and Italian FatturaPA invoices?

Yes, the format is detected from the document. KSeF FA(3) invoices are checked against the official XML Schema plus a few KSeF checks (UTF-8 without BOM, no processing instructions, NIP check digit, duplicate line numbers, issue date not in the future). FatturaPA (1.2 for PA and private customers, and the simplified invoice) is checked against the official XML Schema only: there are no SDI business rules and no .p7m files (send the XML inside). A valid result is a pre-flight result, not an acceptance by KSeF or SDI.

What are the size limits?

5 MB per invoice after base64 decoding (the XML, or the embedded XML for a PDF). Larger invoices are not validated or charged (see Pricing). One run takes up to 1,000 invoices; the platform also limits the total size of the run input (about 9 MB for an API call), so send PDFs in several runs. Runs are split into backend requests automatically.

What happens to an entry that is not text, has no value or is too large?

It is skipped, with no dataset record and no charge (details under Pricing). The index of the other records still counts the skipped entries.

Which URLs can I pass, and what happens when one cannot be fetched?

Public http:// and https:// URLs (ports 80 and 443, up to 5 redirects, at most 5 MB per document, no login or cookies). The document must be XML or a PDF. Addresses on private or internal networks are blocked for safety. The actor fetches all URLs first and then validates the content, so very slow servers can cost time: a URL that does not fit into the time left of the run counts as not fetched. A URL that cannot be fetched is skipped with no dataset record and no charge, and is listed in FAILED_RECORDS with the error code fetch_failed (the index of the other records still counts it). Run it again once the document is reachable.

What happens to an invoice that is not valid XML?

The run continues. That invoice gets valid: false, no findings and a reason such as "not well-formed XML" or "no embedded invoice XML", and it is counted like any other invoice.

Are the results in the same order as my input?

Yes. The record with index: N belongs to invoice number N of the input.

Is my data stored or shared anywhere?

No. Input is processed for the duration of the run only and results are written to your own private run dataset, same as any other Apify actor.

Free plan

Free-plan users get 5 runs in total. Each free run validates only the first 10 entries of your input (the rest is ignored without an error) and returns at most 10 results. Console test runs have the same cap.

Disclaimer

This actor validates invoices against format and rule sets and does not give legal or tax advice. A valid result means no rule violation was found by the checks described above; it does not guarantee that a recipient's system accepts the invoice. Rules change over time; results reflect the version of the actor you run.

Attribution: the Peppol BIS Billing 3.0 validation rules are published by OpenPeppol AISBL (copyright OpenPeppol AISBL) and are built on the CEN EN 16931 validation artefacts (EUPL-1.2). Not affiliated with, endorsed by or certified by OpenPeppol AISBL. Peppol is a name of OpenPeppol AISBL; it is used here only to describe the format this actor validates. This actor is not a Peppol Access Point or Service Provider and does not send or receive documents over the Peppol network.


Need help? Open an issue on the actor's repository or contact support through Apify Console.