An API for developers and ERPs.

Morocco e-invoicing API, built for DGI compliance.

Tax compliance infrastructure for the modern Moroccan business. Achieve compliance in a few lines of code, without modifying your existing software.

Supported standards

  • DGISupported clearance model
  • Barid eSignClass 3 signing certificate
  • UBL 2.1Compliant invoice schema

Trusted by

  • gest360.ma
import { EFact } from '@itzenata/efact-node'

const efact = new EFact(process.env.EFACT_SECRET_KEY)

const invoice = await efact.invoices.create({
  invoiceNumber: 'INV-2026-042',
  invoiceDate: '2026-06-19',
  currency: 'MAD',
  buyerIce: '001234567890123',
  buyerName: 'Client SARL',
  lines: [
    { lineNumber: 1, description: 'Consulting services', quantity: 1, unitPrice: 12000, vatRate: 20 }
  ]
})

return Response.json({ id: invoice.id, status: invoice.status })

EFact - an e-invoicing API simple to integrate and strictly compliant with the DGI.

UBL 2.1 Schema

100%

Coverage of the Moroccan invoice schema, including XAdES-EPES signature

High Availability

99.99%

Target availability SLA, even during peak submission periods

Legal Archiving

10 years

Immutable storage for tax and compliance audits

DGI regulatory timeline

The reform is enacted. The timeline is not yet final.

Article 145-IX of the General Tax Code (CGI) establishes electronic invoicing and pre-clearance validation: an invoice not validated by the DGI will no longer grant VAT deduction rights to the buyer. However, effective dates, revenue thresholds, and sanctions remain subject to the publication of the implementing decree in the Bulletin Officiel (Morocco's official gazette). The milestones below are announced targets, not enforceable law.

JAN 2026
announced

Large enterprises (Corporate Tax)

Announced revenue threshold: 200M MAD, plus public procurement (B2G).

JUL 2026
announced

Mid-cap enterprises (ETI)

Announced extension of the mandate to subject mid-size companies.

JAN 2027
next announced wave

SMEs, micro-businesses, auto-entrepreneurs

Announced revenue threshold: 500,000 MAD.

Last reviewed: August 17, 2026. As of this date, no implementing decree has been published in the Bulletin Officiel. Source: Direction Générale des Impôts. We update this section whenever official regulations change.

Clearance pipeline

From JSON to QR code, in under 2 seconds.

The pre-clearance model requires every invoice to be validated by the DGI before gaining legal validity. EFact orchestrates the entire workflow for you.

Invoice cleared
latency 1520 ms / target < 2000 ms
  1. JSON received

    ok

    Valid payload, buyer ICE verified.

  2. UBL 2.1

    ok

    XML conversion, Moroccan VAT calculation.

  3. XAdES signature

    ok

    SHA-256 hash, sealed via Barid eSign.

  4. DGI clearance

    ok

    Pre-clearance check over authenticated channel.

  5. UUID + QR

    cleared

    Legally valid invoice, ready to deliver.

› UUID issued · QR generated · invoice cleared

Three pillars, zero compromise.

The complete stack to move into production without fighting the standard.

JSON to UBL 2.1

Send simple data in standard JSON format. Our engine handles the complex UBL 2.1 structure required by the DGI, verifies the ICE, and computes taxes according to Moroccan law.

Barid eSign Vault

Your Barid eSign certificates are isolated in a secure enclave. XAdES-EPES signing in milliseconds, without ever exposing your private keys.

Guaranteed Transmission

High-availability routing with delivery guarantees. If the DGI platform is unavailable, your invoices are safely queued and replayed automatically. Real-time status notifications upon validation.

Total control with the management dashboard

A single dashboard to pilot everything. Track your invoices, manage API keys, and audit every event from one unified interface.

EFact dashboard overview

Integrate EFact into your stack.

The Node.js SDK is available today. Python, Java, PHP, and .NET are in development.

Node.js
PythonIn development
JavaIn development
PHPIn development
.NETIn development
Questions & Answers

Have questions? We have answers.

Everything you need to know about Morocco DGI 2026 e-invoicing and the EFact API. Have more questions? Contact our team.

Read the docs

Article 145-IX of Morocco's General Tax Code (CGI) makes structured electronic invoicing mandatory under a clearance model: each invoice is sent to the DGI (Direction Générale des Impôts) platform for validation before it reaches the buyer. Invoices use UBL 2.1 or CII XML. The DGI has announced a phased rollout starting with large companies; the exact calendar and thresholds depend on the implementing decree.

Full DGI 2026 compliance guide