Dual-jurisdiction e-invoicing integration: ZRA + TRA architecture
Architectural blueprint for real-time invoice submission to both the Zambia Revenue Authority and Tanzania Revenue Authority simultaneously — two different APIs, two certification processes, one unified engine.
Dual
Authorities (ZRA & TRA)
Adapter
Unified Middleware
Queued
Resilient Retries
Audit
Full Event Logging

A unified compliance middleware layer that normalises two divergent tax authority specifications behind a single interface, handling schema validation, payload signing, and queued retries across both jurisdictions.
The challenge
Operating an invoicing system across Zambia and Tanzania requires meeting regulatory mandates to submit all invoices to each national tax authority in real time. ZRA (Zambia Revenue Authority) and TRA (Tanzania Revenue Authority) have fundamentally different API specifications — distinct authentication models, divergent XML/JSON document schemas, varying error code taxonomies, and independent certification procedures.
Our approach
We designed a unified compliance middleware layer using a jurisdiction adapter pattern. This cleanly separates routing logic (determining which jurisdiction applies to a given transaction) from adapter logic (formatting, signing, and submitting to the specific tax authority API). Each jurisdiction adapter manages its own authentication tokens, payload transformations, error mappings, and backoff retries independently.
Technical decisions
The queue and retry architecture is paramount: tax authority APIs can experience intermittent latency or downtime. We designed a persistent submission queue with exponential backoff, dead-letter monitoring, and threshold alerts for pending items. Furthermore, a tamper-evident audit log records every submission payload, authority response, and status change to ensure full compliance verification.
Architecture & Delivery Strategy
The resulting architecture isolates regulatory changes within specific adapter modules so that updates to one jurisdiction do not disrupt others. Dedicated sandbox test suites ensure transactions conform strictly to fiscalisation rules before submission to live endpoints.
Technology stack
This is an illustrative technical scenario. Verified client case studies will be added as engagements are cleared for publication.
Facing a similar architectural challenge?
We would rather understand your specific technical environment before making recommendations. Start with a discovery conversation.