Getting started with FactoorSharp

With FactoorSharp you can create, read and validate electronic invoices (ZUGFeRD, XRechnung, EN16931) in just a few minutes.

This guide walks you step by step to your first working invoice.

By the end of this quick start you'll be able to:

  • create an invoice in C#
  • export it as EN16931 / ZUGFeRD XML
  • optionally embed it in a PDF/A-3
  • validate the result

Installation

Install FactoorSharp via NuGet:

Or via the Package Manager:

The library supports: .NET 6+, .NET Framework 4.6, .NET Framework 4.8 (depending on your target platform)

Get a license

TODO: Sign up and retrieve

Create your first invoice

In the following example you'll create a minimal EN16931-compliant invoice.
First, the invoice header data with the seller and buyer identification. This also includes the delivery details:

Next, we add a line item:

And the totals block including payment terms:

Export as XML (EN16931 / XRechnung / ZUGFeRD)

Once your invoice is built, you can export it as XML:

Typical profiles used for ZUGFeRD are:

Comfort / EN16931
Standard for the EU
Extended
The most detailed and widely used profile in Germany

Validate an invoice

To make sure all required fields are present, you can validate your invoice using the validation tool in the customer area at factoorsharp.de.
This helps your invoice recipients process it smoothly.

Create a PDF/A-3 with embedded invoice data (ZUGFeRD)

If you already have a PDF file, for example from a report generator or your ERP system, you can embed the ZUGFeRD information directly into it:

Result: a visually readable PDF/A-3 file that also contains the machine-readable XML data embedded in the PDF document.

Read existing invoices

FactoorSharp can also analyze existing invoices. It doesn't matter whether you're reading an XML file:

Or need to extract the XML file from a PDF file:

Migrating from ZUGFeRD-csharp

FactoorSharp is the successor to ZUGFeRD-csharp.

If you're already working with it:

  • The API is deliberately kept similar
  • Your existing logic can usually be carried over directly
  • Replace InvoiceDescriptor with FacturXInvoice, and InvoicePdfProcessor with FacturXInvoicePdfProcessor. That's it.
  • New features: better validation, new capabilities