1. Home
  2. UAE E-Invoicing Hub
  3. Custom ERP & Integration

Custom ERP & Integration

Connecting a Java or Spring ERP to UAE E-Invoicing

Java has the most mature Peppol tooling of any ecosystem. The pieces exist; here is how they fit for the UAE profile.

SZ
Sahil ZainiCRM & ERP Development
·2026-11-24·3 min read
Updated 24 Nov 2026 · checked against MoF Guidelines v2.0

Java teams can generate PINT AE documents with JAXB bindings for UBL 2.1, validate them with the open-source ph-schematron library against the published UAE rule sets, submit them to an Accredited Service Provider through a Spring-managed client with resilience4j retries, and guarantee delivery with a transactional outbox. The same ph-ubl and ph-schematron components underpin several Peppol access-point implementations, which makes them a safe foundation.

Key facts at a glance

  • UBL binding: ph-ubl (JAXB classes for UBL 2.1).
  • Validation: ph-schematron with the PINT AE rule sets; XSD via JAXP.
  • Reliability: transactional outbox + scheduled dispatcher; resilience4j retry and circuit breaker.
  • Provider isolation: AspGateway interface with one implementation per ASP.
  • Status: webhook endpoint plus polling for documents lacking a terminal state.

Generation with JAXB

InvoiceType inv = new InvoiceType();
inv.setID(new IDType(invoice.getNumber()));
inv.setIssueDate(new IssueDateType(invoice.getIssuedOn()));
inv.setInvoiceTypeCode(new InvoiceTypeCodeType("380"));
inv.setDocumentCurrencyCode(new DocumentCurrencyCodeType("AED"));
inv.setAccountingSupplierParty(PartyMapper.supplier(company));  // EndpointID schemeID="0235"
inv.setAccountingCustomerParty(PartyMapper.customer(customer));
inv.getInvoiceLine().addAll(LineMapper.map(invoice.getLines()));
TotalsCalculator.apply(inv);                                    // single arithmetic authority
String xml = UBL21Marshaller.invoice().getAsString(inv);

Validation

ISchematronResource sch = SchematronResourcePure.fromFile("pint-ae.sch");
SchematronOutputType out = sch.applySchematronValidationToSVRL(new StreamSource(new StringReader(xml)));
List<String> fatal = SVRLHelper.getAllFailedAssertions(out).stream()
    .filter(a -> "fatal".equalsIgnoreCase(a.getFlag()))
    .map(a -> a.getID() + ": " + a.getText()).toList();

Load and cache the compiled schematron at startup. Run XSD validation first so schema errors are reported clearly rather than as cascades of assertion failures.

Outbox and dispatch

When an invoice is finalised, insert the XML and metadata into an einvoice_outbox table in the same transaction as the ERP posting. A scheduled dispatcher claims rows, submits through the AspGateway, and records the provider reference and acknowledgement. Failures leave the row for retry with back-off; a circuit breaker pauses dispatch during a provider outage so that the queue simply grows and drains later, which is exactly the behaviour the two-business-day failure rule assumes.

Operational wiring

ComponentSpring mechanism
Provider config@ConfigurationProperties per ASP; secrets via Vault or environment
Retriesresilience4j @Retry and @CircuitBreaker on the gateway
Webhooks@RestController with signature verification; idempotent handlers
MetricsMicrometer counters for submitted/accepted/rejected; gauge for outbox age
ArchiveS3-compatible store with object lock; SHA-256 recorded in DB

Where Zaini Developers fits in

Whether your core is Java, PHP or .NET, we deliver the compliance layer as a separately deployable service with a documented contract, and we can hand the code to your team or run it for you.

Book a free consultation →

Frequently asked questions

Are ph-ubl and ph-schematron free to use?

Yes, they are open source under permissive licences; check the current licence terms in each repository.

Can my Java system be its own Peppol access point?

Technically possible, but in the UAE only accredited providers may act as access points. Connect through an ASP.

How do I handle multiple legal entities?

Carry a tenant identifier (TIN) through the outbox and gateway so each entity's documents use its own provider credentials.

What about Kotlin or Scala?

The same libraries work on any JVM language.

This guide explains published UAE rules in plain language and is not tax or legal advice; confirm your own position with a registered tax adviser. Zaini Developers is not an Accredited Service Provider (ASP); we build and connect systems that transmit through MoF-accredited ASPs. Product names belong to their owners.
Free E-Invoicing Readiness CheckAnswer 8 quick questions and get your score and action plan.
Check my readiness

Let's build together

Need your system e-invoicing ready?
We build and connect it.

We build e-invoicing-ready ERP, CRM and POS systems and connect existing software to UAE e-invoicing.

Chat on WhatsApp