// case study · 2021
Multi-format e-invoice generation & delivery pipeline
A unified EDI generation and delivery system handling six distinct e-invoice formats across multiple EU countries, built to support an expanding client base of UK-based financial services customers.
The problem
Different EU countries mandate different e-invoice formats. A single client sending invoices to Denmark, Sweden, Norway, and Poland needs UBL 2.1, OIOUBL, SVEFAKTURA, and SAF-T PL respectively — each with their own validation rules, delivery endpoints, and acknowledgement flows. Managing this manually was unsustainable.
The approach
Built a format-agnostic core pipeline in Perl that reads a normalised internal invoice object and routes it to format-specific renderers. Each renderer produces the target XML, validates it against the relevant schema, and hands off to the delivery layer. The delivery layer handles EDICOM and Sendys endpoints, SFTP drops, and direct PEPPOL submission depending on the target.
Key decisions
Keeping the pipeline stateless per-invoice made retry logic trivial — any failed delivery can be requeued without side effects. Audit rows are written atomically with delivery attempts, so the trail is always consistent. Format renderers are isolated modules, so adding a new country format doesn't touch the core.
Outcome
System runs in production handling hundreds of invoices daily across six formats and four delivery mechanisms. Zero manual intervention on successful deliveries. Failed deliveries surface in an internal dashboard with enough context to resolve in under five minutes.
Full stack