node-zugferd
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

node-zugferd

❗ 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.

Table of Contents

Features

  • Create Factur-X compliant xml
  • Attach xml to pdf/a-3b
  • Validate xml

Installation

Install node-zugferd with npm:

npm install node-zugferd@latest

Default Supported Profiles

⚠️ 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.

Basic Usage

  1. Create a new instance:

    import { zugferd, BASIC } from 'node-zugferd'
    
    export const invoicer = zugferd({
        profile: BASIC
    })
  2. 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)
  3. 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'
        }
    })

Roadmap

  • [X] Allow attaching additional files to pdf
  • [ ] Add Schematron for validation
  • [ ] Native support for XRechnung
  • [ ] Parse ZUGFeRD/Factur-X documents

Dependencies

License

Distributed under the MIT License. See LICENSE.md for more information.

Package Sidebar

Install

npm i node-zugferd

Version

0.0.3

License

MIT

Unpacked Size

3.17 MB

Total Files

29

Last publish

Collaborators

  • jslno-x