The UBL 2.1 format for electronic invoicing lies at the heart of Morocco's DGI reform: for an invoice to be legally valid, it can no longer be a simple PDF. It must be produced in a structured XML format — UBL 2.1 (Universal Business Language) or UN/CEFACT CII (Cross Industry Invoice) — and transmitted to the national Simpl-TVA platform before being sent to the customer. This format requirement is not a minor technical detail: it is the backbone of the obligation, the factor that determines whether your invoicing software is genuinely compliant or not. This guide explains what UBL 2.1 format actually is, why PDF is excluded, which fields are mandatory (ICE, IF, VAT breakdown, invoice lines), and what your software must be able to do so that your invoices pass DGI validation without being blocked. For a general introduction to the reform, see our pillar article on electronic invoicing in Morocco 2026 (/blog/facturation-electronique-maroc-2026). To find out when your company must comply based on your turnover, see our guide on the DGI electronic invoicing calendar (/blog/calendrier-facturation-electronique-maroc-dgi). Always verify your exact obligations on the official DGI portal.
UBL 2.1 and CII formats: what the DGI actually requires
The DGI has adopted two structured XML formats for electronic invoicing in Morocco: UBL 2.1 (Universal Business Language), maintained by OASIS, and UN/CEFACT CII (Cross Industry Invoice), a UN standard. Both formats are used in many countries with mandatory electronic invoicing systems — they provide an interoperable, auditable framework that is fully machine-readable.
In practice, a UBL 2.1 or CII invoice is an XML file in which every piece of information is stored in a predefined tag: the issuer's identifier, the recipient's identifier, the date, amounts, VAT rates, and invoice lines. This structure allows Simpl-TVA — the DGI's validation platform — to read, validate and return each invoice automatically, without human intervention, in seconds. There is no room for proprietary formats, spreadsheets or PDFs: only one of these two XML formats is recognised as a legally valid electronic invoice.
- UBL 2.1 and UN/CEFACT CII are the only two formats accepted by the DGI.
- These are international XML standards, machine-readable and interoperable.
- Simpl-TVA automatically parses and validates the XML file submitted.
- Any other format (PDF, Word, Excel, CSV, proprietary format) is rejected as non-compliant.
- Your software can adopt either of these two formats depending on what it supports.
Why PDF alone is excluded from the DGI reform
PDF is currently the most widely used format for invoices, but it does not meet the DGI reform's requirement. The reason is fundamental: a PDF is a visual document, readable by a human, but not structured in a way that allows automatic verification by a tax platform. Simpl-TVA cannot 'read' a PDF the way it reads an XML file: it cannot automatically extract the VAT amount by rate, the recipient's ICE, or the total for each line.
The model chosen by the DGI — known as 'clearance' or continuous monitoring — requires each invoice to be transmitted and validated BEFORE it is legally enforceable. For this automatic validation, only a structured XML file works. A PDF, even accompanied by an electronic signature, does not constitute a compliant electronic invoice under the reform. If your software only generates PDFs, it must either be updated to produce native XML, or be replaced by a compliant tool before your obligation start date.
- PDF is a visual format: Simpl-TVA cannot validate it automatically.
- Even an electronically signed PDF is not recognised as a DGI-compliant invoice.
- Compliance requires an XML file (UBL 2.1 or CII), submitted and validated by Simpl-TVA.
- Issuing a PDF invoice after your obligation date exposes you to a 500 DH fine per invoice.
- Loss of VAT deduction rights is planned from 2027 for non-compliant invoices.
Mandatory fields for the DGI electronic invoice
The XML format alone is not enough: the file must also contain all the fields required by the DGI. Some of these are specific to the Moroccan context and are often missing from software not designed for this market.
The mandatory fields under the reform are: the ICE (Common Enterprise Identifier) of both the issuer AND the recipient — its absence triggers an immediate Simpl-TVA rejection; the IF (Tax Identifier) of the issuer; the VAT breakdown by rate with the taxable bases for each applicable rate (a single global VAT line is insufficient when multiple rates apply); and detailed invoice lines with description, quantity, unit price and line amount. The absence or incorrect formatting of any one of these fields in the XML file causes automatic rejection, making the invoice legally void.
- Issuer ICE: common enterprise identifier of the company issuing the invoice — blocking field.
- Recipient ICE: common enterprise identifier of the customer (B2B) — blocking field.
- IF (Tax Identifier): tax identification number of the issuer.
- VAT breakdown by rate: VAT amount and taxable base for each applicable rate.
- Invoice lines: description, quantity, unit price and amount per line.
- Issue date, unique invoice number and currency are also required.
B2B, B2G and B2C scope: who is affected and when
The DGI reform does not apply to all transactions simultaneously. In the first phase, it targets B2B transactions (between businesses) and B2G transactions (to the public sector). B2C — sales to individuals — will be included in a later phase, the details of which will be specified by the DGI. Focus first on bringing your inter-business invoicing flows into compliance.
The progressive timetable by turnover (to be confirmed with the DGI) provides for: large companies (turnover > 200 million DH) and public sector suppliers since 1 January 2026; mid-sized companies (turnover between 10 and 200 million DH) since 1 July 2026; SMEs/VSEs (turnover < 10 million DH) and self-employed individuals with turnover exceeding 500,000 DH from 1 January 2027. For a detailed analysis of the timetable and thresholds, see our dedicated guide (/blog/calendrier-facturation-electronique-maroc-dgi). Always verify your situation on the official DGI portal.
- B2B and B2G first: flows between businesses and to the public sector are the first in scope.
- January 2026: large companies (turnover > 200 M DH) and public sector suppliers.
- July 2026: mid-sized companies (turnover 10–200 M DH).
- January 2027: SMEs/VSEs (turnover < 10 M DH) and self-employed individuals > 500,000 DH.
- B2C: included in a later phase, modalities to be confirmed by the DGI.
What your software must do to pass Simpl-TVA
Knowing that UBL 2.1 is required is one thing; verifying that your software can produce and submit it is another. A compliant software solution must: natively generate an XML file in UBL 2.1 or CII format from your invoicing data, without external conversion; automatically populate ICE and IF fields from client records, validating them at data entry; structure VAT by rate with taxable bases for each line; transmit this file to Simpl-TVA via a secure connection and receive the validation status or rejection message in real time; and retain a timestamped record of each exchange (DGI validation number, signed file returned) for regulatory archiving.
Software that merely adds an 'Export XML' button alongside its PDF output does not meet this requirement: end-to-end integration is needed, from the client master to the file returned signed by the DGI. To evaluate market offerings and choose the right software, see our dedicated guide (/blog/logiciel-facturation-conforme-dgi-maroc).
- Native generation of UBL 2.1 or CII files without external conversion tools.
- Automatic population and validation of ICE and IF from client master records.
- Secure transmission to Simpl-TVA and real-time receipt of validation status.
- Timestamped archiving of the signed file returned by the DGI for each invoice.
- Tracking dashboard: validated, pending and rejected invoices with rejection reason.
Crystal ERP: the UBL 2.1 solution for Moroccan businesses
Crystal ERP (erp.crystalit.ma) is the SaaS ERP developed and maintained by CRYSTAL IT, based in Rabat with more than 20 years of experience in management software for Moroccan companies. It is designed to natively generate the UBL 2.1 files required by the DGI, automatically populate ICE and IF from client and supplier records, and submit each invoice to Simpl-TVA without manual intervention.
Crystal ERP integrates electronic invoicing into a complete management flow — quotes, orders, deliveries, accounting — so that every invoice issued is structured, complete and transmitted to the DGI in a single operation. Simpl-TVA validation statuses are tracked in real time, and signed files are archived automatically. As a SaaS solution, Crystal ERP integrates DGI regulatory updates without any action on your part — you stay compliant with every update. For an overview of the reform and the clearance model, see our pillar article on electronic invoicing in Morocco 2026 (/blog/facturation-electronique-maroc-2026).
UBL 2.1 (or UN/CEFACT CII) format is the technical key to compliance with the DGI reform: without a structured XML file containing ICE/IF fields and a VAT breakdown by rate, your invoice cannot be validated by Simpl-TVA and has no legal value under the reform. PDF alone is definitively excluded. To be compliant, your software must generate these formats natively, submit each invoice to Simpl-TVA and archive the signed file returned. Crystal ERP (erp.crystalit.ma), CRYSTAL IT's SaaS solution based in Rabat, meets these requirements end to end — UBL 2.1 generation, Simpl-TVA submission, automatic archiving. Whatever your obligation wave — January 2026, July 2026 or January 2027 — the right time to secure your compliance is now. Verify your exact obligations on the official DGI portal and contact the CRYSTAL IT team for a personalised demonstration.
Have a project or a question? Let's talk with a CRYSTAL IT expert.
Request a demo

