---
title: "Keep accounting records for seven years in · Agent Wranglers"
url: https://agentwranglers.se/playbook/compliance/records-and-data-map/swedish-bookkeeping-retention
id: CMP-79
level: Required
region: SE
risk: law
updated: 2026-10-27
build: a2a6bdfed830
tokens: 1036
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep accounting records for seven years in Sweden

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Records and data map](https://agentwranglers.se/playbook/compliance/records-and-data-map.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: CMP-79
- Level: Required
- Chapter: [Records and data map](https://agentwranglers.se/playbook/compliance/records-and-data-map.md)
- Rule: Keep every Swedish accounting record, such as invoices and receipts, to the end of the seventh year after its financial year ended. Leave them out of erasure requests until then.
- Check: A unit test computes the keep-until date for a financial year ending 31 December 2026 as 31 December 2033. An end-to-end erasure test deletes the test customer's profile and keeps their invoices. A daily query fails when an invoice is gone before its date or still present a year after it.
- Risk: A law broken
- Region: Sweden (SE). The duty comes from the law there. The rule applies only when the project serves people there, and its Applies when also holds.
- How: Chapter 7 section 2 of the Swedish bookkeeping act, bokföringslagen (1999:1078), sets the period. An invoice from a financial year that ends in December 2026 is kept until 31 December 2033. The GDPR allows keeping data that a law requires, under Article 17(3)(b). So an erasure request deletes the account and marketing data but keeps the accounting record. Mark those tables and columns as legal hold in the [retention schedule](https://agentwranglers.se/playbook/compliance/records-and-data-map/retention-schedule.md), and let the deletion job skip them until the date. Tell the person in the answer which records stay and until when. Move the records out of a vendor before it deletes your data, as [Confirm deletion when a vendor leaves](https://agentwranglers.se/playbook/compliance/processors-and-transfers/vendor-exit.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
const YEARS_TO_KEEP = 7;

export function keepUntil(financialYearEnd) {
  return new Date(Date.UTC(financialYearEnd.getUTCFullYear() + YEARS_TO_KEEP, 11, 31));
}

keepUntil(new Date('2026-12-31')); // 2033-12-31
```

### Python example

```python
from datetime import date

YEARS_TO_KEEP = 7

def keep_until(financial_year_end: date) -> date:
    return date(financial_year_end.year + YEARS_TO_KEEP, 12, 31)

keep_until(date(2026, 12, 31))  # 2033-12-31
```

## Sources

- [Bokföringslag (1999:1078), chapter 7 section 2](https://www.riksdagen.se/sv/dokument-och-lagar/dokument/svensk-forfattningssamling/bokforingslag-19991078_sfs-1999-1078/)
- [GDPR Article 17(3)(b)](https://eur-lex.europa.eu/eli/reg/2016/679/oj)

## Related rules

- CMP-11 [Keep one retention schedule](https://agentwranglers.se/playbook/compliance/records-and-data-map/retention-schedule.md) in Compliance and governance
- CMP-20 [Confirm deletion when a vendor leaves](https://agentwranglers.se/playbook/compliance/processors-and-transfers/vendor-exit.md) in Compliance and governance

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/compliance/records-and-data-map/swedish-bookkeeping-retention">Agent Wranglers compliance and governance playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Weigh every legitimate interest in writing](https://agentwranglers.se/playbook/compliance/records-and-data-map/legitimate-interests-assessment.md)
- Next: [Use Swedish personal identity numbers only when clearly justified](https://agentwranglers.se/playbook/compliance/records-and-data-map/swedish-personal-numbers.md)
- [Records and data map](https://agentwranglers.se/playbook/compliance/records-and-data-map.md)
