Electronic invoicing in Morocco: 9 decisions before adapting your software
Nine decisions for preparing data, numbering, APIs, rejection handling, archives, and testing without inventing an e-invoicing timetable.
Electronic invoicing in Morocco should not be approached by rushing to buy software marketed as “DGI compliant.” As of 16 November 2026, the official sources reviewed do not publish an enforceable rollout calendar, thresholds, or a complete technical specification. Current invoicing duties still apply, and companies can prepare data, controls, and integrations without betting on an unconfirmed date or format.
This guide sets out nine decisions before adapting an ERP, CRM, business application, or SaaS platform. It is not a substitute for advice from your accountant, tax adviser, or the authorities.
Electronic invoicing in Morocco: what is official on 16 November 2026?
Morocco’s General Tax Code published by the DGI already defines invoicing duties. Article 145 covers continuous numbering and information including seller identity, tax identifier, date, customer identity, goods or services, prices, VAT, and payment references. The common enterprise identifier, ICE, is also required on invoices or equivalent documents where applicable.
The article also provides for a computerised invoicing system whose technical criteria are to be determined by the administration and whose implementation depends on regulatory rules. In January 2019, the Ministry of Economy and Finance officially stated that the measures would only take effect after the decree was published, and then announced their suspension pending consultation.
In April 2026, the Director General of Taxes reportedly described a progressive rollout being prepared, starting with B2B and large companies. This reported direction does not replace published law. Our 16 November 2026 search of public DGI and General Secretariat of Government resources did not identify an implementing decree, quantified calendar, or official technical specification. This is a dated search finding, not a guarantee about the future.
What is certain, announced, or still unknown?
- Certain: existing Tax Code rules on invoice content and numbering apply according to the taxpayer’s situation.
- Announced: a progressive rollout and national platform were publicly discussed by DGI leadership in 2026.
- Unknown on 16 November 2026: enforceable dates, thresholds, exact populations, final format, signature rules, exchange protocol, response times, providers, and approval procedures.
Treat precise calendars or penalties without a direct official source as unverified. Useful preparation makes systems adaptable instead of coding assumptions as law.
9 decisions before adapting your software
1. Who owns regulatory monitoring and production approval?
Assign a business owner and tax lead. They should retain each source, date, and version, and separate published obligations from announcements and vendor interpretations. Define who can approve a format change or activate transmission to an external platform.
The decision register should contain the official source, affected population, effective date, software impact, test scenario, and approval evidence. This prevents a screenshot or copied timetable from becoming a rule in code.
2. Which entities and invoice flows are in scope?
Map legal entities, establishments, tax regimes, sales channels, currencies, and customer types. Separate B2B, B2C, export, credit notes, deposits, recurring invoices, self-billing, and sector-specific cases. A future regime may not treat every flow identically.
For each flow, identify the system that creates the invoice, calculates tax, collects payment, and posts accounting entries. This map shows where controls belong and prevents multiple numbers for the same transaction.
3. Are customer and tax data reliable?
A structured invoice turns a data-entry error into an automated rejection. Maintain a master record for sellers and business customers: legal name, address, ICE, tax identifiers, regime, currency, terms, and payment methods. Define each field’s source, owner, and validation rule.
Measure missing fields, duplicates, and unverified identifiers before connecting an API. Our guide to data quality in Morocco provides a reusable control method.
4. How will numbering, versions, and corrections work?
Document when a draft becomes an issued invoice, how its number is created, who can change it, and how cancellation is handled. An issued invoice should not be silently rewritten; use the appropriate accounting correction, such as a credit note, after validation by your advisers.
Maintain links between order, delivery, invoice, credit note, payment, and accounting entry. Test collisions, retries after failure, double clicks, and concurrent imports. Idempotency should prevent one operation from creating two invoices.
5. Which internal data model will survive a specification change?
Do not encode the business directly into an assumed external format. Define a canonical internal model for headers, parties, lines, taxes, totals, references, and payments. Add an adapter to the official format when it is published.
OASIS UBL illustrates a machine-readable structured invoice model, but its existence does not prove that it will be Morocco’s final format. Keep codes, versions, and validation rules configurable.
6. Where should integration live: ERP, middleware, or specialist service?
Common options are upgrading each source system, centralising exchange in middleware, or using an external service. Compare them by system count, volume, tax responsibility, security, reversibility, operating cost, and ability to track changes.
The API contract should cover authentication, versioning, limits, timeouts, errors, retries, idempotency, webhooks, and degraded operation. Do not send real invoices until the destination, authority, and protocol are officially confirmed. See our API integration in Morocco guide.
7. How will validation, rejection, outages, and recovery be handled?
Model explicit states such as draft, ready, submitted, accepted, rejected, correction required, cancelled, and archived. The final list depends on the official protocol, but traceable state is already useful. Each transition should retain actor, timestamp, version, and technical response.
Prepare a retry queue, attempt limits, alerts, and a human procedure. A platform, network, or ERP outage must not lose an invoice or create a duplicate. Any fallback mode needs a documented and legally validated rule.
8. Which evidence, archives, and personal data should be retained?
Determine what must be retained: readable invoice, structured data, platform response, transmission logs, any signature, credit notes, and payment evidence. Duration, media, and access controls should follow the rules applicable to your organisation.
Invoices may include personal data. Morocco’s CNDP highlights purpose, proportionality, quality, and security under Law 09-08. Minimise data, protect API secrets, and audit administrative access. Electronic invoicing and electronic signatures are related but distinct; do not assume a signature level before applicable rules are published.
9. How will you test and deploy without blocking invoicing?
Build anonymised test cases for a valid customer, missing identifier, exemption, multiple rates, discount, deposit, credit note, currency, rounding, duplicate, outage, and recovery. Reconcile totals across the business system, structured file, readable rendering, and accounting.
Start in simulation or parallel mode with daily reconciliation. Train invoicing, accounting, support, and IT teams on states and procedures. Production activation should depend on official rules, successful tests, and formal approval—not a date copied from a vendor page.
Expected preparation package
- inventory of entities, regimes, flows, and source systems;
- mandatory-data matrix with source, owner, and control;
- numbering, issuance, correction, credit-note, and cancellation rules;
- canonical invoice model and versioning strategy;
- integration architecture, API contract, and reversibility;
- state machine, rejection handling, and recovery procedure;
- access, logging, archiving, and data-protection policy;
- test pack, accounting reconciliation, and production criteria;
- regulatory register marking what is official and what remains unknown.
Mistakes to avoid
- Confusing a PDF with structured exchange: a readable file is not automatically machine-processable data.
- Promising future compliance: without a published specification, you can prepare adaptability, not certify the final result.
- Coding an unpublished calendar: keep dates and thresholds in governed configuration.
- Cleaning data after integration: identifiers, taxes, and totals need controls first.
- Ignoring credit notes and incidents: the happy path is not enough for operations.
- Accepting vendor lock-in: require exports, logs, and exit documentation.
FAQ about electronic invoicing in Morocco
Is electronic invoicing mandatory in Morocco on 16 November 2026?
The official sources reviewed on that date did not reveal the implementing decree, calendar, or technical specification. Existing Tax Code duties still apply. Recheck DGI and the Official Bulletin because the position can change after publication.
Is an emailed PDF a structured electronic invoice?
No. A PDF is primarily human-readable; a structured invoice contains machine-interpretable fields. A PDF’s current validity depends on applicable invoicing rules, while the future technical regime remains to be confirmed.
Must we replace our ERP?
Not necessarily. An ERP can be upgraded directly or connected through an integration layer. The decision depends on data quality, APIs, source systems, and the ability to manage states, corrections, and exports.
Can we choose an XML format now?
You can prepare an internal model and test standards, but isolate the adapter. Do not present any format as definitively required in Morocco without a published official specification.
Where should an SME start?
Start with current duties: reliable customer data, ICE where required, continuous numbering, controlled taxes and totals, archiving, and reconciliation. Then map systems and prepare a testable structured export.
Sources and verification status
- DGI — General Tax Code, accessed 16 November 2026.
- Ministry of Economy and Finance — clarification of 8 January 2019.
- Ministry of Economy and Finance — suspension announced 15 January 2019.
- General Secretariat of Government — legislation and Official Bulletins, checked 16 November 2026.
- CNDP — Personal data processing in Morocco, accessed 16 November 2026.
Prepare integration without freezing the unknown
Kanteek automates financial processes and connects ERP, CRM, and business applications. We can audit invoice data, define a canonical model, build controls, and prepare a versioned integration without claiming knowledge of unpublished specifications. Explore our Automation service or contact us with your current systems and flows.
