Imports
Bulk async ingest — SIE files (Fortnox/Visma/BL/SpeedLedger/Bokio migrations) and bank statements (11 formats).
Endpoints
POST/api/v1/companies/:companyId/imports/bank— Import a bank-file (CSV / XML / CAMT053).POST/api/v1/companies/:companyId/imports/sie— Import a SIE4 file.
POST /api/v1/companies/:companyId/imports/bank {#post-imports-bank}
imports.bank · scope transactions:write
Import a bank-file (CSV / XML / CAMT053).
Accepts a bank statement file (UTF-8 / Windows-1252, up to 10 MB) as multipart/form-data. Auto-detects the bank format (SEB, Swedbank, Handelsbanken, Nordea, Nordea Business, Lansforsakringar, Lunar, ICA Banken, Skandia, CAMT053, generic CSV) or honors a format override. Parses transactions, ingests them into the transactions table (NOT into journal entries — see BFL note in pitfalls), and emits transaction.synced events. Returns operation_id for polling.
Use when: Importing a bank statement export for a period. Common with PSD2 bank connections that don't auto-sync, or for legacy bank accounts.
Don't use for: SIE bookkeeping import (use /imports/sie). Auto-bank sync (use the enable-banking extension). Single-transaction creation (use POST /transactions/ingest with a 1-element array).
Pitfalls
- File size cap: 10 MB. Larger files require splitting client-side.
formatquery parameter is optional; auto-detection works for all supported banks. Passformatonly to force a specific format. Accepted values: seb, swedbank, handelsbanken, nordea, nordea_business, lansforsakringar, ica_banken, skandia, lunar, generic_csv, camt053.- Duplicate detection is by external_id (composed from date + amount + counterparty); a re-import of the same file with the same flag set typically deduplicates rather than creating doubles.
- BFL 5 kap 6-7 §§ note: this endpoint creates
transactionsrows (the underlag for a verifikation), NOT verifikationer themselves. The verifikation content requirements are in BFL 5 kap 6-7 §§; until each transaction is matched to an invoice/supplier-invoice (POST /transactions/{id}/match-*) or categorised (POST /transactions/{id}/categorize), the bookkeeping obligation isn't discharged. A successful import here means the data is ingested — not booked. - A successful import returns operation_id; poll /operations/{id} for the final ingested/duplicates/errors counts.
Risk: medium · Idempotent: yes · Reversible: no · Dry-run supported: no
Example response
{
"data": {
"operation_id": "op_a8f1…",
"type": "import.bank",
"status": "queued",
"poll_url": "/api/v1/operations/op_a8f1…",
"webhook_event": "operation.completed"
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/imports/sie {#post-imports-sie}
imports.sie · scope bookkeeping:write
Import a SIE4 file.
Accepts a SIE4 file (CP437 / Windows-1252 / UTF-8 auto-detected, up to 50 MB) as the request body, parses it, checks for duplicate imports by file-hash, and replays every #VER + #TRANS into the company's bookkeeping. Returns an operation_id immediately — poll GET /api/v1/operations/{id} for status + final result. The byte-equivalent dashboard route at /api/import/sie/execute backs the same lib helper, so a SIE imported via v1 matches what the dashboard would produce.
Use when: Migrating bookkeeping data from another system (Fortnox, Bokio, Visma) into gnubok, restoring from a backup .se file, or recreating a period from an archive.
Don't use for: Bank transaction CSV/XML imports (use POST /imports/bank). Single-voucher creation (use POST /journal-entries). Importing into a period that already has posted entries — SIE imports run on a fresh period.
Pitfalls
- Body content-type must be multipart/form-data with a
filefield carrying the .se / .sie file (or a JSON body withfile_base64for agents that can't do multipart). - File size cap: 50 MB. Larger files require chunking client-side or a future streaming import endpoint.
- Duplicate-file detection is by SHA-256 hash — re-importing the same file returns 409 SIE_IMPORT_DUPLICATE without re-running the import.
- The operation can take 1–5 minutes for multi-year files. The HTTP response returns immediately with operation_id; poll /operations/{id} every ~2s for status.
- BFL 7 kap räkenskapsinformation: once a SIE import completes, the resulting verifikationer are immutable. Cancellation midway is not supported.
Risk: high · Idempotent: yes · Reversible: no · Dry-run supported: no
Example response
{
"data": {
"operation_id": "op_a8f1…",
"type": "import.sie",
"status": "queued",
"poll_url": "/api/v1/operations/op_a8f1…",
"webhook_event": "operation.completed"
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}