EN 16931 in ASP.NET Core: What you should know about eInvoicing in the EU

Are you building a business app with Orchard Core or ASP.NET Core that sends invoices in the EU? Then you’ll likely run into structured eInvoicing sooner or later.

Germany requires support to some extent for EN 16931 from January 2025. And other EU countries will follow them soon. Under the EU’s VAT in the Digital Age (ViDA) initiative, structure eInvoicing will be mandatory for cross-border B2B transactions from 2030.

What is EN 16931?

It’s the official EU standard for electronic invoices. Instead of sending just a PDF or a printed invoice, businesses send XML that can be read by software. Then this XML can be processed automatically.

If you work with EU companies or governments, supporting or using this will become a must.

What is CIUS?

Each EU country can have its own rules built on top of EN 16931. These are called Core Invoice Usage Specification (CIUS). Even if your invoice passes EN 16931, it might still fail in a specific country without their country’s CIUS support.

If your app needs to work in more than one EU country, expect extra work to handle multiple CIUS versions.

What are Factur-X and ZUGFeRD?

These are hybrid formats, a PDF invoice with XML inside it. They look normal to people, but software can manage them automatically.

ZUGFeRD was originally developed in Germany, while Factur-X in France. Today they are basically the same format.

There is also XRechnung in Germany, which is a CIUS, so if you need to send invoices to Germany or create then in Germany, you need to support that on top of EN 16931.

What are the common challenges?

Implementing EN 16931-compliant eInvoicing comes with several technical and practical challenges.

During XML generation, you have to make sure you use the right format, values, and validations. It is not that trivial with all the different requirements per country.

When you are working with hybrid formats like Factur-X or ZUGFeRD, you also have to create a very specific format of PDF (PDF/A-3) and embed the XML inside it. Not many libraries can do this. Mostly commercial tools can provide the performance and reliability to support this in a production environment.

Supporting multiple countries means different rules, and also these rules get new releases at least two times per year, and also deprecate versions regularly. So version control, legal and regulatory timelines are something that needs to be followed very closely.

What about ASP.NET Core and Orchard Core?

On top of ASP.NET Core you’ll still need extra tools for validation and PDF/A-3 support. Schema validation is built-in. But you’ll need commercial tools like iText to create PDF/A-3 files and Saxonica for schematron validation.

If you’re building on Orchard Core, the modular architecture makes it easy to add eInvoicing functionality without disrupting the rest of your system. You can build custom features as Orchard modules and take advantage of the CMS capabilities to create, edit, draft, and publish invoice-related content.

We’ve also built a reusable, simple EN 16931 validation library, which makes it even easier to add eInvoice validation to Orchard Core or any ASP.NET Core-based project. See our post about it here.

Do you need help with anything above?

We’ve built an eInvoicing solution based on EN 16931 before, including support for specific CIUS profiles, so we speak from experience. It’s certainly not easy!

If you need to implement EN 16931 eInvoicing in your ASP.NET Core system, or want to extend your product to support formats like Factur-X or ZUGFeRD, we can help with the following:

  • Designing and developing EN 16931-compliant eInvoicing system
  • Generating structured XML and embedding it into PDF/A-3 files
  • Validating invoice data using schema and schematron rules
  • Implementing CIUS-specific technical requirements
  • Choosing the right tools and designing a maintainable architecture

Contact us to talk about your goals and how we can support your project.