Skip to main content
Introducing packages.sweber.dev
All packages
BetaMIT + Pro

SummandValidate XRechnung, ZUGFeRD and Factur-X e-invoices against EN 16931 in pure TypeScript: in Node, the browser and at the edge, without Java.

pnpm add @sweberdev/summand

Germany requires businesses to receive e-invoices since 1 January 2025, and to send them from 2027. Checking an XRechnung or ZUGFeRD invoice has so far meant the KoSIT validator: Java, Saxon and a server. Summand runs the same official rule sets in pure TypeScript, so you can check invoices in your Node backend, in a serverless function, in the browser before upload, or in CI.

Summand ships its own XPath 2.0 and Schematron engine and the official EN 16931 rules from CEN (UBL and CII) and the XRechnung rules from KoSIT, including the severity changes KoSIT applies for the standard, extension and CVD profiles. It passes all 1'142 CEN rule tests and every invoice of the KoSIT test suite. It reads the XML embedded in ZUGFeRD and Factur-X PDFs, recognises the profile, checks Leitweg-IDs and reports every finding with rule, message, XPath and line. Summand checks invoices technically; it is not tax advice.

Example

A short exampleCopy it into your project.

app/api/invoices/route.ts

import { validateInvoice } from "@sweberdev/summand"

export async function POST(req: Request) {
  const bytes = new Uint8Array(await req.arrayBuffer()) // XML or ZUGFeRD PDF
  const result = validateInvoice(bytes)

  if (!result.valid) {
    return Response.json({ errors: result.errors }, { status: 422 })
  }
  return Response.json({ profile: result.profile?.label, invoice: result.summary })
}

Features

What you getFree under MIT, with Pro on top.

Free, MIT

  • Official rule sets: CEN EN 16931 1.3.16 for UBL and CII, KoSIT XRechnung 2.6.0 for XRechnung 3.0, with KoSIT's severity changes for standard, extension and CVD
  • Passes all 1'142 CEN rule tests and every invoice of the KoSIT test suite
  • UBL Invoice, UBL Credit Note and UN/CEFACT CII, detected automatically
  • ZUGFeRD 2.x and Factur-X PDFs: reads the embedded XML and compares the profile in the PDF metadata with the XML
  • Profiles recognised: XRechnung, Peppol BIS, EN 16931, Factur-X MINIMUM, BASIC WL, BASIC and EXTENDED
  • Leitweg-ID check with ISO 7064 check digits
  • Every finding with rule ID, message, XPath and line number; an invoice summary with number, parties and totals
  • Pure TypeScript with its own XPath 2.0 and Schematron engine: Node, browsers, workers and edge runtimes, no Java
  • summand CLI: validate, extract the XML from a PDF, check a Leitweg-ID

Pro

  • Read any invoice into one typed object with all EN 16931 business terms, from UBL or CII, XML or PDF
  • Show invoices as readable, printable HTML in German or English, with the validation report
  • Validate whole folders: JSON, CSV, JUnit and HTML reports, duplicate detection and a hash-chained audit log

Compare

Free and ProSide by side.

FeatureFreePro
EN 16931 and XRechnung validation, UBL and CIIIncludedIncluded
ZUGFeRD and Factur-X PDFs, Leitweg-ID check, CLIIncludedIncluded
Typed invoice object with all business termsSummary onlyIncluded
Readable HTML view with validation reportNot includedIncluded
Batch validation, duplicates, audit logNot includedIncluded
LicenceMITPer person
SupportGitHub issuesAgency and Lifetime

Pro

Pro packagesAdd-ons on top of the core.

  • @weber-development/summand-read

    Reads XRechnung, ZUGFeRD and Factur-X (UBL or CII, XML or PDF) into one typed Invoice object: parties, lines, VAT breakdown, allowances and charges, payment details, references and attachments.

  • @weber-development/summand-view

    Renders an invoice as readable, printable HTML in German or English, with the validation report. What your users look at before they approve an invoice.

  • @weber-development/summand-inbox

    Validates folders of invoices from the command line or your code: JSON, CSV, JUnit and HTML reports, duplicate detection across runs and an audit log with a SHA-256 per file.

Pricing

PricingPrices are in CHF.

Freelancer

For one person working on client projects.

CHF 190

per year

2 months free

  • 1 person
  • No support entitlement
Join waitlist

Agency

Recommended

For teams of up to ten named people, one price.

CHF 590

per year

2 months free

  • Up to 10 people
  • Support included
Join waitlist

Lifetime

Pay once for up to ten people and keep updates and repository access.

CHF 1'990

one-time

  • Up to 10 people
  • Support included
Join waitlist

11 people or more: get in touch

  • Pay yearly and get two months free: CHF 190 instead of CHF 228 for Freelancer, CHF 590 instead of CHF 708 for Agency.
  • After cancelling, every version you already received keeps working. Only updates and repository access end.
  • No licence key, no phone-home. The Pro packages never contact a server to check your licence.
  • Agency and Lifetime cover up to ten named people for one price: you choose the number of seats at checkout and assign them in Polar. Your clients and their websites need no licence of their own.
  • Checkout, invoices and VAT are handled by Polar as merchant of record.
Read the licence terms

FAQ

QuestionsShort answers.

Does Summand replace the KoSIT validator?

For the business rules, yes: Summand runs the same official Schematron files and passes the KoSIT test suite. It does not check the XML schemas (XSD) yet, so a document with an element in the wrong place can pass Summand and still fail the KoSIT validator. Schema validation is on the roadmap.

Which formats does Summand accept?

XRechnung 3.0 in UBL and CII, ZUGFeRD 2.x and Factur-X as PDF or XML, Peppol BIS and plain EN 16931 invoices. ZUGFeRD 1.0 predates EN 16931 and is reported as unsupported. Factur-X MINIMUM and BASIC WL are recognised but are not full invoices under EN 16931, which Summand says in the result.

Does an invoice that passes meet the German VAT rules?

Not automatically. Summand checks the technical rules of EN 16931 and XRechnung. Whether an invoice is correct for VAT purposes, for example the tax rate or an exemption, is a question for your accounting or tax adviser.

Does Summand send invoices anywhere?

No. It runs where you call it: on your server, in your function or in the browser. Nothing is uploaded, and the Pro packages do not contact a licence server either.

Why are the rule sets under other licences?

Summand's code is MIT. The bundled rules are the official artefacts: EN 16931 from CEN under the EUPL 1.2 and XRechnung from KoSIT under the Apache License 2.0. Both allow this use; the notices ship with the package.

Articles

ArticlesGuides and release notes.

    Latest release notes

    All release notes →