> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uselim.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Document Management

> Electronic Bookkeeping Act compliance, document upload, and timestamping.

# Document Management

lim provides document management that complies with Japan's Electronic Bookkeeping Act (電子帳簿保存法 / 電帳法), which requires businesses to store and manage electronic records properly.

## Electronic Bookkeeping Act Overview

Since January 2024, all businesses receiving electronic transaction data (invoices, receipts via email/web) must store them electronically with:

1. **Searchability** — by date, amount, and counterparty
2. **Timestamping** — proof that the document existed at a specific time
3. **Tamper prevention** — documents cannot be altered after storage
4. **Retention** — 7 years minimum (10 years for some)

<Tip>
  lim handles all four requirements automatically. Upload your documents and lim takes care of
  compliance.
</Tip>

## List Documents

```bash theme={null}
lim docs list
```

```
ID            Type      Date        Amount   Counterparty  Entry
doc_01KG...   invoice   2026-03-01  11,000   AWS           je_01K3...
doc_01KH...   receipt   2026-03-14  1,200    Cafe          (unlinked)
doc_01KI...   receipt   2026-03-15  3,400    Taxi          (unlinked)
```

## Show Document Details

```bash theme={null}
lim docs show doc_01KG...
```

```
Document: doc_01KG...
File:          invoice-aws-march.pdf
Type:          invoice
Date:          2026-03-01
Amount:        ¥11,000
Counterparty:  Amazon Web Services
Timestamp:     2026-03-16T10:30:00+09:00
Hash:          sha256:a1b2c3d4...
Entry:         je_01K3...
Status:        verified ✓
```

## Upload Documents

```bash theme={null}
# Attach a document to a journal entry
lim docs upload --file invoice-aws-march.pdf --entry je_01K3...
```

```
✅ Document uploaded: doc_01KG...
   File:       invoice-aws-march.pdf
   Timestamp:  2026-03-16T10:30:00+09:00
   Hash:       sha256:a1b2c3d4...
   Linked to:  je_01K3... (AWS monthly)
```

### Upload Without Linking

```bash theme={null}
# Upload first, link later
lim docs upload --file receipt.jpg
```

```
✅ Document uploaded: doc_01KH...
   Pending journal entry linkage.
```

## Metadata Requirements

lim extracts and stores the required metadata automatically:

| Field         | Source                                  | Required by |
| ------------- | --------------------------------------- | ----------- |
| Date          | Extracted from document or entry date   | 電帳法         |
| Amount        | Extracted from document or entry amount | 電帳法         |
| Counterparty  | Extracted from document or vendor name  | 電帳法         |
| Document type | Classified (invoice, receipt, contract) | 電帳法         |

## Search Documents

Search by the required fields — date, amount, and counterparty:

```bash theme={null}
# Search by counterparty
lim docs search --counterparty "AWS"

# Search by date range
lim docs search --from 2026-03-01 --to 2026-03-31

# Search by amount range
lim docs search --min 10000 --max 50000

# Combine search criteria
lim docs search --counterparty "AWS" --from 2026-01-01 --to 2026-12-31
```

```
ID            Type      Date        Amount   Counterparty  Entry
doc_01KG...   invoice   2026-03-01  11,000   AWS           je_01K3...
doc_01KL...   invoice   2026-02-01  11,000   AWS           je_01J9...
doc_01KM...   invoice   2026-01-01  11,000   AWS           je_01H2...
```

## Timestamping

lim timestamps every document on upload with a cryptographic hash. This proves the document existed at the recorded time and has not been modified.

```bash theme={null}
# Verify a document's timestamp
lim docs verify doc_01KG...
```

```
✅ Document verified
   Original hash: sha256:a1b2c3d4...
   Current hash:  sha256:a1b2c3d4...
   Timestamp:     2026-03-16T10:30:00+09:00
   Integrity:     intact ✓
```

<Warning>
  Documents cannot be deleted or modified once uploaded. This is by design — the Electronic
  Bookkeeping Act requires tamper-proof storage. If a document was uploaded in error, mark it as
  void instead.
</Warning>

## Bulk Upload

```bash theme={null}
lim docs upload --dir ./receipts-march/
```

```
✅ Uploaded 23 documents from ./receipts-march/
   Auto-linked: 18 (matched by amount + date)
   Pending:      5 (manual linkage required)
```

## Unlinked Documents Report

```bash theme={null}
lim docs unlinked
```

```
Unlinked Documents
────────────────────────────────────────────────
ID            File                  Date        Amount
doc_01KH...   receipt-cafe.jpg      2026-03-14  1,200
doc_01KI...   receipt-taxi.jpg      2026-03-15  3,400
```

## Compliance Report

```bash theme={null}
lim docs compliance --year 2026
```

```
Document Compliance Report: 2026
────────────────────────────────────────────────
Total journal entries:    245
  With documents:         230  (93.9%)
  Without documents:       15  (6.1%)  ⚠️

Unlinked documents:         5
Timestamp verification:   All passed ✓
Retention policy:         7-year minimum ✓
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Tax Filing" icon="file-invoice" href="/guides/tax-filing">
    e-Tax export uses linked documents for audit trail.
  </Card>

  <Card title="Natural Language" icon="message" href="/guides/natural-language">
    Attach files directly with `lim add --file`.
  </Card>
</CardGroup>
