Billing

9 min read

Electronic Invoice Format in Morocco: XML, UBL, PDF/A-3

XML, UBL, PDF/A-3: which formats should you use for electronic invoicing in Morocco in 2026? Technical guide with Inyad.

Which Electronic Invoice Format Should Morocco Use?

The electronic invoice format for Morocco standardized by the DGI for 2026 is based on the international UBL 2.1 (Universal Business Language) standard in XML format, accompanied by a human-readable PDF/A-3. This dual format guarantees automated transmission to tax servers as well as 10-year legal archiving.

A PDF alone, even signed, is not enough. The DGI requires structured data that its computer systems can process. Certified software automatically generates compliant XML from an invoice entered by the user.


What Is the UBL Standard and Why Is It Used?

The UBL standard is an international standard maintained by OASIS, adopted by more than 80 tax administrations worldwide, including France (Factur-X), Italy (FatturaPA), and Morocco starting in 2026. It structures every field of an invoice — sender, recipient, lines, taxes, totals, payment — into standardized XML elements.

The advantage of international interoperability: a Moroccan SME exporting to Europe issues the same invoice for its French client and for the Moroccan DGI. The common format avoids multiplying templates and re-entry errors.


How Does the Hybrid PDF/A-3 Work?

The hybrid PDF/A-3 embeds the structured XML inside the visual PDF. The human recipient opens a normal-looking PDF; the machine automatically extracts the XML for accounting processing. This hybrid format, called Factur-X in France, serves as the reference for the Moroccan DGI.

  • Visual PDF: for human reading, can be printed.

  • Embedded XML: structured data for machines.

  • Long-term archiving: guaranteed by the ISO 19005-3 standard.


Which Software Can Generate These Formats?

Certified invoicing software in Morocco in 2026 must natively generate UBL XML and PDF/A-3. Inyad supports both formats starting with version 2025.10. The conversion is automatic: the user enters their invoice as usual, and the software generates the compliant files in the background.

XML validation is crucial: a malformed file will be rejected by DGI servers. Inyad runs 17 automatic checks before issuance (valid ICE, consistent VAT, balanced amounts) to prevent any rejection.


Why Inyad for Your Invoice Formats?

Inyad generates XML UBL 2.1 and PDF/A-3 with no technical setup: merchants don’t need to understand the format at all, the software handles everything. Regulatory updates are deployed automatically with every change to the DGI specification.

Discover our online invoicing, free invoicing software, and quote-to-invoice.

Solutions

Industries

Features

Get a free demo