node-zugferd
IntroductionInstallation

ZUGFeRD

Minimum
Basic WL
Basic
EN 16931
Extended
XRechnung

Order-X

Basic
Comfort

Extended

This profile constitutes an extension of EN16931 aimed at supporting complex business processes (i.e. invoices which are being invoiced across multiple deliveries or delivery locations, structured terms of payment, further details at item level to facilitate warehousing etc.), and any business case inventoried in France (gathered in a subset named EXTENDED B2B FR and its subset EXTENDED-CTC-FR, as referenced by the French Tax Administration and National Platform PPF – Portail Public de Facturation). This includes additional code lists values which are not part of the European Norm EN 16931 code lists.

Basic Usage

Install the Profile

npm install @node-zugferd/extended@beta

Setup the Profile

Register the profile when creating your zugferd instance:

lib/invoicer.ts
import { basicWL } from "@node-zugferd/extended";
import { zugferd } from "node-zugferd";

export const invoicer = zugferd({
  profiles: [extended], 
});

Define Invoice Data

Provide invoice data that satisfies the requirements of this profile.

data.ts
import type { invoicer } from "@/lib/invoicer";

const data: typeof invoicer.$Infer.Input.Extended = {
  exchangedDocument: {
    invoiceNumber: "471102",
    // ...
  },
  // ...
};

Generate Invoice

Create the invoice and embed it into a PDF/A document or serialize it for further processing.

invoice.ts
import { invoicer } from "@/lib/invoicer";
import { data } from "./data";
import { readFile } from "node:fs/promises";

const invoice = await invoicer.create("extended", data);

const xml = invoice.toXML();
const pdfA = await invoice.toPDF(
  await readFile("./my-invoice.pdf"),
);

Schema

  • BG-0

    Invoice

    1..1


 

llms.txt
EN 16931

XRechnung

Edit on GitHubPrivacyImprint

On this page

Basic UsageInstall the ProfileSetup the ProfileDefine Invoice DataGenerate InvoiceSchema

How is this guide?