A buyer is looking for an invoice from the year before last. He calls the supplier's sales desk, someone searches the ERP, finds the number, exports a PDF and sends it by email. Twenty minutes of work for a file that already exists. A customer account with a document archive handles the same request with nobody involved – and covers part of the supplier's own retention duty along the way. Because the very documents the buyer wants to find easily are documents the merchant has to keep anyway: books, inventories and annual accounts for ten years, accounting vouchers for eight years, the remaining records for six years (section 147 paragraph 3 of the German Fiscal Code, AO). For invoices, VAT law also names eight years and starts the clock at the end of the calendar year rather than on the document date (section 14b paragraph 1 of the German VAT Act, UStG). That turns a convenience feature into a question of record keeping. This article maps document types to their periods, explains why a folder full of PDF files only half satisfies the requirement to be machine-evaluable, and pursues the question that rarely gets asked: where those files are actually allowed to sit when shop and archive live in different data centres.
Key takeaways
- Three periods, not one: books, inventories and annual accounts are kept for ten years, accounting vouchers for eight years, commercial and business letters received and sent for six years (section 147 paragraph 3 AO). For invoices, section 14b paragraph 1 UStG names the same eight years.
- The period does not start on the document date but at the end of the calendar year in which the document came into being (section 147 paragraph 4 AO). An invoice dated 2 January and one dated 30 December of the same year expire on the same day.
- A directory full of PDF files meets the requirement only halfway: during the retention period the records must be available at all times, capable of being made legible without delay and machine-evaluable (section 147 paragraph 2 AO). That calls for structured data alongside the image.
- The place of storage is regulated. Electronic storage elsewhere in the EU is permitted where full remote access, download and use are ensured (section 14b paragraph 2 UStG); for third countries, electronic bookkeeping needs authorisation (section 146 paragraph 2b AO).
- The customer account is the surface, not the archive. The ERP or an archive system stays in the lead; the shop displays what it receives through an interface. Otherwise a statutory period ends up inside a shop database that gets rebuilt at the next migration.
What belongs in the document archive and why
A B2B order produces a chain of documents, and each one serves a different purpose. The order confirmation records what was bindingly ordered. The delivery note travels with the goods and documents what actually left the warehouse. The invoice asks for money and carries the mandatory VAT details. On top of that come documents with no retail equivalent: the customer-specific price list with negotiated terms, the credit note after a complaint, the call-off record from a framework contract and the customs papers for cross-border deliveries. As a rule these documents sit in three to five different systems, and the customer receives them by email. Filing is manual work on both sides.
A document archive inside the B2B customer portal reverses that logic. Instead of sending documents, the supplier makes them available and notifies the customer that they are ready. The buyer finds them again under his own order number, and the sales desk stops being a search service. That self-service in B2B is more than a convenience is something we described in B2B customer portals and their self-service functions. The point deliberately left open there is the uncomfortable one: as soon as a document sits in the customer account, the question arises how long it has to stay there, who may see it and what happens when the system is replaced.
Four document types, four roles
Retention periods by document type: ten, eight and six years
The Fiscal Code grades retention by type of record. Books, records, inventories, annual accounts and management reports are to be kept for ten years, accounting vouchers for eight years and the other records subject to retention for six years (section 147 paragraph 3 AO). For invoices, the VAT Act repeats the eight years and adds its own rule on when the period starts (section 14b paragraph 1 UStG). Commercial law applies the same grading with the same figures to merchants (section 257 paragraph 4 of the German Commercial Code, HGB). So anyone who stores a single period in the shop and treats everything alike either keeps documents for too long or not long enough – both are errors, only with different consequences.
| Document | Retention period | Period starts | Legal basis |
|---|---|---|---|
| Invoice, outgoing and incoming | eight years | end of the year of issue | section 14b paragraph 1 UStG |
| Accounting voucher without invoice character | eight years | end of the year it came into being | section 147 paragraphs 3 and 4 AO |
| Books, inventories, annual accounts | ten years | end of the year of the last entry | section 147 paragraphs 3 and 4 AO |
| Order confirmation as a business letter | six years | end of the year it was sent | section 147 paragraphs 3 and 4 AO |
| Delivery note without accounting function | until the invoice is received or sent | not applicable | section 147 paragraph 3 AO |
| Customer-specific price list | six years as a business letter | end of the year it was sent | section 147 paragraphs 3 and 4 AO |
One row in this table surprises people regularly: the delivery note. Where it does not serve as an accounting voucher, its retention period ends for the recipient when the invoice arrives and for the sender when the invoice goes out (section 147 paragraph 3 AO). That is not an invitation to delete but a relief with a condition attached: it applies only where the delivery note carries no accounting-relevant details that the invoice lacks. In practice the distinction is still worth making, because delivery notes are the highest-volume document type in wholesale. How accounting documents reach the archive depends on the handover to financial accounting; our article on the DATEV interface for e-commerce describes the usual routes.
When the clock starts and when it does not run out
The most common miscalculation in a document archive is not the duration but the starting point. The retention period begins at the end of the calendar year in which the document came into being, the business letter was received or sent, or the last entry was made (section 147 paragraph 4 AO). For invoices the VAT Act says the same with reference to the date of issue (section 14b paragraph 1 UStG). An invoice dated 2 January 2026 and one dated 30 December 2026 therefore both expire on 31 December 2034. A clean-up job that instead deletes exactly eight years after the document date runs half a year early on average – and hits precisely the documents from the first quarter.
There is also a brake that many deletion concepts do not know about: the period does not run out as long as the records matter for taxes whose assessment period is still open (section 147 paragraph 3 AO). An ongoing tax audit, an appeal or an extended assessment period therefore holds retention in place. In practice that means an automated deletion run needs a switch that holds individual year groups, and that switch belongs in the leading system, not in the shop. The extension works in tax law; under commercial law the periods of section 257 HGB continue to apply. Anyone moving to electronic invoicing anyway plans both together – the sequence for that is in our article on the e-invoicing mandate and connecting shop and ERP.
The core in one sentence
What a document archive has to do
Retention means more than storage. Where records are held on a data medium, they must be available at all times throughout the period, capable of being made legible without delay and machine-evaluable (section 147 paragraph 2 AO). The last point is where most grown-over filing systems fail. A PDF is legible, but without structured accompanying data it is not evaluable; a folder with 80,000 files named like "INV_final_2.pdf" is neither. For invoices there is the additional requirement that authenticity of origin, integrity of content and legibility must be ensured throughout (section 14 paragraph 3 UStG) – as a rule through an internal control procedure that creates a reliable audit trail between invoice and supply.
Structured data
Alongside the image, header and line items exist as a record: document number, date, customer, net, tax, positions. Without that layer, evaluation is a search across file names.
Period arithmetic
One document type per document, the period follows from it, the expiry date follows at year end. The value is calculated rather than maintained, otherwise it drifts apart with every special case.
Findability
Search by order number, the customer's own reference, period and document type. The buyer knows his order number, rarely the supplier's invoice number.
No overwriting
Once released, documents are not overwritten. Corrections appear as a new document with a reference, so the audit trail between invoice and supply survives.
Bulk export
A whole year group must be able to leave in one go – as a file with images and structured data, not as 4,000 individual downloads through the interface.
Separated layers
The shop owns display and permissions, the archive owns the file and the period. The two talk through an interface so that a system change never touches retention.
This separation is the real architectural decision. A document archive that lives entirely inside the shop database is tied to the lifespan of the shop – and that is shorter than eight years. If the filing is kept in the ERP or in a dedicated archive instead, with the shop fetching list and file through an interface between shop and ERP, the archive outlives every front-end generation. The shop only needs two things for that: a list of documents for a given debtor and a signed, time-limited link to the individual file.
Where the documents are allowed to sit
Hardly anyone asks this question, although it rides along with every hosting decision. For invoices the rule is that a business established in Germany keeps them in Germany. Where electronic storage ensures full remote access to the data as well as its download and use, the business may also keep the invoices elsewhere in the EU (section 14b paragraph 2 UStG). The place of storage must be reported to the tax office when it lies outside the country. For electronic bookkeeping as a whole, the Fiscal Code permits EU member states without an application, but third countries only with authorisation from the competent tax authority and under four named conditions (section 146 paragraph 2b AO). An archive that quietly ends up in a region outside the EU is therefore no longer merely an availability topic.
- Storage location documented per document type, including failover site and backup copies
- Where records sit outside the country: notification to the tax office and full online access demonstrated
- Data processing agreement in place where a service provider runs the archive
- Access route for a tax audit described, including export into an evaluable format
- Deletion hold available for year groups whose assessment period is still open
- Restore rehearsed once a year on a real year group, not just the backup itself
The last point sounds like operations and is nevertheless part of retention: a backup from which a year group cannot be brought back in legible and evaluable form does not meet the requirement. Anyone running the archive in-house plans that rehearsal together with the other operating duties – we sorted out the connections between protection needs, evidence obligations and the supply chain in IT security and NIS2 in the B2B shop.
Setting it up in the customer account: view, roles, interface
From the buyer's point of view the document archive is a list with filters. From a technical point of view it is three questions: which documents belong to this account, who may see them, and where the file comes from at the moment of the click. The debtor from the ERP answers the first question, not the shop customer number – in group structures several debtors with different delivery addresses hang off a single login. The second question is a matter of roles: a requester sees his own orders, an approver those of his cost centre, accounting all invoices of the company. Our article on customer groups, roles and permissions in Shopware shows how to model such gradations cleanly; in a document archive the separation matters more than elsewhere, because prices and terms are printed in the documents. The third question decides the operating load: files do not belong in the shop database but behind a time-limited link that the shop generates on request. The overview of B2B portals and their functional building blocks describes which pieces come together for that.
Four failure patterns that repeat in existing archives
Migration and system changes
No shop and no ERP survives eight years without a change. The Fiscal Code has a relief for exactly that: where a tax audit has not yet begun, it is sufficient, on a change of data processing system or on moving records subject to retention out of the productive system, to hold the data after the end of the fifth calendar year following the change exclusively on a machine-readable and machine-evaluable data medium (section 147 paragraph 6 AO). So the old system does not have to stay operational for eight years – the data medium does. The condition is strict, though: machine-readable and machine-evaluable, not a stack of printouts.
For a migration project that produces a clear sequence. First the legacy holding is exported in full and with structured accompanying data, then it is checked whether document number ranges, debtors and periods line up in the target system, and only then is the switch thrown. The export needs a count check per year group and document type against the old system, otherwise the year in which the numbering logic once changed is exactly the one that goes missing. Which further steps belong in a changeover without losing visibility is set out in Shopware migration without SEO loss; for the data side, our article on ERP integration in B2B e-commerce is the right starting point.
Taking over an existing archive
Rolling it out in manageable waves
A document archive does not have to be built as one big project. A sensible first wave covers exactly one document type – usually the invoice, because it is requested most often and has the clearest period. It shows whether debtor assignment, permissions and file delivery hold up. Delivery note and order confirmation follow, then the customer-specific price list and the call-off overview from framework contracts. For customers with call-off orders that overview is the actual benefit, as our article on framework contracts and call-off orders in the B2B shop shows.
- Document types named, with the period and its legal basis stored per type
- Period start calculated to year end, not to the document date
- Leading system decided: files and periods in the archive, display in the shop
- Debtor assignment through the ERP, not through the shop customer number
- Roles separated: own orders, cost centre, entire company
- Deletion run with a hold per year group and a log that makes every run traceable
What counts in the end is unspectacular: the buyer finds his invoice in two clicks, the sales desk stops getting called, and the period runs where it belongs. If electronic invoicing is on the list anyway, archive and format can be planned in one go – the requirements are on our page about e-invoicing in B2B.
Sources and legal basis
Related Articles
Showing Declarations of Performance Before Checkout
Regulation (EU) 2024/3110: how the declaration of performance and conformity, CE details and safety information become visible in the shop before the contract binds.
Units of Measure and Pack Sizes in B2B Online Shops
Case, pallet, roll or metre: how base, sales and order units convert in a B2B online shop, how minimum quantities apply and unit pricing stays correct.
WEEE Duties When You List Electricals in a B2B Shop
The registration number as an item field, a block for unregistered manufacturers, output on quote and invoice, and a take-back duty measured by storage and dispatch space.