❗ This package is still under development.
A Node.js library for creating ZUGFeRD/Factur-X compliant documents. Generating XML and embedding it into PDF/A files, enabling seamless e-invoicing and digital document compliance.
- Create Factur-X compliant xml
- Attach xml to pdf/a-3b
- Validate xml
Install node-zugferd with npm:
npm install node-zugferd@latest
⚠️ Documents containing only information of the first two profiles (MINIMUM and BASIC WL) are not considered to be invoices according to German fiscal law (→ GoBD); they may therefore not be used as electronic invoices in Germany. They will not be considered as invoices in France anymore once the einvoicing B2B mandate CTC reform has been fully deployed (2028). It is then highly recommended to target the BASIC profile at minimum.
- MINIMUM
- BASIC WL
- BASIC
- EN 16931 (COMFORT)
- EXTENDED
📝 By default this package only provides support for the CII-Syntax
💡 You can also define your own Profiles.
If you encounter invalid or missing fields, feel free to open a new Issue or Pull Request.
-
Create a new instance:
import { zugferd, BASIC } from 'node-zugferd' export const invoicer = zugferd({ profile: BASIC })
-
Define the documents data
import type { ProfileBasic } from 'node-zugferd' import { invoicer } from './your/path' const data: ProfileBasic = { //... your data } const invoice = await invoicer.create(data)
-
Save the document
as XML
const xml = invoice.toXML()
as PDF/A-3b
// The data in your pdf must exactly match the provided data! const pdf = fs.readFileSync('./your/invoice.pdf') const pdfA = await invoice.embedInPdf(pdf, { metadata: { title: 'New Invoice' } })
- [X] Allow attaching additional files to pdf
- [ ] Add Schematron for validation
- [ ] Native support for XRechnung
- [ ] Parse ZUGFeRD/Factur-X documents
Distributed under the MIT License. See LICENSE.md for more information.