einvoice-tsPeppol BIS Billing 3.0 invoices for TypeScript
Parse, build, validate and serialize EN 16931 UBL invoices and credit notes, in Node.js, Bun, Deno and browsers.
Parse, build, validate and serialize EN 16931 UBL invoices and credit notes, in Node.js, Bun, Deno and browsers.
Build an invoice, write it as UBL XML and validate the XML:
import { createInvoice, serialize, validateXml } from '@facturometro/einvoice';
import { baseInvoice } from '../base.ts';
const invoice = createInvoice(baseInvoice); // defaults applied, totals computed
const xml = serialize(invoice); // UBL 2.1 XML
const result = validateXml(xml); // EN 16931 + Peppol, chosen by the customization id
for (const issue of result.fatal) {
console.error(issue.id, issue.xpath, issue.message);
}baseInvoice is the invoice input of Your first invoice.