Documentation
Validation
Confidence comes in three layers, each stronger than the last: the maths is right by construction, a pre-flight catches missing fields before you render, and you can validate the finished file against the exact rules the authorities use - on your own machine, with nothing leaving it.
The totals can't be wrong
You never type a subtotal. The library derives every line net, the document totals and the VAT
breakdown from your quantities and prices, so the EN-16931 arithmetic rules (the BR-CO-* checks that
the sums add up) hold automatically. The one error that trips most invoices - a total that does not
match its lines - simply cannot happen here.
The pre-flight, before you render
When you target XRechnung, the library checks the mandatory B2G fields and tells you, by field name, what is missing - at build time, in your editor:
import { xrechnungProblems } from "@jasy/zugferd";
const problems = xrechnungProblems(invoice); // string[]; empty means good to go
if (problems.length) console.error(problems.join("\n"));
renderZugferd(invoice, { profile: "xrechnung" }) runs the same check and throws if anything is
missing, so a missing Leitweg-ID surfaces as a clear error now, not as a cryptic portal rejection weeks
later. (See Profiles.)
Verify the finished file - yourself
Here is the part that should put any doubt to rest: don't take our word for it. The @jasy/cli
validates any ZUGFeRD or XRechnung PDF against the official KoSIT Schematron rules - the very same
ones the German authorities run - plus the EN-16931 business rules, entirely on your machine.
Nothing is uploaded.
npx @jasy/cli validate ./invoice.pdf
It reports the EN-16931 rules and the PDF/A-3 structure, and jasy verapdf adds the full ISO PDF/A
check via veraPDF, the official open-source validator. The file you generated
passes the same gates a tax office puts it through - and you watched it happen, locally.
See The CLI for reading, validating and exporting any invoice from your terminal.