Skip to content

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.

Quickstart ​

Build an invoice, write it as UBL XML and validate the XML:

ts
import { createInvoice, serialize, validateXml } from 'einvoice-ts';

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.

MIT licensed. Specification material belongs to OpenPeppol, CEN and OASIS (see NOTICE). Peppol is a trademark of OpenPeppol AISBL; this project is not affiliated with it.