Skip to content
Paniolo
Documentation / Getting started

Your first e-invoice.

Build a complete invoice, write it as UBL and CII, validate it, and read it back.

This documentation describes release 1.0.0 at commit 3a23b2b8f91d. The reproducible example uses the published Maven Central artifacts of exactly this version.

1. Prepare Java and Maven

Paniolo needs Java 21 or newer at build and run time; there is no build for older Java versions. The quickstart was verified with Temurin 21.0.12.1 and Maven 3.9.9. The initial build needs network access to download dependencies and the checksum-verified rule bundles. Document processing runs locally afterward and never downloads rules.

Applications fixed to Java 11 or 17 can run Paniolo in a separate Java 21 process, for example behind the command line or a small HTTP service, and exchange XML, PDF, or JSON with it.

2. Add Paniolo

Add the release from Maven Central:

<dependency>
  <groupId>io.github.nalukit</groupId>
  <artifactId>paniolo</artifactId>
  <version>1.0.0</version>
</dependency>

paniolo brings the model, UBL and CII, validation, and the official XRechnung, Factur-X, and Order-X rules. PDF support, PDF/A checks, rendering, JSON, and the browser viewer are optional modules. For a fixed and reproducible build, follow the exact steps in the reference.

3. Create, export, and validate

The complete example includes imports, seller and buyer details, invoice lines, and checks of the result. Use it as the starting point for your application.

4. Share one instance

Create one Paniolo at application start and reuse it. It is immutable and thread-safe and compiles each set of rules once, on first use; warmUp() compiles the XRechnung rules at start-up instead.

private static final Paniolo PANIOLO = Paniolo.create()
                                              .warmUp();   // optional

What happens next?

  • Receive invoices. validate(bytes) and read(bytes) detect UBL, CII, ZUGFeRD 1.0, and hybrid PDFs. ReadMode.LENIENT accepts documented amount deviations as warnings, and importInvoice keeps the original XML and stated amounts for booking and archiving.
  • Create hybrid PDFs. Embed the XML into your own PDF/A with toFacturX(invoice, pdfA, profile), or let paniolo-facturx render the page with toFacturX(invoice, profile).
  • Inspect findings. Each finding has rule ID, severity, XPath, and stage; result.toXml() produces an archivable report, toReportPdf a PDF/A report.
  • Orders and delivery notes. The same facade writes, reads, and validates Order-X, UBL DespatchAdvice, and CIDA.
  • Migrate. ZUGFeRD 1.0 documents migrate to ZUGFeRD 2 with migrateZugferd1; Mustang integrations move over with paniolo-mustang and the migration guide.

Read the full usage guide in the README ↗