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

Custom ERP & Integration

Making a .NET Billing System Compliant With UAE E-Invoicing

Many UAE enterprises run in-house .NET systems. The .NET ecosystem has everything needed for a robust pipeline; the work is in the mapping and the discipline.

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

A .NET application can generate UBL 2.1 documents through a typed object model or templated XML, validate them against the UBL schemas and the PINT AE schematron using an XSLT-based engine, submit them to an Accredited Service Provider through a typed HTTP client with retry policies, and track status in a background hosted service. Keeping the provider behind an interface and using a durable queue (database table, Azure Service Bus or RabbitMQ) gives a system that survives outages and provider changes.

Key facts at a glance

  • Generation: typed UBL classes or Razor/XSLT templates producing UBL 2.1.
  • Validation: XSD via XmlReaderSettings; schematron via compiled XSLT 2/3 (e.g. Saxon-HE) or an ISO schematron library.
  • Submission: IHttpClientFactory + Polly retry/circuit breaker.
  • Background: IHostedService workers for submission and status polling.
  • Configuration: provider endpoints and keys in user secrets / Key Vault.

Domain model to UBL

Define an internal EInvoice aggregate independent of both your ERP tables and the UBL schema: parties with TIN, TRN and structured address; lines with quantity, unit code, price, VAT category and reason; allowances and charges; totals computed by a single calculator. Map ERP entities into this aggregate, then serialise the aggregate to UBL. This isolates the awkward parts of legacy tables from the awkward parts of UBL and gives you one place to compute arithmetic correctly.

Validation pipeline

var settings = new XmlReaderSettings { ValidationType = ValidationType.Schema };
settings.Schemas.Add(null, "UBL-Invoice-2.1.xsd");
// ... read document; collect schema errors

var schematron = SchematronCompiler.Compile("PINT-AE.sch");   // once, at startup
var result = schematron.Validate(xmlDocument);
if (result.FatalAssertions.Any()) return ValidationOutcome.Rejected(result);

Compile the schematron once and cache it; validation per document then takes milliseconds. Run the same pipeline in unit tests against a corpus of scenario documents.

Submission and status

services.AddHttpClient<IAspClient, ChosenAspClient>()
  .AddPolicyHandler(HttpPolicyExtensions.HandleTransientHttpError()
     .WaitAndRetryAsync(5, i => TimeSpan.FromSeconds(Math.Pow(2, i))))
  .AddPolicyHandler(HttpPolicyExtensions.HandleTransientHttpError()
     .CircuitBreakerAsync(5, TimeSpan.FromMinutes(2)));

A hosted service dequeues documents, calls SubmitAsync with the document number as idempotency key, records the response, and a second service polls or receives webhooks for status transitions until a terminal state is reached.

Enterprise concerns

ConcernApproach
Multiple legal entitiesTenant context per TIN; separate provider credentials and queues
Segregation of dutiesAuthorization policies for Create vs Release; approvals for thresholds
ObservabilityStructured logs with document ID; metrics for queue age, rejection rate, time-to-accept
ArchiveBlob storage with immutability policy; hash stored in SQL
Provider changeImplement a second IAspClient; switch by configuration

Where Zaini Developers fits in

We design the compliance layer as a separate service with a clean contract, so your .NET team keeps ownership of the ERP while we deliver and maintain the PINT AE engine, provider adapters and finance dashboard.

Book a free consultation →

Frequently asked questions

Is there an official .NET SDK for UAE e-invoicing?

No official SDK. Providers publish REST APIs; the UBL schemas and PINT AE schematron are public standards you implement against.

Can I run schematron natively in .NET?

Yes, by compiling the schematron to XSLT and executing it with an XSLT 2/3-capable processor, or by using a schematron library.

Should I generate XML with XmlSerializer or templates?

Either works. Typed classes reduce ordering errors; templates are quicker to adjust. Validate both ways in CI.

How do I test without production credentials?

Use the provider's sandbox with test identifiers and a mock IAspClient for unit tests.

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