Basic
This profile includes BASIC WL with some details at line level. It is a subset of EN 16931, which contains all mandatory fields including those on which business rules from the EN 16931 may apply. It is a compliant CIUS (Core Invoice Usage Specification), which means that all business rules of the EN 16931 apply.
Basic Usage
Install the Profile
npm install @node-zugferd/basic@betaSetup the Profile
Register the profile when creating your zugferd instance:
import { basic } from "@node-zugferd/basic";
import { zugferd } from "node-zugferd";
export const invoicer = zugferd({
profiles: [basic],
});Define Invoice Data
Provide invoice data that satisfies the requirements of this profile.
import type { invoicer } from "@/lib/invoicer";
const data: typeof invoicer.$Infer.Input.Basic = {
exchangedDocument: {
invoiceNumber: "471102",
// ...
},
// ...
};Generate Invoice
Create the invoice and embed it into a PDF/A document or serialize it for further processing.
import { invoicer } from "@/lib/invoicer";
import { data } from "./data";
import { readFile } from "node:fs/promises";
const invoice = await invoicer.create("basic", data);
const xml = invoice.toXML();
const pdfA = await invoice.toPDF(
await readFile("./my-invoice.pdf"),
);