A direct integration embeds the provider's API calls, PINT AE generation and status handling inside the ERP. A middleware architecture moves those concerns into a separate service that any source system can call. Direct integration is simpler for a single modern ERP with a vendor-supported connector. Middleware is better when there are multiple invoice sources, a legacy ERP, several legal entities, a desire to switch providers freely, or a need for a finance-facing control dashboard independent of the ERP.
Key facts at a glance
- Direct: fewer moving parts; provider logic lives in the ERP.
- Middleware: provider-agnostic, multi-source, multi-entity; one more service to run.
- Either way, the legal document is the PINT AE XML accepted by the provider.
- Middleware simplifies switching ASPs to a configuration change.
- Queue-based designs survive provider outages without data loss.
Reference architecture for middleware
ERP / CRM / POS / billing ──► Intake API (JSON)
│
Validate & enrich (master data, VAT rules)
│
Generate PINT AE XML ──► Local schematron
│
Outbound queue (durable)
│
Provider adapter(s) ──► ASP API ──► Peppol ──► Buyer ASP
│ └──► Corner 5 (FTA)
Status tracker (webhooks / polling)
│
Archive (XML, responses, PDF) + Finance dashboard
When direct integration is enough
One modern cloud ERP, a vendor-supported connector to a provider you are happy to stay with, a single legal entity, and no other system that issues invoices. In that situation a middleware layer adds operational overhead without much benefit. Make sure the connector exposes status per document and lets you export your archive.
When middleware pays for itself
| Situation | Why middleware helps |
|---|---|
| Several systems issue invoices (ERP, POS, CRM, portal) | One pipeline, one set of rules, one dashboard |
| Legacy or heavily customised ERP | No invasive changes; ERP exports data, middleware does the rest |
| Multiple TINs or group entities | Per-entity provider connections and identifiers in configuration |
| Provider uncertainty | Swap adapters without touching source systems |
| Strict controls | Release approvals, segregation of duties and audit logs outside the ERP |
Operating considerations
Middleware must be hosted, monitored and backed up. Keep it small and boring: a database, a queue, a worker, an API and a web UI. Avoid putting business logic in it that belongs in the ERP; its job is compliance transformation, transmission and evidence. Document the interface contract with source systems so that ERP upgrades do not silently break it.
Where Zaini Developers fits in
FORMA, our white-label PHP platform, includes this middleware as a module: multi-tenant, provider-agnostic adapters, queue-based submission, status tracking and an archive, already exercised against accredited providers' sandboxes.
Book a free consultation →Frequently asked questions
Is middleware a legal requirement?
No. It is an architectural choice. The legal requirement is a compliant document through an accredited provider.
Does middleware make me an ASP?
No. The provider remains the accredited access point; middleware is part of your own systems.
Can middleware handle inbound invoices too?
Yes, and it should: receive from the provider, validate, match to purchase orders and hand to the purchase ledger.
How much latency does middleware add?
Negligible; seconds at most, dominated by provider validation time.
