Guides & comparisonsInvoicingRetail in Morocco

Electronic invoice or PDF: what is the difference in Morocco?

A PDF is read and printed; a structured file is processed field by field. Validity, fields, XML, signature, retention and the practical choice for a Moroccan business.

By BelloCommerce

·

A PDF can be a valid invoice, but it is not the same thing as a structured invoice. A PDF presents information to a person; XML places seller, customer, lines, VAT and totals into fields another system can process. In Morocco, article 145 fields and continuous numbering remain essential. The future DGI route cannot be inferred from the word electronic or from a format selected by one vendor.

Electronic invoice and PDF invoice compared in Morocco
Electronic invoice and PDF invoice compared in Morocco.

In brief

  • PDF is visual presentation; XML is a data structure.
  • A complete PDF remains usable today, but emailing it does not prove tax submission.
  • Invoice value begins with fields, continuous numbering and history, not the extension.
  • The DGI report confirms a developed portal without publishing the national schema in that passage.
  • BelloPOS supplies PDF for the customer and UBL 2.1 for export, without an active direct DGI connection.

1. PDF, image and XML: three different objects

Every invoice received by email is sometimes called electronic; there the word describes the channel. In a tax project it generally means a document whose data can travel between systems. Always ask whether the speaker means customer display, legal evidence, the structured file or transmission to the authority. Our electronic-invoicing FAQ defines the other terms that commonly get confused.

ObjectWhat it containsWhat a machine understandsMain use
Photo or scanPixels representing paperAlmost nothing without OCRVisual copy and fallback
Text PDFPage layout and selectable textText, not reliably the meaning of each amountReading, sending and printing
PDF with internal fieldsPresentation and some metadataMore information without a guaranteed shared schemaForm or enriched archive
Structured XMLHierarchical fields under a schemaIdentifiable parties, lines, taxes and totalsAutomated exchange and control
Hybrid packLinked PDF and XMLHuman reading and machine processingKeeping both representations

Renaming invoice.pdf as invoice.xml changes nothing. XML must follow a schema and rules. Conversely, technically perfect XML can be fiscally wrong when identity, tax or source number is wrong. Format never replaces data.


2. Is a PDF valid in Morocco today?

Electronic media does not cancel invoicing duties. Article 145-III requires seller identity, tax ID and professional-tax number, date, customer and ICE, nature, quantity, price, VAT separately, payment and legal information in a continuous series. Our mandatory-fields checklist lets you inspect a document quickly.

  • Software-generated PDF: It can document the sale when it carries required fields, number and history. Its quality depends on the data and procedure.
  • Printed and scanned PDF: It visually reproduces the document but often loses the link to source data. Retain the original and the entry that generated it.
  • PDF sent by email or WhatsApp: The channel helps delivery to the customer. It is not by itself DGI submission, validation or a tax acknowledgement.
  • Signed PDF: A signature may support identity and integrity under its mechanism. It does not automatically make content structured or accepted by a tax portal.
  • PDF edited after issue: This is the real danger. An issued invoice keeps its history; corrections use a credit note or proper procedure, not silent file replacement.

Law 53-05 recognises that writing required for a legal act can be established and retained electronically under the stated identity and integrity conditions. That does not mean any PDF automatically satisfies every tax duty. Electronic-writing validity and the fiscal invoice route are separate checks.

The answer therefore depends on the question. ‘Can I give a complete PDF invoice to my customer today?’ generally receives yes. ‘Is this the structured, transmitted file the future mechanism will retain?’ needs the official specification and cannot be proved by analogy.

3. Why authorities and accountants want structured data

A person reads PDF easily. At scale, a machine must guess which area is net total, whether 20% is a tax or discount, and which identifier belongs to the customer. A common structure removes that ambiguity.

  1. The issuing system places each value in the field defined by the schema.
  2. Rules check type, length, presence and consistency of values.
  3. The receiver imports fields without manual re-entry.
  4. Totals and taxes can be recalculated and reconciled.
  5. Statuses, corrections, payments and disputes can link to the original invoice.
  6. The archive retains source content and trace, not only printed appearance.
CheckIn PDF aloneIn a well-defined structured file
Customer ICEA person sees it visuallyA field can be required and checked
VAT totalRead or extracted with error riskCalculated from named lines
Accounting importRe-entry or OCRAutomatic mapping is possible
Credit noteLink written in the pageMachine reference to source invoice
Bulk searchDepends on indexed textDirect query over fields

Structure does not remove responsibility. A badly configured rate will travel faster, not fix itself. Review seller, customer and product records, then test a normal invoice, exemption, discount, part payment and credit note with the accountant.

Structured XML data for an invoice
Structured XML data for an invoice.

XML does not automatically mean ‘DGI format’

XML is a container. UBL 2.1 is an international schema BelloPOS selected for recoverable data. In official sources reviewed through 29 August 2026, we did not find a publication requiring UBL 2.1 as Morocco’s national schema. We therefore present it as our export format, not approval or a DGI requirement.

4. Which file to send, retain and give the accountant

For the customer, PDF remains easiest to read, print and attach. In your system, also retain source data and history. For the accountant, agree a period pack with invoices, credit notes, payments, numbering and a manifest that reconciles each document. Our guide to issuing an invoice step by step covers the flow before that archive.

  • To the customer: Readable PDF with every field and, where needed, terms and payment references.
  • Inside the system: Source document, number, lines, VAT, status, author, corrections and any hash.
  • To the accountant: Period export, manifest, credit notes, payments and exceptions for review.
  • To the DGI: Format, channel and acknowledgement fixed by the applicable official procedure, without assumption.
  • In the archive: Readable and structured representations, restored backups and documented access rights.

Article 211 requires ten-year retention of copies of sales invoices or receipts, expense and investment evidence and accounting documents needed for audit. Do not confuse an email attachment with an operational archive. A useful archive can be found, read and restored and preserves links between original and correction.

Tax submission, when applicable, is another action. The DGI report says the portal allows issue, transmission, receipt and reporting of later events. Putting XML in a folder called DGI is not enough. Use the official channel, retain its acknowledgement or status and follow published rules.

5. BelloPOS’s dual flow: human reading and structured export

BelloPOS preserves the immediate retail use: an invoice can be printed or supplied as PDF. From Go, the same issue also produces UBL 2.1 XML with identities, dates, lines, VAT, totals and payment. SHA-256 is calculated over the issued file, which enters a local queue. The operator can export one item or a period ZIP with CSV manifest.

NeedBelloPOS responseStated limit
Customer wants to read itPDF and printPDF is not tax submission
Accountant wants dataUBL 2.1 and period manifestTheir own workflow must accept the schema
Internet goes downOffline issue and local queueSubmission must follow the official deadline
Verify issued fileSHA-256 hashIt is not a DGI signature
Transmit to authorityExport ready to hand overNo active direct DGI connection

The choice is clear. If you only need to send a presentable invoice, PDF serves the customer. If you want to avoid lock-in, prepare automation and provide data to an accountant, require a structured format and complete export too. For rollout status, read is electronic invoicing mandatory?

Mistakes to avoid

  • Calling every PDF sent by message electronic without defining the word.
  • Believing an XML extension guarantees a schema, compliance or acceptance.
  • Deleting an invoice and regenerating PDF instead of issuing a traced credit note.
  • Retaining only the attachment, without source data, backup or restore test.
  • Presenting a SHA-256 hash as a DGI signature or validation.

Frequently asked questions

Is a PDF an electronic invoice in Morocco?

It can be an invoice created and delivered electronically, but it is not a structured file simply because it is PDF. For a tax mechanism, follow the official definition, format and channel.

Can a PDF invoice remain valid?

It can when it carries mandatory fields, follows continuous numbering, retains history and is archived. The medium removes none of article 145’s requirements.

What is the difference between PDF and XML?

PDF presents a page to a person. XML places values into defined fields software can check and import.

Is UBL 2.1 the official Moroccan DGI format?

We did not find that requirement in the official sources reviewed. It is BelloPOS’s structured export format, not a national standard we attribute to the DGI.

Should PDF and XML both be retained?

That is sound practice when they represent the same invoice: one is readable and one processable. Also retain status, credit notes, payment, acknowledgements and backups under the applicable procedure.

Does BelloPOS send XML directly to the DGI?

No. BelloPOS prepares, seals, queues and exports. The merchant or accountant submits through the official channel available.

What to take away

PDF is neither useless nor identical to a structured invoice. Use it for reading and customer delivery, retain a data format for exchange and archiving, and call a route DGI only when official specifications and channels confirm it. A good solution produces both and states its limits.

Sources

The figures and rules quoted above come from these pages, read on the date given in the article.

Produce the readable document and recoverable data

BelloPOS generates the customer invoice and, from Go, its sealed UBL 2.1 export with a local queue and period pack. See the complete flow, compare editions and agree DGI-submission ownership with your accountant.

Read next

Other practical guides on the same subject: