Most e-invoicing projects in Saudi Arabia end the day the first invoice is cleared or reported to ZATCA. The QR code prints, the XML is accepted, and everyone moves on. But issuing the invoice is only the first obligation. The second one is quieter and lasts much longer: you have to keep that invoice, in its original electronic form, retrievable and unaltered for the full statutory retention period. VAT record-keeping rules in the Kingdom generally require records to be kept for at least six years, and longer for certain records such as those related to capital assets and real estate. Check the current ZATCA guidance for the periods that apply to your business, because the exact requirement depends on the type of record.

Six years is longer than the warranty on your server, longer than the tenure of many IT managers, and often longer than the software version you issued the invoice from. That is why retention deserves its own design, not an afterthought.

What "keeping the invoice" actually means

Keeping an e-invoice is not the same as keeping a PDF. The legally relevant document is the structured invoice (the XML with its hash, signature and QR data) together with the evidence of what happened to it: when it was cleared or reported, the response from the platform, and any credit or debit notes that followed. A good archive keeps all of these together and makes it obvious which version is the original.

  • Integrity: the stored file must be the one that was issued. Any process that regenerates invoices from current data (for example, after a product name changed) produces a different document.
  • Completeness: the invoice chain matters. Each invoice references the hash of the previous one, so missing files are visible.
  • Readability: in year five you still need to open and present the invoice, even if you have since changed ERP or hosting provider.

Retrieval is the real test

An archive is only as good as the speed at which you can answer a request. During an audit, the question is rarely "do you have the invoices?" It is "send us these 40 invoices from March three years ago, with their clearance responses, by tomorrow." If retrieval depends on one person who knows which folder on which server holds which year, you do not have an archive. You have a risk.

Set an internal retrieval target, such as "any invoice from any year within one hour", and test it twice a year. Pick random invoice numbers from old periods and time how long it takes to produce the full package. The first test is usually humbling, and that is the point.

Separate the archive from operations

The most common mistake is treating the live ERP database as the archive. Operational systems change constantly: upgrades, migrations, data clean-ups, module changes. Each of these is a chance to alter or lose historical documents. Good practice is to keep a separate, write-once copy of issued invoices that operations cannot touch.

  • Store issued invoice files in storage that is versioned or immutable, separate from the application server.
  • Keep backups in a second location, and make sure restoring them does not depend on the original server still existing.
  • Document where the archive lives and who can access it, so the knowledge survives staff changes.
  • When you migrate systems, migrate the archive deliberately and verify file counts and hashes afterwards.

How this works in Odoo

In Odoo, the e-invoicing modules for Saudi Arabia attach the generated XML and the platform response to each invoice, so the original document travels with the accounting record. That gives you a strong starting point. The parts that need deliberate setup are around it: a storage policy for attachments, an off-server backup of the filestore and database, access rights that prevent deletion of posted invoices, and a tested restore procedure. Done properly, an auditor's request becomes a search and an export rather than a project.

It also helps to agree on a simple yearly routine: confirm backups restore, spot-check a sample of old invoices, and record the result. That small habit turns retention from a hope into evidence.

A short checklist

  • Do you know the retention period that applies to each type of record you hold?
  • Can you retrieve any invoice, with its XML and clearance response, within an hour?
  • Is your archive separate from the live system and backed up to another location?
  • Would the archive survive a change of ERP, hosting provider or IT team?

If any answer is "not sure", it is much cheaper to fix now than during an audit. Request a quote and we will review how your e-invoices are stored and help you set up an archive that holds up for the full retention period.