SaaS Development

Building or adapting invoicing software for Morocco's e-invoicing reform: method, choices, timelines

In-house tool, ERP or SaaS product: upgrading invoicing software for Morocco's reform is a real technical project. Here is how to scope it and get it right.

Building or adapting invoicing software for Morocco's e-invoicing reform: method, choices, timelines

If your invoices come out of custom business software, a tool a contractor built years ago, or if you publish invoicing software sold to other companies, Morocco's e-invoicing reform affects you directly: evolving the tool is your job. This guide explains how to scope the project, which technical building blocks to plan and how to avoid a last-minute rebuild. For the regulatory context, see what is decided on e-invoicing in Morocco.

Three situations, three approaches

  • A well-built in-house tool (clean database, maintained code): adapt it by adding the missing pieces.
  • An old or fragile tool (undocumented code, PDF invoices with no structured data): it is often safer to rebuild the invoicing module on a modern base and migrate the data.
  • A software vendor selling invoicing to customers: compliance becomes a selling point, and the architecture must serve many customers at once.

The building blocks

1. A clean data model

Everything starts with data: issuer, customers with ICE and tax ID, items, VAT rates, invoice lines, credit notes, payments. Numbering must be system-generated, continuous and gap-free, per series. No issued invoice can be edited: corrections go through a credit note.

2. A structured invoice generator

The software must produce each invoice in a structured format cited by the reform (UBL 2.1 or CII, in XML), then validate it against format rules before sending. The readable PDF is generated from the same data, never the other way round.

3. A platform connector

The connector sends invoices to the government platform, retrieves statuses (validated, rejected) and reasons, and lets you fix and resend. It should be isolated from the rest of the code so it can adapt to final specifications and their changes: it is the piece most likely to change.

4. Receiving supplier invoices

A receiving module ingests incoming e-invoices, matches them to orders and feeds accounting without re-keying.

5. Archiving and traceability

Issued and received invoices are stored in their original format with receipts, for the legal period, with a timestamped log of every event. Backups and access rights complete the picture.

6. APIs

An API connects invoicing to your e-commerce site, CRM or ERP, and lets you offer integrations to your own customers if you are a vendor.

Custom, Odoo or off-the-shelf?

  • Off-the-shelf software: simplest if your invoicing is standard. Check the vendor's commitment with our 15-point checklist.
  • Odoo or another ERP: a good fit if you also want stock, purchasing and accounting in one tool, with an integrator for the Moroccan localisation.
  • Custom: when invoicing is woven into a specific business process (projects, subscriptions, rentals, logistics) that standard tools handle poorly, or when you are the software vendor.

A typical project, step by step

  1. Audit the existing tool: data, code, volumes, integrations, risks.
  2. Clean and migrate customer and item master data.
  3. Compliant data model and numbering, credit notes, locking of issued invoices.
  4. UBL or CII generator and internal validation.
  5. Archiving, logging, security.
  6. Platform connector finished once official specifications are published, then tested in a staging environment.
  7. Team training and cut-over.

Steps 1 to 5 can start now. For an invoicing module on a sound base, expect a few weeks to a few months depending on the existing system and integrations. Our article on SaaS development cost breaks down the budget lines.

For vendors: an opportunity

The reform creates demand among thousands of companies still invoicing in Excel or with unmaintained tools. A vendor specialised in a sector (construction, healthcare, transport, trades, freelancers) can turn it into a strong selling point. That is the logic behind SoloGestion, our invoicing and management software for Moroccan self-employed professionals, shown in our work.

We build and upgrade your tool

Our SaaS and software development service covers the audit, data model redesign, structured invoice generation, connectors, archiving and migration. Describe your current tool and we will propose the safest route, upgrade or rebuild.

Frequently asked questions

Do we need to rebuild old invoicing software from scratch?

Not always. If the database is clean and the code maintained, add the missing pieces. If invoices are PDFs with no structured data or the code is fragile, rebuilding the invoicing module is often safer.

Can we build the DGI platform connection now?

You can prepare the architecture and isolate the connector, but it should be finished against official documentation. Everything else (data, generator, archiving) can be done now.

How long does it take to adapt invoicing software?

From a few weeks to a few months, depending on the existing system and integrations. An initial audit gives a precise estimate.

Is Odoo a good alternative to custom?

Yes, if your processes are close to standard and you also want stock, purchasing and accounting. Custom makes sense when invoicing is tied to a specific business process.