2.2 KiB
2.2 KiB
@fin.cx/einvoice
Source module for the main @fin.cx/einvoice package.
This directory contains the public TypeScript API for loading, validating, converting, and embedding European e-invoice XML.
Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit community.foss.global/. This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a code.foss.global/ account to submit Pull Requests directly.
What this module exports
EInvoicecreateEInvoice()validateXml(xml, level?)FormatDetectorPDFExtractor,PDFEmbedderDecoderFactory,EncoderFactory,ValidatorFactoryBaseDecoder,BaseEncoder,BaseValidatorUBLBase*andCIIBase*extension points- Factur-X and ZUGFeRD format-specific classes
- root types such as
TInvoice,ValidationResult,ExportFormat,IPdf
Main workflow
import { EInvoice, ValidationLevel } from '@fin.cx/einvoice';
const invoice = await EInvoice.fromFile('./invoice.xml');
const validation = await invoice.validate(ValidationLevel.BUSINESS);
const xml = await invoice.exportXml('facturx');
Format support
| Format | Detect | Import | Export | Notes |
|---|---|---|---|---|
ubl |
Yes | Yes | Yes | Generic UBL flow |
xrechnung |
Yes | Yes | Yes | UBL-based profile |
cii |
Yes | Yes | Yes | Generic export currently routes through the Factur-X encoder path |
facturx |
Yes | Yes | Yes | Main CII generation path |
zugferd |
Yes | Yes | Yes | Input supports v1 and v2+ |
fatturapa |
Yes | No | No | Detection only at the moment |
Important implementation notes
peppolis not a root-level XML export target.FatturaPAis not fully implemented for import/export.- PDF support means extracting or embedding XML into existing PDFs, not generating invoice PDFs from scratch.
- Validation is useful and extensive, but should not be documented as blanket certification.
Related directories
../readme.md: full package README for end users../ts_install/readme.md: install-time resource bootstrap module