Skip to main content

E-Archiving & Retention

Belgian law (EU VAT Directive 2006/112/EC, Art. 244–246) requires invoices to be retained for 7 years. InvoStaq automates this — most invoices are archived without any action required.


How auto-archiving works

InvoStaq sets archiveDate and retentionExpiresAt automatically:

Invoice typeTrigger
AR (sent)When NetworkStatus transitions to Delivered, Sent, or Completed
AP (received)When the bill is Approved

Retention period: archiveDate + 7 years + 2 leap days

You don't need to do anything — just send invoices normally.


Browse your retention archive from Sent Invoices → Archive in the dashboard, or via the API:

curl "https://api.invostaq.com/api/invoices/archive?type=ar&from=2026-01-01" \
-H "Authorization: Bearer {token}"
{
"items": [
{
"id": "550e8400-...",
"invoiceNumber": "INV-00042",
"vendorName": "Acme Trading NV",
"totalAmount": 1210.00,
"currency": "EUR",
"type": "AR",
"archiveDate": "2026-03-15T09:12:00Z",
"retentionExpiresAt": "2033-03-17T09:12:00Z",
"isOnLegalHold": false
}
],
"total": 84,
"page": 1,
"pageSize": 50,
"totalPages": 2
}

Query parameters:

ParameterTypeDescription
fromdateFilter by archiveDate ≥ from
todateFilter by archiveDate ≤ to
typear / ap / allInvoice type (default: all)
legalHoldbooleanReturn only held invoices
pageintegerPage number (1-based, 50 per page)

Manual archive

Most invoices archive automatically. For edge cases or backfill:

curl -X POST https://api.invostaq.com/api/invoices/{id}/archive \
-H "Authorization: Bearer {token}"
{
"archived": true,
"archiveDate": "2026-05-07T10:00:00Z",
"retentionExpiresAt": "2033-05-09T10:00:00Z"
}

This is idempotent — calling it twice returns the same result without changing the existing dates.

Eligibility rules:

  • AR invoices: networkStatus must be Delivered, Sent, or Completed
  • AP bills: status must be Approved
  • Drafts and failed invoices cannot be archived

A legal hold prevents an invoice from being deleted even after the 7-year retention window expires. Use this for invoices under dispute, audit, or litigation.

curl -X PUT https://api.invostaq.com/api/invoices/{id}/archive/legal-hold \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{ "isOnLegalHold": true }'
{ "isOnLegalHold": true }
curl -X PUT https://api.invostaq.com/api/invoices/{id}/archive/legal-hold \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{ "isOnLegalHold": false }'

The invoice must be archived before a hold can be set. Calling on an unarchived invoice returns 409.


Reconciliation (missed invoices)

If Arratech's webhook delivery failed for a period, use the reconcile endpoint to backfill:

curl "https://api.invostaq.com/api/invoices/inbound/reconcile?from=2026-01-01&to=2026-03-31" \
-H "Authorization: Bearer {token}"
{
"from": "2026-01-01",
"to": "2026-03-31",
"scanned": 47,
"ingested": 3,
"alreadyPresent": 44,
"pagesFetched": 1,
"rangeWarning": null
}
  • scanned — transactions in the date range that were checked against the local database
  • ingested — transactions that were missing locally and have now been added
  • alreadyPresent — transactions already in the database (no change)
  • rangeWarning — set when the 5,000-transaction scan cap was reached; narrow the date range if you see this

Limits: max 365-day range per request, max 5,000 transactions scanned.


Archive UI

The Archive page under Accounts Receivable in the dashboard shows all archived invoices with:

  • Filter bar: date range, type (AR/AP), legal hold only
  • Retention expiry column (amber highlight when within 90 days)
  • Set Legal Hold / Remove Legal Hold button per row
  • Confirmation dialog before removing a hold

Authentication

All archive endpoints require Bearer JWT. See Authentication.