Take one supplier invoice that arrived as a scanned PDF, open your accounting software next to it, and time the full entry: supplier, document number, date, currency, line items, VAT, matching against the purchase order. Do it on ten invoices rather than one, and count the time spent going back when the total refuses to balance.

That number decides the project. If you average three minutes per document and process 600 a month, that is 30 hours of monthly data entry, roughly a half-time admin role over a year. At 40 invoices a month the arithmetic does not justify an automation project, and a cleaner mailbox structure will do more for you at no cost.

Between those two extremes, the decision turns on very concrete details: how clean your scans are, how many different layouts you receive, and what your ERP accepts as input.

OCR, extraction and RPA are three different things

Most proposals sell all of it under one word. In practice there are three layers, they do not cost the same, and they fail for different reasons.

  • OCR turns an image into characters. It is the most mature part, including on documents mixing French and Arabic, as long as the scan is decent.
  • Data extraction decides that this particular number is the net total rather than the gross, that this string is an ICE number rather than a bank account. This layer determines the quality of the result, and it is the expensive one to make reliable.
  • RPA takes over when your business software has no API: a robot clicks, fills fields, saves. Useful, but brittle. One interface update and the robot stops.

The priority order is the reverse of the sales demo order. A demo impresses with OCR; a project succeeds or fails on extraction and the checks around it.

One invoice, from the mailbox to your ERP

Here is the full chain as it actually gets built on a supplier-invoice scope, including the steps that short proposals skip.

2026 guide: document automation Morocco, cost and risks

  1. Collection. A dedicated mailbox, a scan folder, sometimes a photo sent over WhatsApp from a warehouse. If you do not enforce a single entry point, you automate 60% of the flow and keep 100% of the manual process running alongside it.
  2. Preparation. Deskewing, splitting PDFs that contain five invoices in a row, duplicate detection, setting unreadable pages aside.
  3. Reading. OCR page by page, keeping the position of every word. Layout matters as much as text.
  4. Extraction. Header fields first (supplier, date, number, currency, totals, VAT), then line items, which are always the hard part.
  5. Business checks. Do the line items add up to the total? Is the VAT consistent? Does the supplier exist in your master data? Is there an open purchase order, and for the right amount?
  6. Human review queue. Every field comes out with a confidence score. Below a threshold, the document lands in a queue where an operator sees the image and the field side by side and corrects it in two clicks.
  7. Writing to the system. API, import file, or a robot if nothing else exists. This is usually the step that reveals the ERP requires a field nobody mentioned.
  8. Archiving and audit trail. The original document, the extracted version, who corrected what and when. You will want it the day an auditor asks.

Steps 5 and 6 account for a large share of the development effort and for almost all of the gap between a pilot that impresses and a system your accounting team agrees to use.

Which documents work, and which still resist

Good candidates share three traits: steady volume, repeating structure, and a ground truth you can verify elsewhere in your systems. Recurring supplier invoices, purchase orders, delivery notes, bank statements, freight and customs paperwork and payslips all qualify. For a freight forwarder, customs files are often the best starting point simply because the same fields recur hundreds of times a month.

Still resisting in 2026: contracts and amendments written in free text, where the problem is not reading but interpreting a clause; handwritten letters and margin notes, especially in Arabic; stamps landing on top of an amount; photos taken at an angle in a badly lit warehouse; low-resolution black-and-white scans from an aging copier. A serious provider will say so before you sign, and will propose excluding those cases from scope instead of promising to handle them.

What document automation Morocco projects cost in 2026

The ranges below are for framing a budget before you request quotes, not for replacing one. They move a lot depending on the number of layouts, the state of your master data and how open your ERP is.

  • Proof of concept on a single document type, measured on your real files, 2 to 4 weeks: roughly MAD 25,000 to 60,000.
  • First production rollout, one document type with business checks and one integration: typically MAD 80,000 to 200,000.
  • Several document types, hosting in Morocco, historical backlog and a full review interface: MAD 250,000 to 600,000, sometimes more in a multi-entity group.
  • Recurring: per-page processing cost (a few centimes to a few dirhams depending on the model used), any licences, and 15% to 20% of project cost per year for maintenance and retraining.

Two items routinely disappear from quote comparisons: your own team’s time during the parallel-entry phase, and cleaning up the supplier master file. The costing logic is the same as for other AI work, and our AI project cost guide for Morocco breaks down the lines a quote should show.

Timeline: 6 to 12 weeks for a first scope

A realistic calendar looks like this: one to two weeks to gather a representative sample (plan on 200 to 500 documents, including the ugly ones, not just the clean ones), three to four weeks for extraction and checks, two to four weeks of piloting with parallel entry and measured discrepancies, then the switch. If a provider promises production in three weeks, ask when they intend to test on your degraded scans.

Where these projects actually come apart

Rarely on the technology. Usually on four things.

Layout variety is underestimated during scoping. You think you receive “invoices” and you receive 70 different templates, fifteen of which show up fewer than five times a year. Those rare cases eat a disproportionate share of the budget; routing them to manual entry on purpose is the better call.

The success criterion is never defined. “95% accuracy” means nothing until you say 95% per field or per document. A twenty-field document at 95% per field rarely comes out clean. The useful metric is the share of documents that pass with no human touch at all.

Master data is dirty. The same supplier sitting in the ERP three times with three spellings, and automatic matching fails through no fault of the model. That is exactly what a data quality audit before a BI or AI project looks for, and it is often the highest-return work of the first few weeks.

Adoption gives way last. If your accountant keeps checking every line by hand “just to be safe”, you have added a step instead of removing one. The fix is showing the discrepancy numbers measured during the pilot, then narrowing manual review to the documents that are genuinely uncertain.

CNDP, invoices and HR files: what changes

An invoice is not a neutral document: it carries names, contact details, sometimes an individual’s bank details. An HR file or a copy of a national ID card is a step more sensitive. The moment you hand those files to an automated process, you have a personal data processing activity to declare, a processor to cover contractually, and one question to settle: where do the images go?

Look closely at this when the solution calls an OCR API or a language model hosted abroad, because that is a transfer of data outside Morocco with its own formalities. A sovereign setup, where models run on infrastructure located in Morocco, makes the conversation with your legal counsel and with large corporate clients considerably shorter. The day-to-day rules are covered in our piece on CNDP compliance for AI tools, and for the exact formalities in your case, check the CNDP website or have it reviewed by a lawyer.

No-code tool in-house or a provider: how to decide

An off-the-shelf tool configured internally works perfectly well if you tick these boxes: one document type, two or three stable senders, moderate volume, no deep integration needed (a CSV export is enough) and someone in-house willing to own it every month. Start there, a few hundred to a few thousand dirhams a month, and keep your project budget for something else.

Go with a provider when documents come from dozens of senders, when records must be written straight into the ERP with the right controls, when compliance and audit trails are demanded by a client or an auditor, or when document automation is the first brick before an internal AI assistant that can answer questions across all your documents. Either way, insist on owning your annotated documents: that corpus is the asset, not the model.

Frequently asked questions

What accuracy figure should go into a contract?

Not the one from the demo. Have it measured on a sample of your own documents, degraded scans included: the share of documents processed with no human intervention, and the residual error rate on critical fields (total, VAT, document number). Those two numbers, measured on your files, are the only ones worth committing to.

Should a human still review the output?

Yes, on any field with an accounting consequence or a payment behind it, at least below a confidence threshold. The point is not to remove the control, it is to move from full keying to checking a pre-filled screen, which changes the order of magnitude of the time spent.

Does OCR work on Arabic documents?

On printed Arabic, yes, current engines handle it reasonably well. On handwritten Arabic, results are still too erratic for a production flow. If your documents are bilingual, ask for a test on your own files before writing that scope into a contract.

Is this compatible with Sage, Odoo or SAP?

Technically yes in most cases, through an API or a file import. The real question is the level of detail your accounting setup expects: accounts, cost centres, VAT codes, line-level allocation. That configuration, not the connector, drives the integration effort.

At Arrowlancer we build exactly this kind of AI document analysis and automation for Moroccan SMEs: field extraction, business checks, integration with the management software you already run, and sovereign hosting in Morocco when the documents call for it. You can review our services or send us two or three of your typical documents through the contact form, which is the fastest way to find out whether your flow can be automated and at what cost.

AIdocument automationMoroccan SMEsOCRRPA