Answer ยท E-invoice validation
How do I validate an EN 16931 e-invoice from code?
Send the invoice XML (UBL 2.1 Invoice or CreditNote, or UN/CEFACT CII) to the einvoice_check tool of the Avanciq connector, over MCP or REST, and it returns VALID or INVALID with each failed rule id, where it fails and how to fix it. It runs the core EN 16931 rules only: the Peppol BIS and XRechnung extension rules are not included, so for those use a validator that ships their configurations.
What einvoice_check does
It runs the official CEN EN 16931 business rules (validation artefacts, unmodified) and also reads the XML inside Factur-X / ZUGFeRD. The XML is checked in memory and not stored; each check costs 2 calls.
einvoice_rule returns the official text of a single rule and is free.
Options for validating from code
| Option | What it is | Notes |
|---|---|---|
| Avanciq einvoice_check | MCP / REST tool; official CEN EN 16931 rules on UBL 2.1 or CII; failed rule ids with fixes. | Core EN 16931 only. Free key: 100 calls a month (a check is 2 calls). |
| KoSIT validator (open source) | Validates XML documents with XML Schema and Schematron; public validation configurations exist for XRechnung and for Peppol BIS Billing. | The route for XRechnung and Peppol BIS rules; you run it yourself. |
What our test showed
In our 60-task test of 20 November 2026, the smaller model (Claude Haiku 5.5) went from 12 to 15 of 15 e-invoice tasks right with the connector; Claude Sonnet 5.5 was 15 of 15 both ways. E-invoice validation uses more tokens with the connector, because the agent has to send the whole invoice.
How to try it
- Get a free key on the API keys page (100 calls a month, no card).
- Call POST
https://api.avanciq.com/connect/v1/tools/einvoice_checkwith your invoice XML; the field names are in the OpenAPI file athttps://avanciq.com/openapi.json. - In an MCP client use the same server as the other tools:
https://api.avanciq.com/connect/mcpwith the header Authorization: Bearer YOUR_KEY.
Questions people ask
Does it validate XRechnung or Peppol BIS?
Not their extension rules. It runs the core EN 16931 rules only. Use a validator with the XRechnung or Peppol BIS Billing configuration for those, for example the open-source KoSIT validator.
Which invoice formats can I send?
UBL 2.1 Invoice or CreditNote and UN/CEFACT CII, including the XML inside Factur-X and ZUGFeRD.
Is the invoice stored?
No. The XML is checked in memory and not stored. Only the tool, the status and the time are logged.
How many calls does one check use?
Two calls. The free plan has 100 calls a month.
Related
Sources
- Avanciq: llms-full.txt (tool docs) (our page, read 23 November 2026)
- Avanciq: llms.txt (our page, read 23 November 2026)
- Avanciq: agent connector (tools, tests, plans) (our page, read 23 November 2026)
- KoSIT validator on GitHub (read 23 November 2026)
- Avanciq: API keys and plans (our page, read 23 November 2026)