E-Invoicing in Morocco in 2026: The Definitive Guide to DGI Compliance with EFact

The essentials in 30 seconds. Electronic invoicing is progressively becoming mandatory in Morocco starting in 2026 under the governance of the DGI (Direction Générale des Impôts, Morocco's tax authority). The Kingdom has adopted the clearance model: each invoice must be validated upstream by the national platform before being delivered to the buyer. Rollout begins with large enterprises, then expands to mid-caps, SMEs, micro-enterprises, and auto-entrepreneurs. The detailed calendar and definitive thresholds remain subject to the publication of the implementing decree in the Bulletin Officiel (Morocco's official gazette), which is currently under review. EFact enables seamless compliance without disrupting your existing invoicing operations.
Introduction: A Silent but Profound Tax Revolution
Morocco is embarking on one of the most structural milestones of its digital tax transformation. Driven by Article 145-IX of the General Tax Code (CGI), paper invoices and plain PDFs sent by email are set to disappear in favor of structured digital documents, audited and tracked end-to-end by the tax administration.
For business leaders, chief financial officers, and chartered accountants, the question is no longer whether the reform will take place, but how to prepare effectively before the deadline applies to their organization. Behind the regulatory obligation lies a genuine opportunity: automating invoicing workflows, increasing accounting reliability, accelerating receivables, and permanently reducing processing costs.
This comprehensive, up-to-date guide breaks down the legal framework, how the clearance model works, the rollout timeline, technical requirements, non-compliance risks, and how EFact helps you turn a regulatory mandate into a competitive advantage.
1. Digital Invoices vs. Electronic Invoices: Clearing up the Confusion
Confusion is frequent. Many businesses mistakenly assume that a PDF file generated from an ERP or billing tool and emailed to a client constitutes an electronic invoice. In the eyes of the DGI, it does not.
A compliant electronic invoice must satisfy three cumulative, non-negotiable requirements:
- A structured, machine-readable format. The document is encoded in a standardized syntax (XML adhering to the UBL 2.1 or CII standard), enabling tax administration servers to automatically ingest, interpret, and validate every line of invoice data.
- Guaranteed authenticity and integrity. The invoice receives a qualified electronic signature authenticating the identity of the issuer and proving that no data has been altered after issuance.
- Full end-to-end traceability. Every invoice is registered with the national platform, which assigns it a unique identifier. This official clearance validation is what gives the invoice its legal standing.
Key takeaway: A scanned invoice, a photo, a standard PDF, or even a digitally signed PDF is not an electronic invoice under Moroccan tax regulations. Only natively structured XML formats are legally recognized.
2. The Legal and Regulatory Framework in Morocco
The Legal Foundation: Article 145-IX of the CGI
The legal cornerstone of the reform rests on Article 145-IX of the General Tax Code (CGI). This provision requires taxpayers to implement an electronic invoicing computer system conforming to technical criteria established by the tax administration, leaving the precise modalities of implementation to regulatory decree.
This project is not brand new. Its foundations date back to the 2018 Finance Law, which introduced the initial legal baseline into Article 145-IX. The 2024 Finance Law subsequently provided the operational impetus for widespread nationwide deployment.
Status as of mid-2026: The draft implementing decree has been transmitted to the General Secretariat of the Government, but no text has yet been published in the Bulletin Officiel (Morocco's official gazette). The Director General of the DGI publicly confirmed that the launch will take place during 2026, starting with large enterprises on B2B transactions.
Key Institutional Stakeholders
Several institutional bodies govern and execute the rollout:
- The DGI (tax.gov.ma): Project authority that establishes standards, operates the national validation platform, and supervises tax compliance.
- The Ministry of Economy and Finance: Strategic oversight and policy direction for the reform.
- The ANRT (National Telecommunications Regulatory Agency): Regulates electronic signatures and licenses trust service providers under Law 43-20.
- xHub: Casablanca Technopark technology firm selected as the technology partner to develop Morocco's national electronic invoicing platform.
Who Is Affected?
The mandate will progressively apply to:
- All companies subject to Corporate Income Tax (IS);
- Natural persons subject to professional Income Tax (IR) who maintain regular accounting records;
- Auto-entrepreneurs, according to thresholds that will be specified by decree;
- Public institutions and government bodies, covering B2G transactions.
Targeted documents cover sales invoices, credit notes, corrective invoices, and, in subsequent stages, electronic purchase orders and delivery receipts.
3. The Clearance Model: A Fundamental Paradigm Shift
Clearance vs. Post-Audit
The choice of model lies at the very heart of the reform, profoundly transforming how invoicing operates. Morocco has chosen the clearance model (prior validation), belonging to the Continuous Transaction Controls (CTC) family, known as one of the most rigorous operational models worldwide.
| Traditional Model (Post-Audit) | New Model (Clearance) |
|---|---|
| You issue the invoice and send it directly to the customer. | The invoice is first transmitted to the DGI platform. |
| VAT is reported globally at the end of the tax filing period. | The DGI validates each invoice in real time and assigns it a unique identifier. |
| The tax administration audits records ex-post, often months or years later. | Without prior clearance validation, the invoice has zero legal validity. |
In practice, the tax administration inserts itself directly into the center of every transaction. This clearance model provides complete auditability and near-instant anomaly detection.
The Complete Lifecycle of an Electronic Invoice
- Issuance: Your billing software or ERP generates the invoice in a structured format (UBL 2.1 or CII).
- Transmission: The invoice is automatically dispatched to the national platform via a secure API interface.
- Clearance validation: The platform verifies file structure, mandatory fields, electronic signature, and tax arithmetic. Upon successful validation, it issues a DGI validation (visa fiscal), a unique identifier, and an official QR code.
- Delivery: The cleared invoice is delivered to the customer along with its official validation QR code.
- Legal archiving: The document is securely stored for the mandatory retention period.

The National Platform
Developed by xHub under DGI supervision, the platform is built on a microservices architecture engineered to absorb high transaction volumes in real time and guarantee interoperability with enterprise information systems. Multiple connectivity channels are planned: REST APIs or EDI for ERP-equipped enterprises, a web portal for small businesses, and intermediation via authorized invoicing service providers.
4. Rollout Timeline: When Does Your Business Need to Comply?
The rollout is intentionally progressive, granting each business segment time to adapt according to its size and digital readiness. The principle of starting with large corporations before expanding to mid-caps, SMEs, and micro-enterprises has been confirmed by the DGI.
| Indicative Timeline | Target Businesses |
|---|---|
| 2026 | Large corporations and public sector suppliers. They represent the primary entry point due to established digital infrastructure. |
| Subsequent Waves | Mid-caps, followed by SMEs, micro-enterprises, and auto-entrepreneurs, based on revenue thresholds established by decree. |
| Later Phase | Progressive onboarding of B2C transactions (sales to private individuals), following consolidation of B2B flows. |
Important clarification: Many online publications present specific rollout dates and revenue thresholds as definitive facts. As of today, these remain indicative targets announced by officials but not yet enacted by an implementing decree published in the Bulletin Officiel (Morocco's official gazette). The official schedule will be formalized by the decree currently under review. EFact will update this article as soon as it is enacted.
One critical factor is frequently overlooked: even if your company's obligation to issue electronic invoices occurs in a later wave, you will almost certainly need to be capable of receiving and processing electronic invoices starting in 2026, as soon as your suppliers or enterprise customers belong to wave one. Waiting on the sidelines is not a viable strategy for any business.
5. Technical Requirements: Formats, Signatures, and Legal Archiving
Mandatory Structured Formats
The DGI recognizes two standardized syntaxes:
- UBL 2.1 (Universal Business Language): An XML standard published by OASIS, widely adopted globally and across the European Union. It is the primary format favored by the Moroccan platform.
- CII (Cross-Industry Invoice): An XML standard created by UN/CEFACT, ensuring broad international supply-chain interoperability.
Mandatory Invoice Mentions
Every electronic invoice must contain the mandatory data elements required by the CGI, supplemented by fields specific to digital clearance workflows:
- IF (Identifiant Fiscal, tax ID) of both issuer and recipient;
- ICE (Identifiant Commun de l'Entreprise, the 15-digit Moroccan company ID) for both seller and buyer in B2B transactions;
- Business tax number (numéro de taxe professionnelle);
- Issue date and uninterrupted sequential numbering without gaps or duplicates;
- Precise description of goods supplied or services performed;
- Net total excluding tax, applicable VAT rates and total VAT amount, and total gross amount including all taxes (TTC);
- Payment terms and payment method;
- Unique invoice identifier and official QR code generated by the platform upon clearance validation.
Qualified Electronic Signatures
Every electronic invoice must be sealed with a qualified electronic signature pursuant to Law 43-20 on digital trust services. This electronic signature guarantees authenticity of origin, content integrity, and non-repudiation. Digital certificates must be issued by an authorized trust service provider.
Legal Archiving
Invoices must be securely stored for at least 10 years in compliance with Moroccan commercial and tax law. Legal archiving must guarantee content integrity, continuous accessibility, human readability, secure timestamping, and fast export in an auditable format during a tax inspection. Businesses may utilize dedicated on-premise storage, secure cloud archives, or an authorized dematerialization provider.
Need expert guidance? EFact compliance specialists evaluate your current readiness. Book your compliance audit today.
6. Impact on Accounting and Internal Workflows
The reform is far more than a file format migration: it transforms accounting operations. Manual data entry for supplier invoices gives way to automatic structured data ingestion, with accounting entries generated directly from incoming XML files.
Tangible operational benefits are substantial: streamlined bank reconciliations linking payments directly to cleared invoices, potentially pre-filled VAT declarations based on transaction records already verified by the DGI, and a robust reliable audit trail as required by the Moroccan General Accounting Standards (CGNC).
This operational transition also requires updating the accounting procedures manual, redefining internal validation routes, and upskilling finance and administration teams.
7. How to Choose Your E-Invoicing Solution
Selecting an e-invoicing solution is a strategic architectural decision. Several essential criteria should guide your evaluation:
- DGI compliance readiness: The solution must fully support UBL 2.1 and CII formats and align with national platform technical specifications.
- Integration capabilities: It must connect smoothly to your ERP, accounting software, or CRM, ideally via modern open APIs (see our guide on ERP e-invoicing integration in Morocco).
- Scalability: It must handle growing invoice volumes and support upcoming document types as the mandate expands.
- Security and hosting: Prioritize encrypted, highly available infrastructure with robust backups adhering to Moroccan data protection standards.
- Local support: Responsive technical assistance available in English, French, and Arabic is essential for uninterrupted business operations.
- Total cost of ownership: Assess the complete financial model over several years, including onboarding, API maintenance, and support (explore our clear pricing plans).
Three main software architectures coexist: cloud SaaS platforms, rapid to deploy and ideal for SMEs and micro-enterprises; on-premise deployments, suited for large corporations with strict private infrastructure requirements; and the basic public web portal, suitable for very low transaction volumes. Authorized dematerialization providers represent a fourth path for businesses preferring a fully outsourced operational model.
8. Penalties and Non-Compliance Risks
Key takeaway: No statutory penalty schedule specifically dedicated to electronic invoicing has been published yet. Article 145-IX of the CGI delegates enforcement mechanisms to the forthcoming implementing decree. In the meantime, general sanctions of the General Tax Code concerning invoicing irregularities and accounting non-compliance remain fully enforceable.
The primary business and financial risks identified include:
- Loss of VAT deductibility: This constitutes by far the most severe financial risk. If regulations recognize only clearance-validated invoices as legally valid proof of expenditure, a non-compliant invoice could cause your buyer to forfeit their right to deduct input VAT. The resulting commercial dispute and financial penalty could far exceed any direct administrative fine.
- Market exclusion: Enterprise clients who have achieved compliance will swiftly require compliant electronic invoicing from all vendors. Failing to comply risks losing contracts and vendor qualifications.
- Targeted tax inspections: With real-time access to transaction records, the DGI can immediately spot bookkeeping inconsistencies, significantly facilitating targeted tax audits.
Faced with these regulatory stakes, proactive preparation remains the safest strategy: planning early enables an orderly transition without operational disruption.
9. How EFact Simplifies Your Compliance Journey
Adapting an enterprise information system to manage cryptography, generate standardized XML payloads, and communicate in real time with tax clearance infrastructure is a demanding, costly engineering initiative. We built EFact specifically to remove that technical burden.
EFact acts as an intelligent, seamless bridge between your existing billing tools and the clearance workflow. For your teams, day-to-day operations remain identical: you continue generating invoices just as you do today. In the background, EFact orchestrates the entire compliance cycle:
- Automatic conversion into the UBL 2.1 or CII XML format mandated by the DGI;
- Application of qualified electronic signatures conforming to Law 43-20;
- Secure transmission through clearance validation (tested against the EFact DGI simulator while national platform access prepares to open) and retrieval of the DGI validation (visa fiscal);
- Embedding the official validation QR code and unique invoice identifier onto the final invoice;
- Compliant 10-year legal archiving, instantly retrievable during tax audits.
Our engineering and regulatory team continuously monitors updates from the DGI and xHub, ensuring your compliance remains fully up to date without internal engineering overhead.
Prepare for the Reform and Secure Your Business Continuity
Test the EFact Sandbox today and discover how straightforward DGI compliance can be. Try the Sandbox or talk to an expert.
10. Six-Step Preparation Checklist
- Audit your existing setup: Map annual invoice volumes, invoicing software, validation workflows, and legal archiving methods, and verify that all clients and suppliers possess a valid 15-digit ICE.
- Select your technical solution: Compare cloud SaaS, on-premise, and portal approaches, verifying DGI compliance readiness and native compatibility with your accounting environment.
- Execute technical onboarding: Configure software connectors, test transmission against the EFact DGI simulator, procure qualified electronic signature certificates from an accredited provider, and run end-to-end test transmissions.
- Adapt organizational processes: Update the accounting procedures manual, redefine validation chains, and notify clients and suppliers of upcoming format changes.
- Train teams and leadership: Upskill billing, finance, and accounting personnel on XML clearance workflows, align executive management, and designate an internal compliance lead.
- Launch and monitor: Transition to production clearance workflows, monitor clearance rejection logs, track key performance indicators on a compliance dashboard, and schedule regular compliance reviews.
Conclusion
Electronic invoicing in Morocco is not merely a change of format: it is an overarching transformation of commercial relationships, accounting workflows, and fiscal transparency between businesses and the tax administration. Organizations that proactively prepare will emerge ahead, enjoying smoother operations, improved working capital control, and impeccable compliance.
At EFact, we transform this regulatory obligation into an operational advantage. From initial audit to post-deployment monitoring, our platform and compliance specialists support you at every phase. Do not postpone your transition: start your compliance journey with us today.
Frequently Asked Questions
When does electronic invoicing become mandatory in Morocco?
Article 145-IX of the General Tax Code (CGI) establishes the legal mandate. The rollout is announced for 2026, beginning with large enterprises. The definitive calendar and revenue thresholds will be established by the implementing decree currently under review for publication in the Bulletin Officiel.
Is a digitally signed PDF a valid electronic invoice?
No. A PDF file, even electronically signed, is not a structured format. Only standardized XML formats (UBL 2.1 and CII) enable automated machine validation by the DGI clearance platform and fulfill regulatory requirements.
Which businesses are affected by the mandate?
Eventually, all businesses subject to tax in Morocco. The rollout will proceed in successive waves: large corporations first on B2B transactions, followed by SMEs, micro-enterprises, and auto-entrepreneurs, with B2C transactions following in a subsequent phase.
How can businesses prepare effectively?
Conduct an initial readiness audit, choose a compliant solution like EFact, acquire qualified electronic signature certificates, upskill your accounting teams, and test transmissions in advance. Our free sandbox lets you simulate invoice generation and clearance risk-free.
What are the risks of non-compliance?
While a specific e-invoicing penalty schedule has not yet been enacted, non-compliant invoices risk outright rejection by the DGI, directly causing the buyer to lose their right to deduct input VAT. This commercial and tax exposure far exceeds standard statutory fines. Full terms will be defined in the implementing decree.
Sources and references: General Tax Code (Article 145-IX), 2018 Finance Law, 2024 Finance Law, Law 43-20 on digital trust services, and official communications from the Direction Générale des Impôts (DGI). This guide will be updated immediately upon publication of the implementing decree in the Bulletin Officiel.
Related topics
The 12 Technical Requirements Imposed by the DGI for E-Invoicing in Morocco in 2026
The 12 technical requirements for DGI e-invoicing in Morocco in 2026: UBL 2.1, clearance model, XAdES signature, and legal archiving. Free sandbox.
Morocco ERP E-Invoicing: Making Your ERP DGI-Compliant
Make your ERP (Odoo, SAP, Sage, Dynamics) DGI-compliant for Morocco e-invoicing without replacing it: REST API, UBL 2.1, and signature. Free sandbox.