Menu
Getting started
Cookbooks
API reference
- Overview
- Companies
- Capabilities
- Measures
- Packages
- Unexplained
- Liquidity forecast
- Portfolio
- Customers
- Invoices
- Collections
- Articles
- Set-offs
- Suppliers
- Supplier invoices
- Supplier payment files
- Bank payments
- Expense claims
- Transactions
- Reconciliation
- Bank accounts
- POS sales
- Webshop orders
- Journal entries
- Voucher gap explanations
- Fiscal periods
- Accounts
- Accrual schedules
- Agreements and commitments
- Tax loss carry-forwards
- Fixed assets
- Documents
- Signing requests
- Company registers
- Capital events
- Owner tax
- Inbox items
- Dimensions
- Employees
- Salary runs
- Reports
- Budgets
- Imports
- Compliance check
- Deadlines
- Skatteverket
- Peppol
- Webhooks
- Operations
- Pending operations
- Health
- API key
- Service accounts
Transactions
Bank transactions: ingest, categorise, match to invoices, reconcile.
Endpoints
GET/api/v1/companies/:companyId/transactions: List transactions for a company.GET/api/v1/companies/:companyId/transactions/:id: Retrieve a single transaction by id.POST/api/v1/companies/:companyId/transactions/:id/attach-document: Pin a document (receipt, invoice) to a bank transaction as its underlag.POST/api/v1/companies/:companyId/transactions/:id/categorize: Categorize a transaction and create the journal entry.POST/api/v1/companies/:companyId/transactions/:id/detach-document: Take the pinned document off a bank transaction that is not booked against it.POST/api/v1/companies/:companyId/transactions/:id/ignore: Ignore a bank transaction (no verifikat, allowed in locked periods).POST/api/v1/companies/:companyId/transactions/:id/link-journal-entry: Link a bank transaction to a verifikat that already books it (no new bookkeeping).POST/api/v1/companies/:companyId/transactions/:id/match-batch: Book one bank payment against several customer invoices, or several supplier invoices, in one verifikat.POST/api/v1/companies/:companyId/transactions/:id/match-invoice: Match a positive bank transaction to a customer invoice.POST/api/v1/companies/:companyId/transactions/:id/match-supplier-invoice: Match a negative bank transaction to a supplier invoice.POST/api/v1/companies/:companyId/transactions/:id/refresh-exchange-rate: Fill in the Riksbanken rate and SEK amount of an unbooked foreign-currency transaction.POST/api/v1/companies/:companyId/transactions/:id/uncategorize: Reverse the categorization of a transaction (storno + reset).POST/api/v1/companies/:companyId/transactions/batch-categorize: Categorize up to 100 transactions in one call (partial-success).POST/api/v1/companies/:companyId/transactions/bulk-book: Book several SEK bank transactions as one samlingsverifikat, or link them to one posted verifikat.POST/api/v1/companies/:companyId/transactions/ingest: Bulk-ingest transactions (up to 500 per call).PATCH/api/v1/companies/:companyId/transactions/:id: Edit an unbooked transaction: its working title, or which bank account it belongs to.DELETE/api/v1/companies/:companyId/transactions/:id: Delete an unbooked transaction that was added by hand (e.g. a duplicate you created).DELETE/api/v1/companies/:companyId/transactions/:id/ignore: Restore an ignored bank transaction to the "to book" list.
GET /api/v1/companies/:companyId/transactions
transactions.list · scope transactions:read
List transactions for a company.
Cursor-paginated transaction list ordered by created_at DESC, id ASC (newest-imported first; the date column is the transaction date and is filterable but not the sort key). Filter by ?status=booked|unbooked, ?currency, ?date_from / ?date_to, ?search (description or merchant name, case-insensitive), ?cash_account_id.
Use when: You need to walk a company's bank ledger: building a categorization queue, reconciling against external statements, or sampling for audit.
Don't use for: Looking up one transaction by id (use the detail endpoint). Reconciliation status (use /reconciliation/bank/status).
Pitfalls
- Default page size is 50. Pass ?limit=100 for the maximum. Cursor pagination: pass ?cursor=<next_cursor> from the previous response.
- Filter on status rather than journal_entry_id: a bulk-booked, split or batch-allocated transaction is booked with journal_entry_id null. status=unbooked leaves out ignored and private rows; without status every row is listed. is_business / category live on the transaction row even before booking.
- reverse-charge or storno entries can leave a transaction with journal_entry_id pointing at a cancelled JE: check status on the JE separately.
Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
status | "booked" | "unbooked" | no | booked: anchored to a verifikat (journal_entry_id, a bulk booking or split, or a batch allocation). unbooked: the work queue, not ignored, not private and anchored to no verifikat. Default: every row. |
currency | string | no | Only transactions in this currency code (e.g. SEK). |
date_from | string | no | YYYY-MM-DD. Transactions dated on or after this date. |
date_to | string | no | YYYY-MM-DD. Transactions dated on or before this date. |
search | string | no | Case-insensitive match anywhere in the description or merchant name, 1-200 characters. |
cash_account_id | string | no | Only transactions on this bank account (id from GET /cash-accounts). |
cursor | string | no | Opaque cursor from the previous page's meta.next_cursor. Omit for the first page. |
limit | number | no | Page size, 1-100 (default 50). Larger values are clamped to 100. |
Response fields
| Name | Type | Description |
|---|---|---|
[].id | string | |
[].handle | string (optional) | Typed handle of this bank transaction: txn_ plus its id as 32 lowercase hex. Accepted wherever the id is. |
[].date | string | |
[].description | string | null | |
[].amount | number | |
[].currency | string | |
[].reference | string | null | |
[].merchant_name | string | null | |
[].journal_entry_id | string | null | |
[].invoice_id | string | null | |
[].supplier_invoice_id | string | null | |
[].is_business | boolean | null | |
[].category | string | null | |
[].import_source | string | null | |
[].cash_account_id | string | null | |
[].created_at | string | |
[].pending_operation_id | string | null | The open proposal (a staged categorize or bulk booking, awaiting approval) that already holds this row; null when none does. Approve or reject that one: staging the row again answers TRANSACTION_ALREADY_STAGED. |
Example response
{
"data": [
{
"id": "a8f1…",
"date": "2026-05-12",
"description": "ICA MAXI",
"amount": -349.5,
"currency": "SEK",
"merchant_name": "ICA MAXI",
"journal_entry_id": null,
"is_business": null,
"category": null
}
],
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12",
"next_cursor": null
}
}
GET /api/v1/companies/:companyId/transactions/:id
transactions.get · scope transactions:read
Retrieve a single transaction by id.
Returns the full transaction record including match state, booking state, and import metadata.
Use when: You have a transaction id (from the list or a webhook) and need the full record before deciding to categorize, match, or attach a document.
Don't use for: Walking the ledger: use the list endpoint with a cursor. Fetching the linked invoice/journal entry: separate endpoints.
Pitfalls
- Both invoice_id (matched) and potential_invoice_id (suggested) can be set independently. The matched id is authoritative for accounting.
- reconciliation_method is null for transactions that have never been auto-reconciled. journal_entry_id may still be set via manual categorize.
- parts is the Bankgirot split of an Open Payments row (one part per payer or payee with the suggested invoice). With potential_match_method "bankgiro_split" every part resolved: settle them in one call with POST .../transactions/{id}/match-batch, one allocation per part (kind, the suggested invoice id, the part amount).
Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no
Response fields
| Name | Type | Description |
|---|---|---|
id | string | |
handle | string (optional) | Typed handle of this bank transaction: txn_ plus its id as 32 lowercase hex. Accepted wherever the id is. |
date | string | |
value_date | string | null (optional) | The bank's value date (valutadag); null when the feed sends none. |
description | string | null | |
original_description | string | null (optional) | The bank's verbatim text. description is the working title, which a person may have renamed. |
amount | number | |
currency | string | |
amount_sek | number | null | |
reference | string | null | |
merchant_name | string | null | |
counterparty_account | string | null | |
counterparty_iban | string | null (optional) | The counterparty's IBAN as the bank sent it (the payee of a foreign payment, the payer of an incoming transfer). |
counterparty_org_number | string | null (optional) | The counterparty's organisationsnummer, digits only, when the bank's enrichment names it. |
instructed_amount | number | null (optional) | The amount in the currency the payment was made in, when that differs from the account currency (a card purchase abroad). |
instructed_currency | string | null (optional) | The currency of instructed_amount. |
balance_after | number | null (optional) | The account balance after this transaction as the bank reports it; null for personal accounts and feeds that send none. |
is_enriched | boolean | null (optional) | Open Payments: the row has been through the bank's daily enrichment (payer name, organisationsnummer, OCR reference). Null when the bank sends no flag. |
journal_entry_id | string | null | |
invoice_id | string | null | |
supplier_invoice_id | string | null | |
potential_invoice_id | string | null | |
potential_supplier_invoice_id | string | null (optional) | The supplier invoice the matcher suggests this row pays. A suggestion: the matched supplier_invoice_id is authoritative. |
potential_journal_entry_id | string | null (optional) | The posted verifikat the bank matcher suggests this row is; potential_match_method says how. |
potential_match_confidence | number | null (optional) | |
exchange_rate | number | null (optional) | The Riksbank SEK rate of a foreign-currency row. |
exchange_rate_date | string | null (optional) | |
transaction_method | string | null (optional) | The payment rail (card, transfer, fee, ...); null when unclassified. |
title_edited_at | string | null (optional) | When a person renamed description; original_description keeps the bank's text. |
is_business | boolean | null | |
category | string | null | |
receipt_id | string | null | |
document_id | string | null | |
external_id | string | null | |
provider_transaction_id | string | null (optional) | The bank's own id for the row (bank feeds). external_id of a bank feed row is derived from its content, not the bank's id. |
end_to_end_id | string | null (optional) | The payer's end-to-end reference (ISO 20022), when the bank passes it on. |
import_source | string | null | |
reconciliation_method | string | null | |
cash_account_id | string | null | |
potential_match_method | string | null (optional) | "bankgiro_split" when the parts below all resolved to open invoices and sum to the amount: pass them as match-batch allocations. |
parts | object[] (optional) | The Bankgirot split of the row (Open Payments): one part per payer or payee, in the bank's order, with the invoice ingest suggests for each. Empty for a row without a split. |
created_at | string | |
updated_at | string |
Example response
{
"data": {
"id": "a8f1…",
"date": "2026-05-12",
"amount": -349.5,
"currency": "SEK",
"journal_entry_id": null,
"is_business": null
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/attach-document
transactions.attach-document · scope transactions:write
Pin a document (receipt, invoice) to a bank transaction as its underlag.
Pins the document to the transaction. On an unbooked transaction the pin rides along when it is categorized; on a booked one the document becomes the verifikat's underlag at once (BFL 5 kap 6 §). The inbox item the document came from is marked matched. A document sits on one transaction at a time: one that another unbooked transaction holds (its pin, or its inbox item matched there) moves here, and that transaction lets go of it (moved_from_transaction_ids). Attaching another document replaces the pin and is logged as a rättelse; on a booked transaction whose pin is already its verifikat's underlag, the pin stays and the document is added to that verifikat as one more underlag. Idempotent. Dry-runnable.
Use when: A receipt or invoice in the archive belongs to a bank transaction (same date, amount, counterparty).
Don't use for: Linking a document to a verifikat with no bank transaction (POST /documents/{id}/link) or uploading a file (POST /documents).
Pitfalls
- A document that asks for more than the transaction paid AND names another seller, or that names its seller and whose money goes the other way (a purchase on money in, a refund or credit note on money out), returns 409 DOC_ROW_MISMATCH with both sides in details; send mismatch_reason when it belongs anyway (an invoice paid in parts, a statement covering several payments).
- A document already underlag of ANOTHER verifikat, or held by another transaction that is booked (details.held_by_transaction_id), returns 409 DOC_ATTACH_OTHER_VERIFIKAT: it is never taken off a booked transaction. Details name that verifikat (journal_entry_id) and the one the transaction is booked on (transaction_journal_entry_id, null while unbooked). When one document backs both, link a copy to the transaction's verifikat: POST /documents/{id}/link with copy: true.
- A dry run lists the transactions the document would leave in moves_from_transaction_ids. One invoice paid in several parts does not stay on two unbooked transactions: book them, then link a copy to the second verifikat.
- A pinned document linked to a verifikat other than the transaction's own booking is never replaced: 409 DOC_ATTACH_REPLACES_POSTED. On the transaction's own verifikat the new document is added beside it (preview adds_to_verifikat; answer previous_document_id null).
- On a booked transaction in a locked period the pin is saved but the verifikat link is refused: 409 DOC_ATTACH_PERIOD_LOCKED. Adding beside a pin in a locked period writes nothing: PERIOD_LOCKED, as does a document that would have moved from another transaction (it stays where it is). A dry run, and so staging, answers PERIOD_LOCKED in all three cases.
- Check date, amount and counterparty on both sides first: once the transaction is booked the link is immutable.
Risk: medium · Idempotent: yes · Reversible: yes · Dry-run supported: yes · Stage for approval: yes (?stage=true)
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
stage | string | no | true stages the write for approval instead of committing it: 202 with the pending operation to approve via POST /pending-operations/{id}/approve. Absent or false commits; other values are 400. A reason in the body (why you propose it, at most 500 characters) is shown to the approver as agent_reason and kept with the decision. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
document_id | string | yes | The document id (document_id from the list or an upload). |
mismatch_reason | string | no | After DOC_ROW_MISMATCH: why it belongs here |
Response fields
| Name | Type | Description |
|---|---|---|
transaction_id | string | |
document_id | string | |
previous_document_id | string | null | The document the pin replaced, if any. |
journal_entry_id | string | null | The verifikat the document now belongs to when the transaction is already booked. |
moved_from_transaction_ids | string[] | The unbooked transactions the document sat on and left: it sits on one transaction at a time. Empty when it moved from none. |
Example request
{
"document_id": "4f1c…"
}
Example response
{
"data": {
"transaction_id": "1f2e…",
"document_id": "4f1c…",
"previous_document_id": null,
"journal_entry_id": null,
"moved_from_transaction_ids": []
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/categorize
transactions.categorize · scope transactions:write
Categorize a transaction and create the journal entry.
Resolves the BAS account mapping for the transaction (via category, booking template, or counterparty template), creates the corresponding verifikation, and updates the transaction with is_business / category / journal_entry_id. Idempotent on (transaction, key). Dry-runnable.
Use when: You're categorizing a bank transaction. Pass is_business: true plus either category, template_id (booking template), counterparty_template_id, or account_override. For private transactions, is_business: false is enough.
Don't use for: Matching a payment to an invoice: use :match-invoice or :match-supplier-invoice, on an unbooked transaction. Uncategorizing: :uncategorize.
Pitfalls
- A bank line the ledger already books (a booked sibling transaction, or a voucher booking the same amount on the bank account such as a supplier invoice marked paid) is refused with 409 TRANSACTION_BOOK_POSSIBLE_DUPLICATE and the candidate in
details.candidate: link the transaction to that verifikat instead. Only if it is a genuinely separate event, resend withforce: trueplusexpected_duplicate_journal_entry_id(orexpected_duplicate_transaction_id) echoing the candidate; a stale id returns TRANSACTION_BOOK_FORCE_CANDIDATE_MISMATCH. - A plain 244x (supplier payment) or 151x (customer receipt) categorization that an open invoice covers is refused with 409 TX_CATEGORIZE_SUGGEST_SI_MATCH / TX_CATEGORIZE_SUGGEST_CI_MATCH: match the invoice via
:match-supplier-invoice/:match-invoice, or passconfirm_no_match: trueto keep the plain categorization. - Already-categorized fast path: if the transaction already has a journal_entry_id, only flags get updated. The JE is immutable post-commit.
- account_override must exist and be active in the chart of accounts (else TX_CATEGORIZE_INVALID_ACCOUNT). It books the business side gross unless you also pass vat_treatment or vat_amount: the category default VAT is never carried onto an arbitrary account.
- vat_amount replaces the rate-based VAT line with the underlag's actual moms (e.g. dricks); it needs a rate-based treatment, else TX_CATEGORIZE_INVALID_VAT_AMOUNT.
- vat_treatment reverse_charge without reverse_charge_kind takes the box (20, 21 or 22) from the seller country on the row's underlag and the category; when they cannot tell it, 400 TX_CATEGORIZE_REVERSE_CHARGE_BOX_UNKNOWN (details.reason): send reverse_charge_kind. Never ruta 21 by default.
- A booking one of the company's blocks (booking review rules, Bokföringsregler > Spärrar in the app) matches is never booked from a key: it is staged for a person and answered 202 with the pending operation (staged_because BOOKING_REVIEW_REQUIRED). Approving it is web-only. With template_id or counterparty_template_id it cannot be staged and is refused with 409 BOOKING_REVIEW_REQUIRED.
Risk: medium · Idempotent: yes · Reversible: yes · Dry-run supported: yes
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
Request body
| Name | Type | Required |
|---|---|---|
is_business | boolean | yes |
category | "income_services" | "income_products" | "income_other" | "expense_equipment" | "expense_software" | "expense_travel" | "expense_office" | "expense_marketing" | "expense_professional_services" | "expense_education" | "expense_representation" | "expense_consumables" | "expense_vehicle" | "expense_telecom" | "expense_bank_fees" | "expense_card_fees" | "expense_currency_exchange" | "expense_other" | "private" | "uncategorized" | no |
template_id | string | no |
vat_treatment | "standard_25" | "reduced_12" | "reduced_6" | "reverse_charge" | "export" | "exempt" | no |
reverse_charge_kind | "eu_goods" | "eu_services" | "non_eu_services" | no |
vat_amount | number | no |
account_override | string | no |
counterparty_template_id | string | no |
dimensions | object | no |
user_description | string | no |
inbox_item_id | string | no |
proposal_id | string | no |
confirm_no_match | boolean | no |
confirm_foreign_seller_vat | boolean | no |
force | boolean | no |
expected_duplicate_transaction_id | string | no |
expected_duplicate_journal_entry_id | string | no |
Response fields
| Name | Type | Description |
|---|---|---|
success | boolean | |
journal_entry_created | boolean | |
journal_entry_id | string | null | |
journal_entry_error | string | null | Always null: a verifikat that cannot be created is refused with 409 TX_CATEGORIZE_JOURNAL_ENTRY_FAILED and nothing is written (issue #1947). Kept for response-shape compatibility. |
document_link_warning | string | null (optional) | |
category | string | |
already_had_journal_entry | boolean (optional) |
Example request
{
"is_business": true,
"category": "expense_office"
}
Example response
{
"data": {
"success": true,
"journal_entry_created": true,
"journal_entry_id": "je_…",
"category": "expense_office"
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/detach-document
transactions.detach-document · scope transactions:write
Take the pinned document off a bank transaction that is not booked against it.
Clears the transaction's document pin and releases the inbox item matched to it, so the next booking does not anchor the detached document. Refused once the document is linked to a verifikat (BFL 5 kap 6 §): only a storno undoes that. A transaction with no document answers success. Answers detached_document_id. Idempotent. Dry-runnable.
Use when: The wrong receipt was attached to a transaction that is not yet booked.
Don't use for: A booked transaction (reverse or uncategorize it first), deleting the document (DELETE /documents/{id}) or releasing an inbox item's match (POST /inbox-items/{id}/unmatch-transaction).
Pitfalls
- A document linked to a verifikat returns 409 DOC_DETACH_POSTED.
- A concurrent attach wins: the detach then answers 409 DOC_DETACH_CONCURRENT and changes nothing.
- The document itself stays in the archive.
Risk: low · Idempotent: yes · Reversible: yes · Dry-run supported: yes · Stage for approval: yes (?stage=true)
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
stage | string | no | true stages the write for approval instead of committing it: 202 with the pending operation to approve via POST /pending-operations/{id}/approve. Absent or false commits; other values are 400. A reason in the body (why you propose it, at most 500 characters) is shown to the approver as agent_reason and kept with the decision. |
Response fields
| Name | Type | Description |
|---|---|---|
transaction_id | string | |
document_id | unknown | |
detached_document_id | string | null | The document that was pinned, or null when none was. |
Example response
{
"data": {
"transaction_id": "1f2e…",
"document_id": null,
"detached_document_id": "4f1c…"
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/ignore
transactions.ignore · scope transactions:write
Ignore a bank transaction (no verifikat, allowed in locked periods).
Marks an unbooked bank transaction as ignored so it leaves the "to book" funnels and the reconciliation unmatched totals without creating a verifikat. Nothing is deleted and the flag is reversible with DELETE on the same path. Because no booking is written, a locked or closed fiscal period does not block it: this is the path for clearing rows that are not business events out of a closed period. A booked transaction (directly, via a payment allocation, or via a voucher link) is refused with 409 TX_IGNORE_ALREADY_BOOKED. Idempotent: ignoring an already-ignored row returns already_ignored: true. Dry-runnable.
Use when: The row is not an affärshändelse: a PSD2 ghost row, a duplicate from a bank reconnect, a transfer that never executed, rounding noise. Also the answer to TX_CATEGORIZE_PRIVATE_PERIOD_LOCKED from /categorize when the row should not be booked at all.
Don't use for: Real purchases, payments or owner withdrawals: those must be booked (categorize, match-invoice, or is_business: false in an open period). Ignoring is triage, not bookkeeping.
Pitfalls
- Idempotency-Key is mandatory.
- A booked row cannot be ignored: reverse it first (POST /transactions/{id}/uncategorize) or unlink the payment/voucher.
- Ignored rows still exist and are listed on the reconciliation bridge's ignored line; they never disappear silently.
Risk: low · Idempotent: yes · Reversible: yes · Dry-run supported: yes
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
Response fields
| Name | Type |
|---|---|
success | boolean |
transaction_id | string |
is_ignored | true |
already_ignored | boolean |
Example response
{
"data": {
"success": true,
"transaction_id": "tx_…",
"is_ignored": true,
"already_ignored": false
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/link-journal-entry
transactions.link-journal-entry · scope transactions:write
Link a bank transaction to a verifikat that already books it (no new bookkeeping).
Anchors the row to an existing POSTED journal entry: the row counts as booked and leaves the to-book list, and nothing new is posted. With invoice_id the customer invoice is also settled against that same verifikat (an invoice_payments row, status paid or partially_paid), same currency only. A dry run answers the result the link would produce. Idempotent. Dry-runnable.
Use when: The affärshändelse was already booked by hand (a manual verifikat, a payment registered before the bank row arrived) and the bank row must point at it instead of being booked twice.
Don't use for: Booking the row (POST /transactions/{id}/categorize), matching it to an invoice with a new payment verifikat (POST /transactions/{id}/match-invoice), or one row against several vouchers (reconciliation links).
Pitfalls
- A row already linked to a posted verifikat returns 409 LINK_TX_TX_ALREADY_LINKED; a pointer left by a storno does not count.
- The verifikat must be posted: LINK_TX_JE_NOT_POSTED otherwise.
- invoice_id: the invoice must be open (sent, overdue, partially_paid), not a credit note, and in the transaction currency (LINK_TX_INVOICE_CURRENCY_MISMATCH); cross-currency payments go through match-invoice.
- invoice_id: a row larger than what the invoice still owes returns 400 MATCH_AMOUNT_EXCEEDS_REMAINING, on a dry run too: nothing is written.
- invoice_id: the verifikat must settle the invoice on its own side (LINK_TX_INVOICE_SETTLEMENT_SIDE): a 151x credit for a booked invoice, including a kontantmetod invoice carried over the year end, a 19xx debit for a kontantmetod invoice never booked.
- Faktureringsmetoden with defer_invoice_booking (Registrera men bokför inte): when the invoice was sent without its verifikat and the linked verifikat clears 151x, the invoices :book step books the sale first (dated on the invoice date); sale_journal_entry_id names it and the dry run returns it as sale_entry. A verifikat that books the revenue itself (no 151x credit) is refused with LINK_TX_INVOICE_SETTLEMENT_SIDE before any sale is planned. When the book step refuses (PERIOD_LOCKED on the invoice date, INVOICE_BOOK_NO_FISCAL_PERIOD, INVOICE_BOOK_INVALID_STATUS for a partially paid invoice), the link is refused with that code, details.sale_first is true, and nothing is written.
Risk: medium · Idempotent: yes · Reversible: no · Dry-run supported: yes · Stage for approval: yes (?stage=true)
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
stage | string | no | true stages the write for approval instead of committing it: 202 with the pending operation to approve via POST /pending-operations/{id}/approve. Absent or false commits; other values are 400. A reason in the body (why you propose it, at most 500 characters) is shown to the approver as agent_reason and kept with the decision. |
Request body
| Name | Type | Required |
|---|---|---|
journal_entry_id | string | yes |
invoice_id | string | no |
Response fields
| Name | Type | Description |
|---|---|---|
transaction_id | string | |
journal_entry_id | string | |
voucher_label | string | Verifikat label, e.g. "A-12". |
invoice_id | string | null | |
invoice_status | "paid" | "partially_paid" | null | |
paid_amount | number | null | |
remaining_amount | number | null | |
sale_journal_entry_id | string (optional) |
Example request
{
"journal_entry_id": "4d2a…"
}
Example response
{
"data": {
"transaction_id": "a8f1…",
"journal_entry_id": "4d2a…",
"voucher_label": "A-12",
"invoice_id": null,
"invoice_status": null,
"paid_amount": null,
"remaining_amount": null
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/match-batch
transactions.match-batch · scope transactions:write
Book one bank payment against several customer invoices, or several supplier invoices, in one verifikat.
Allocates the transaction across N invoices of one kind: one samlingsverifikation (bank against 1510 or 2440, kursdifferens on 3960/7960 for foreign invoices, öresavrundning on 3740, a payment service's fees on their own cost lines) and one payment row per invoice, atomically. The allocations, less the fees for customer invoices or plus the fees for supplier invoices, must sum to the transaction amount. The dry run answers the exact lines (expected_lines) the verifikat would carry. Idempotent. Dry-runnable.
Use when: One incoming payment covers several customer invoices, or one outgoing transfer pays several supplier invoices.
Don't use for: One invoice (POST /transactions/{id}/match-invoice or match-supplier-invoice), mixing customer and supplier invoices, or several supplier invoices never booked under kontantmetoden.
Pitfalls
- A bank row in a foreign currency returns 400 BATCH_FOREIGN_CURRENCY: the verifikat is in kronor and this door does not read the row's SEK. Match it to one invoice at a time (match-invoice, match-supplier-invoice). A SEK row against foreign invoices works: state each allocation in kronor, within 10 % of what the invoice is booked at (BATCH_FX_DEVIATION_TOO_LARGE).
- The allocation amounts must sum to |amount| of the transaction: BATCH_AMOUNT_EXCEEDS_TX / BATCH_AMOUNT_BELOW_TX otherwise.
- fees books a payment service's fee on the row: a payout net of Stripe's or a card acquirer's fee (customer invoices: allocations - fees = |amount|) or a bank's charge added to a payment (supplier invoices: allocations + fees = |amount|). Each invoice is allocated what it owed. At most 5 rows, each a debit on an active BAS class 6 account (6570 Bankkostnader, 6040 Kontokortsavgifter) with no VAT, since a payment service is exempt (ML 10 kap. 33 §): BATCH_FEE_ACCOUNT_INVALID otherwise. The fees must be smaller than the invoices (BATCH_FEE_TOO_LARGE). A platform's commission is a taxable service, not a fee row: book it from the platform's invoice.
- A row that posted vouchers already explain (each invoice marked paid by hand) returns 409 BATCH_TX_POSSIBLE_DUPLICATE with the vouchers: link the row to them instead. force=true needs expected_journal_entry_ids naming exactly that set.
- Kontantmetoden: unbooked SEK customer invoices paid in full book their revenue and moms here (all or none, BATCH_CASH_LINES_MIXED). One unbooked supplier invoice allocated the whole row (no fees) is booked as match-supplier-invoice books it: cost and moms at payment, its lines in the dry run. Others return 400 BATCH_CASH_METHOD_UNBOOKED_INVOICE.
- Faktureringsmetoden with defer_invoice_booking (Registrera men bokför inte): each supplier invoice registered without its verifikat is booked first by the supplier-invoices :book step (dated on its invoice date), then the samlingsverifikation clears its 2440; registration_journal_entry_ids names them and the dry run shows them as registration_entries. A refusal of the book step (PERIOD_LOCKED on an invoice date, SI_BOOK_NO_FISCAL_PERIOD, SI_ACCRUED_COST_PERIOD_LOCKED, SI_BOOK_INVALID_STATUS for a partially paid invoice) refuses the batch with that code and details.registration_first, before anything is booked.
- Faktureringsmetoden with defer_invoice_booking (Registrera men bokför inte): each customer invoice sent without its verifikat gets its sale booked first by the invoices :book step (dated on its invoice date), then the samlingsverifikation clears its 1510; sale_journal_entry_ids names them and the dry run shows them as sale_entries. A refusal of the book step (PERIOD_LOCKED on an invoice date, INVOICE_BOOK_NO_FISCAL_PERIOD, INVOICE_BOOK_INVALID_STATUS for a partially paid invoice) refuses the batch with that code and details.sale_first, before anything is booked.
- Proformas and quotes return 400 MATCH_INVOICE_NOT_INVOICE_TYPE.
Risk: high · Idempotent: yes · Reversible: no · Dry-run supported: yes · Stage for approval: yes (?stage=true)
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
stage | string | no | true stages the write for approval instead of committing it: 202 with the pending operation to approve via POST /pending-operations/{id}/approve. Absent or false commits; other values are 400. A reason in the body (why you propose it, at most 500 characters) is shown to the approver as agent_reason and kept with the decision. |
Request body
| Name | Type | Required |
|---|---|---|
allocations | object[] | yes |
force | boolean | no |
expected_journal_entry_ids | string[] | no |
fees | object[] | no |
Response fields
| Name | Type |
|---|---|
journal_entry_id | string |
voucher_series | string |
voucher_number | number |
allocations | object[] |
total_allocated | number |
leftover | number |
total_fees | number (optional) |
registration_journal_entry_ids | object (optional) |
sale_journal_entry_ids | object (optional) |
Example request
{
"allocations": [
{
"kind": "customer_invoice",
"invoice_id": "2b1c…",
"amount": 500
},
{
"kind": "customer_invoice",
"invoice_id": "3c2d…",
"amount": 750
}
]
}
Example response
{
"data": {
"journal_entry_id": "4d2a…",
"voucher_series": "A",
"voucher_number": 12,
"allocations": [],
"total_allocated": 1250,
"leftover": 0
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/match-invoice
transactions.match-invoice · scope transactions:write
Match a positive bank transaction to a customer invoice.
Confirms an invoice match for a transaction. Creates the payment journal entry, links the transaction, updates the invoice status (paid / partially_paid) and inserts into invoice_payments. A transaction that is already booked is refused, never reversed here. Idempotent.
Use when: You have a bank receipt and a known open invoice it pays. The transaction must be positive (income), unbooked and not ignored.
Don't use for: Categorizing a transaction without an invoice: use :categorize. Matching to a supplier invoice: use :match-supplier-invoice. Bulk auto-match: use POST /reconciliation/bank/run.
Pitfalls
- Proforma + delivery notes are rejected (MATCH_INVOICE_NOT_INVOICE_TYPE): only document_type='invoice' can be matched.
- Transaction must be positive (amount > 0): negative transactions return MATCH_INVOICE_NOT_INCOME.
- Invoice must be in sent / overdue / partially_paid status: paid or draft invoices return MATCH_INVOICE_NOT_OPEN. An invoice with an active credit note returns MATCH_INVOICE_CREDIT_NOTE.
- A transaction that is already booked returns 409 MATCH_INVOICE_TX_ALREADY_BOOKED and nothing is written: its pointer or a bank_line link names a posted verifikat, it is linked to an existing verifikat, or a posted verifikat was booked from it without being linked to it. details names it (journal_entry_id, voucher, via: pointer, link, reconciliation, named for that last case, or concurrent when another booking took the transaction first) and says in undo how to open the transaction: uncategorize (POST /transactions/{id}/uncategorize), unlink (the reconciliation unlink: the verifikat stays posted) or reverse_voucher (a storno of the verifikat, which releases every transaction on it). On via named, when the verifikat is the booking of this transaction, link the two instead (POST /transactions/{id}/link-journal-entry). If the verifikat already is this payment, do not match: link the invoice to it (gnubok_link_invoice_to_voucher, or the invoice page). Before 2026-11-01 this endpoint reversed a categorization without being asked and booked a second verifikat on a transaction booked through a voucher link.
- An ignored transaction returns 409 BANK_ROW_IGNORED: restore it first (DELETE /transactions/{id}/ignore).
- A failed read of the transaction returns 503 BANK_ROW_READ_FAILED: nothing was booked, retry the same request.
- Kontantmetoden: an invoice never booked at issue is matched only by one payment of its whole amount. A partial payment, or the final payment of an invoice already part-paid, returns INVOICE_PAID_CASH_PARTIAL_UNSUPPORTED (details.reason partial_payment | previously_partially_paid); book that payment as a manual journal entry.
- Faktureringsmetoden with defer_invoice_booking (Registrera men bokför inte): an invoice sent without its verifikat is booked first by the invoices :book step (dated on the invoice date), then the payment clears that 1510; sale_journal_entry_id names it. When the book step refuses (PERIOD_LOCKED on the invoice date, INVOICE_BOOK_NO_FISCAL_PERIOD, INVOICE_BOOK_INVALID_STATUS for a partially paid invoice) or the transaction date is locked (PERIOD_LOCKED with details.payment_date), the match is refused with that code, details.sale_first is true, and nothing is booked.
- Idempotency-Key is mandatory.
Risk: high · Idempotent: yes · Reversible: no · Dry-run supported: no
Request body
| Name | Type | Required |
|---|---|---|
invoice_id | string | yes |
force | boolean | no |
expected_journal_entry_id | string | no |
lines | object[] | no |
manual_exchange_rate | number | no |
Response fields
| Name | Type | Description |
|---|---|---|
success | boolean | |
invoice_status | string | |
paid_at | string | null | |
paid_amount | number | |
remaining_amount | number | |
journal_entry_id | string | null | |
sale_journal_entry_id | string (optional) | The sale verifikat this match booked first (defer_invoice_booking); absent when none was booked. |
category | string | null |
Example request
{
"invoice_id": "inv_…"
}
Example response
{
"data": {
"success": true,
"invoice_status": "paid",
"paid_amount": 12500,
"remaining_amount": 0,
"journal_entry_id": "je_…",
"category": null
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/match-supplier-invoice
transactions.match-supplier-invoice · scope transactions:write
Match a negative bank transaction to a supplier invoice.
Confirms a supplier invoice payment match. Creates the payment journal entry (accrual: 2440 debit, credit on the transaction's own settlement account, 1930 when unlinked; cash-method: collapsed registration+payment), updates supplier_invoices, inserts a supplier_invoice_payments row, and links the transaction. Handles FX differences for cross-currency payments (7960 gain / 3960 loss), a bank fee paid on top of the invoice (6570) and öresavrundning on a whole-krona SEK payment (3740). Same payment plan and verifikat as the dashboard match.
Use when: You have a bank payment and a known open supplier invoice. The transaction must be negative (expense) and not yet booked.
Don't use for: Categorizing a direct supplier expense without an invoice: use :categorize. Matching to a customer invoice: use :match-invoice. Bulk auto-match: POST /reconciliation/bank/run.
Pitfalls
- Cash-method companies can settle a foreign invoice in full (booked at the payment-date rate); only a PARTIAL cash-method payment across currencies is rejected (MATCH_SI_CASH_FX_UNSUPPORTED): pay in full, switch to accrual, or book manually.
- Öresavrundning (both accounting methods): a SEK bank row less than 1 kr off the remaining balance of a SEK invoice (a whole-krona payment of an öre total) settles it in full. The payment account is credited with the bank amount and the residual is booked on 3740 (no VAT); paid_amount records the debt settled, not the cash moved. A shortfall of 1 kr or more is a partial payment (on a never-booked cash-method invoice it returns SI_CASH_PARTIAL_UNSUPPORTED).
- Bank fee on top: a same-currency row that pays more than the remaining balance settles the invoice in full; 2440 is cleared by the remaining balance only and the excess (up to 5 000 kr) is booked on 6570 and returned as bank_fee_sek (0 when there is none, and always 0 with custom lines, which book what they say). paid_amount never exceeds the invoice total. Check bank_fee_sek: a large one usually means the row pays another invoice too.
- A same-currency excess above the fee cap returns 400 MATCH_SI_AMOUNT_EXCEEDS_REMAINING and books nothing: allocate the payment across several invoices with POST /transactions/{id}/match-batch. Like every refusal, it runs before a categorization is reversed with storno_existing. A cross-currency match is not capped: it settles the remaining balance and books the whole SEK difference as kursdifferens (7960/3960).
- Faktureringsmetoden with defer_invoice_booking (Registrera men bokför inte): a supplier invoice registered without its verifikat is booked first by the supplier-invoices :book step (Debit cost + 2641 / Credit 2440, dated on the invoice date), then the payment clears that 2440; registration_journal_entry_id names it (null when nothing was booked first). When the book step refuses (invoice date in a locked period PERIOD_LOCKED, no fiscal year SI_BOOK_NO_FISCAL_PERIOD, a locked accrual month SI_ACCRUED_COST_PERIOD_LOCKED, a partially paid invoice SI_BOOK_INVALID_STATUS), the match is refused with that code, details.registration_first is true, and nothing is booked or reversed.
- A transaction that is already booked is refused with 409 MATCH_SI_TX_ALREADY_BOOKED and nothing is written: its pointer or a bank_line link names a posted verifikat, it is linked to an existing verifikat, or a posted verifikat was booked from it without being linked to it. details names it (journal_entry_id, voucher, via: pointer, link, reconciliation, named for that last case, or concurrent when another booking took the transaction first). When details.storno_allowed is true the booking is the transaction's own categorization: resend with storno_existing: true to reverse it (storno) and book the payment, after every other check has passed. A samlingsverifikat, a split or a reconciliation link is never reversed here: unlink or correct it first. Before 2026-10-28 this endpoint reversed a categorization without being asked and re-pointed a reconciliation link.
- A failed read of the transaction returns 503 BANK_ROW_READ_FAILED: nothing was booked, retry the same request.
- A posted verifikat that already books this payment (same SEK amount on the transaction's settlement account within 7 days, linked to no other transaction, e.g. a payment booked by hand) is refused with 409 MATCH_SI_POSSIBLE_DUPLICATE and nothing is written; details.candidate names it. Link the supplier invoice to that verifikat instead (POST /supplier-invoices/{id}/link-to-voucher), or, when the transaction is a separate payment, resend with force: true and expected_journal_entry_id set to details.candidate.journal_entry_id (a fresh Idempotency-Key). A stale id returns 409 MATCH_SI_FORCE_CANDIDATE_MISMATCH.
- Transaction must be negative (amount < 0). Positive returns MATCH_SI_NOT_EXPENSE.
- Supplier invoice must NOT be paid/credited already. paid/credited returns MATCH_SI_ALREADY_PAID; registered/approved/partially_paid/overdue are matchable.
- Idempotency-Key is mandatory.
Risk: high · Idempotent: yes · Reversible: no · Dry-run supported: no
Request body
| Name | Type | Required |
|---|---|---|
supplier_invoice_id | string | yes |
lines | object[] | no |
storno_existing | boolean | no |
force | boolean | no |
expected_journal_entry_id | string | no |
Response fields
| Name | Type |
|---|---|
success | boolean |
invoice_status | string |
paid_amount | number |
remaining_amount | number |
journal_entry_id | string | null |
bank_fee_sek | number |
registration_journal_entry_id | string | null |
Example request
{
"supplier_invoice_id": "si_…"
}
Example response
{
"data": {
"success": true,
"invoice_status": "paid",
"paid_amount": 5000,
"remaining_amount": 0,
"journal_entry_id": "je_…",
"bank_fee_sek": 0,
"registration_journal_entry_id": null
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/refresh-exchange-rate
transactions.refresh-exchange-rate · scope transactions:write
Fill in the Riksbanken rate and SEK amount of an unbooked foreign-currency transaction.
For an unbooked non-SEK row with no amount_sek/exchange_rate, fetches the Riksbanken rate for the transaction date and stores amount_sek, exchange_rate and exchange_rate_date. A SEK row, or one that already has both, is answered unchanged with refreshed=false. Idempotent. Dry-runnable (the dry run does not call Riksbanken).
Use when: A foreign-currency row shows no SEK amount (the rate lookup failed at ingest) and it is about to be booked.
Don't use for: Booked rows (the verifikat carries the rate; correct it with storno) or overriding a rate that is already set.
Pitfalls
- A booked row returns 409 TX_EXCHANGE_RATE_BOOKED.
- Riksbanken unavailable returns 502 TX_EXCHANGE_RATE_UNAVAILABLE (retryable).
Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: yes
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
Response fields
| Name | Type | Description |
|---|---|---|
transaction_id | string | |
currency | string | |
amount | number | |
amount_sek | number | null | |
exchange_rate | number | null | |
exchange_rate_date | string | null | |
refreshed | boolean | False when nothing was needed (SEK, or the rate was already there). |
Example response
{
"data": {
"transaction_id": "a8f1…",
"currency": "EUR",
"amount": -100,
"amount_sek": -1150.4,
"exchange_rate": 11.504,
"exchange_rate_date": "2026-05-12",
"refreshed": true
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/:id/uncategorize
transactions.uncategorize · scope transactions:write
Reverse the categorization of a transaction (storno + reset).
Storno the transaction's journal entry (BFL 5 kap 5 §: posted entries are never deleted, only cancelled via a reversing entry) and reset is_business / category / journal_entry_id on the transaction row. Idempotent: a second call on an already-uncategorized transaction returns 400 TX_UNCATEGORIZE_NOT_BOOKED. Dry-runnable.
Use when: You categorized a transaction by mistake and want to redo it from scratch. The storno keeps the audit trail intact.
Don't use for: Changing the categorization of an already-booked transaction: categorize again instead (the second call sees journal_entry_id and only updates flags). Reversing a payment match: there is no v1 verb for that yet.
Pitfalls
- Idempotency-Key is mandatory.
- The storno creates a new (cancelling) journal entry. The original entry stays in the ledger marked as cancelled: voucher gaps are documented automatically.
- A transaction without a journal_entry_id returns 400 TX_UNCATEGORIZE_NOT_BOOKED: there is nothing to reverse.
Risk: medium · Idempotent: yes · Reversible: no · Dry-run supported: yes
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
Response fields
| Name | Type |
|---|---|
success | boolean |
reversed_journal_entry_id | string |
Example response
{
"data": {
"success": true,
"reversed_journal_entry_id": "je_…"
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/batch-categorize
transactions.batch-categorize · scope transactions:write
Categorize up to 100 transactions in one call (partial-success).
Per-item categorization mirroring the single :categorize endpoint. Same { results, summary } shape as the other bulk endpoints. all_or_nothing: true returns 501 NOT_IMPLEMENTED. Idempotent over the whole batch.
Use when: You have many transactions to categorize with the same logic (e.g. apply a booking template across a queue, mark a batch as private, override accounts on a series).
Don't use for: Categorizing transactions with mixed logic: make multiple :categorize calls. Auto-categorization via templates: handled inside ingest for matching rows, no separate endpoint needed.
Pitfalls
- Max 100 items per call. Sequential processing.
- Idempotency-Key covers the WHOLE batch: replays return the cached full response.
- all_or_nothing: true returns 501 NOT_IMPLEMENTED. Today only partial-success batches exist.
- Per item, the same double-booking guards as
:categorize: TRANSACTION_BOOK_POSSIBLE_DUPLICATE (the ledger already books that bank line; override per item withforce: trueplus the echoedexpected_duplicate_journal_entry_id/expected_duplicate_transaction_id) and TX_CATEGORIZE_SUGGEST_SI_MATCH / TX_CATEGORIZE_SUGGEST_CI_MATCH (an open invoice covers a plain 244x / 151x categorization; override withconfirm_no_match: true). An item never dedupes against a verifikat booked earlier in the same batch. - Per item as on
:categorize: reverse_charge without reverse_charge_kind takes the box from the seller country on that row's underlag, else the item fails with TX_CATEGORIZE_REVERSE_CHARGE_BOX_UNKNOWN.
Risk: medium · Idempotent: yes · Reversible: yes · Dry-run supported: yes
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
Request body
| Name | Type | Required |
|---|---|---|
items | object[] | yes |
all_or_nothing | boolean | no |
Response fields
| Name | Type |
|---|---|
results | object[] |
summary | object |
Example request
{
"items": [
{
"transaction_id": "tx_1",
"categorization": {
"is_business": true,
"category": "expense_office"
}
}
]
}
Example response
{
"data": {
"results": [
{
"ok": true,
"request_index": 0,
"transaction_id": "tx_1",
"data": {
"journal_entry_id": "je_…"
}
}
],
"summary": {
"total": 1,
"succeeded": 1,
"failed": 0
}
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/bulk-book
transactions.bulk-book · scope transactions:write
Book several SEK bank transactions as one samlingsverifikat, or link them to one posted verifikat.
Puts up to 200 transactions on ONE verifikat (samlingsverifikation, BFL 5 kap 6 §), in exactly one of three ways: existing_journal_entry_id links them to an already-posted voucher whose bank net equals their sum (nothing new is posted; the rows may be of several dates, e.g. a month of Stripe fee rows settled by the verifikat of Stripe's monthly fee invoice); template_id + mode + entry_description expands a booking template per row (one_line_per_tx) or on the sum (sum_per_account); manual_lines + entry_description posts caller-built balanced lines. A new verifikat needs rows of one date. SEK only. The dry run answers the lines and the signed sum (tx_sum). Idempotent. Dry-runnable.
Use when: Many small same-day rows of one kind (Swish sales, card fees, a daily settlement) should be one verifikat, or one posted verifikat settles rows of several days (a samlingsfaktura of at most a month, such as Stripe's monthly fee invoice).
Don't use for: A new verifikat over rows of several dates (a monthly samlingsverifikat is not legal: one per date), foreign-currency rows (book them one by one), or one row against invoices (POST /transactions/{id}/match-batch).
Pitfalls
- All rows must share one direction and currency SEK, and one date unless they are linked to an existing verifikat: BULK_BOOK_DATE_MISMATCH / BULK_BOOK_DIRECTION_MISMATCH / BULK_BOOK_MIXED_CURRENCY / BULK_BOOK_FOREIGN_CURRENCY otherwise.
- A row that looks already booked returns 409 TRANSACTION_BOOK_POSSIBLE_DUPLICATE naming it; resend with force=true only after reviewing the candidate (each dismissal is logged in behandlingshistorik).
- manual_lines accounts must be active in the company's chart (BULK_BOOK_INVALID_ACCOUNT) and balance; amounts are kronor, account numbers strings.
- The lines on 1900-1999 must net to the rows' sum (BULK_BOOK_AMOUNT_MISMATCH), so a transfer between two own cash accounts is refused: categorize the row with account_override set to the other cash account, then link the other row with POST /transactions/{id}/link-journal-entry.
- default_dimensions tag the business lines only: the bank side and the moms lines stay untagged. A line's own dimensions are kept as given.
- A posted samlingsverifikat is permanent: undo with storno (POST /journal-entries/{id}/reverse).
Risk: high · Idempotent: yes · Reversible: no · Dry-run supported: yes · Stage for approval: yes (?stage=true)
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
stage | string | no | true stages the write for approval instead of committing it: 202 with the pending operation to approve via POST /pending-operations/{id}/approve. Absent or false commits; other values are 400. A reason in the body (why you propose it, at most 500 characters) is shown to the approver as agent_reason and kept with the decision. |
Request body
| Name | Type | Required |
|---|---|---|
tx_ids | string[] | yes |
existing_journal_entry_id | string | no |
template_id | string | no |
mode | "one_line_per_tx" | "sum_per_account" | no |
entry_description | string | no |
manual_lines | object[] | no |
default_dimensions | object | no |
force | boolean | no |
Response fields
| Name | Type | Description |
|---|---|---|
mode | "link_existing" | "create_new" | |
journal_entry_id | string | |
voucher_series | string | null | |
voucher_number | number | null | |
linked_tx_count | number | |
tx_sum | number | Signed SEK sum of the booked rows. |
docs_linked | number |
Example request
{
"tx_ids": [
"a8f1…",
"b9e2…"
],
"template_id": "5e4f…",
"mode": "sum_per_account",
"entry_description": "Swish-försäljning 2026-05-12"
}
Example response
{
"data": {
"mode": "create_new",
"journal_entry_id": "4d2a…",
"voucher_series": "A",
"voucher_number": 57,
"linked_tx_count": 2,
"tx_sum": 1250,
"docs_linked": 0
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
POST /api/v1/companies/:companyId/transactions/ingest
transactions.ingest · scope transactions:write
Bulk-ingest transactions (up to 500 per call).
Runs the same ingest pipeline as the dashboard CSV importer and the PSD2 bank sync: dedup, insert, invoice match, mapping-rule auto-categorize, auto-JE for high-confidence matches. Idempotent over the whole batch via Idempotency-Key. Dry-runnable.
Use when: You're importing transactions from a CSV, a custom bank feed, or an external accounting system. Each item must have a stable external_id: this is the primary dedup key.
Don't use for: Single ad-hoc transactions (use the dashboard). Documents/receipts (use the documents endpoint). Manually-created journal entries (Phase 4).
Pitfalls
- external_id is the primary dedup key: make it stable for the same physical transaction across reruns.
- Content-based dedup runs in addition: a row matching a stored transaction (booked, or unbooked from an import feed) by date, amount, currency, account AND description (prefix-containment, to survive PSD2 title enrichment) is skipped even if external_id differs. Each stored row absorbs at most one incoming row per call.
- Identical real movements (a bank that books several identical fees on one day) each need their own external_id. Sent in one call they are all imported; sent in a later call, alone, a new one is absorbed by a stored twin unless you set stable_external_ids=true. Set it only when the id is the bank's own per-booking reference (never for line numbers or content hashes) and keep one import_source per id scheme: if the scheme changes, change the label.
- A skipped row is never only counted: the response lists it in
skippedwith its reason (external_id_match, content_match_booked, content_match_unbooked) and the stored transaction it matched. Treat a content_match on a row you know is new as a missing transaction and alert on it. - raw_insert_only=true skips ALL post-insert pipeline steps (matching, categorization). Use for viewer-only imports.
- Max 500 items per call. For larger imports, split into pages of 500.
- Dry-run runs the same dedup decision as the commit, row by row, with the same reasons. It differs only if the stored transactions change in between.
Risk: medium · Idempotent: yes · Reversible: no · Dry-run supported: yes
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
transactions | object[] | yes | |
skip_auto_categorization | boolean | no | |
settlement_account | string | no | |
raw_insert_only | boolean | no | |
stable_external_ids | boolean | no | Set true only when every external_id is the bank's own per-booking reference: the same booking always arrives under the same id, and a different id is a different booking. A stored transaction from the same import_source under another id is then never treated as a copy of an incoming row. Requires the same import_source on every row. |
Response fields
| Name | Type | Description |
|---|---|---|
imported | number | |
duplicates | number | Rows skipped as already stored: the length of skipped. |
duplicates_by_reason | object | duplicates split by reason. A content match is a judgement call; an external_id match is an exact key. |
skipped | object[] | Every row that was NOT imported because it is judged already stored, in request order. |
reconciled | number | |
auto_categorized | number | |
auto_matched_invoices | number | |
errors | number | |
transaction_ids | string[] |
Example request
{
"transactions": [
{
"date": "2026-05-12",
"description": "ICA MAXI",
"amount": -349.5,
"currency": "SEK",
"external_id": "csv-line-42",
"merchant_name": "ICA MAXI"
}
]
}
Example response
{
"data": {
"imported": 1,
"duplicates": 0,
"duplicates_by_reason": {
"external_id_match": 0,
"content_match_booked": 0,
"content_match_unbooked": 0
},
"skipped": [],
"reconciled": 0,
"auto_categorized": 0,
"auto_matched_invoices": 0,
"errors": 0,
"transaction_ids": [
"5b1f6c1e-8a3d-4f0e-9a51-2f6d0c9b7e10"
]
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
PATCH /api/v1/companies/:companyId/transactions/:id
transactions.update · scope transactions:write
Edit an unbooked transaction: its working title, or which bank account it belongs to.
description replaces the working title (the bank's original stays in original_description; sending it back restores the "not edited" state). account_number (a BAS 19xx account of one of the company's cash accounts, as a string) moves the row to that account, for rows that landed on the wrong account or on none; a disabled, unconnected target is turned back on. Only rows that are neither booked nor matched. Idempotent. Dry-runnable.
Use when: A bank label is cryptic and the user wants a readable title before booking, or a row sits under the wrong bank account and can never be reconciled there.
Don't use for: Booked rows (reverse the verifikat and rebook), changing the amount or date (bank data is never edited), or categorizing (POST /transactions/{id}/categorize).
Pitfalls
- Send at least one of description or account_number.
- A booked or matched row returns 409 TRANSACTION_TITLE_LOCKED (title) or TRANSACTION_MOVE_BOOKED (move); a row bulk-booked into a samlingsverifikat also returns TRANSACTION_MOVE_BOOKED for a move.
- account_number is a STRING like "1931", never a number; an account that is not one of the company's cash accounts returns 404 TRANSACTION_MOVE_UNKNOWN_ACCOUNT, one in another currency 400 TRANSACTION_MOVE_CURRENCY_MISMATCH.
- A row never moves between a bank account and a company card (400 TRANSACTION_MOVE_KIND_MISMATCH): a card stores purchases with the opposite sign of its statement; undo the import and import the file to the right account.
- A bank-feed row cannot move onto another bank account's cash account: 409 TRANSACTION_MOVE_OTHER_BANK_ACCOUNT names the account it was fetched from. To put a whole bank account on another ledger account, change it in the bank settings.
Risk: low · Idempotent: yes · Reversible: yes · Dry-run supported: yes
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
description | string | no | New working title (1-500 characters). |
account_number | string | no | Target cash account by its ledger account: BAS 19xx, e.g. "1931", or a company card's account for a row on a card. |
Response fields
| Name | Type | Description |
|---|---|---|
id | string | |
handle | string (optional) | Typed handle of this bank transaction: txn_ plus its id as 32 lowercase hex. Accepted wherever the id is. |
description | string | null | |
title_edited_at | string | null | |
cash_account_id | string | null |
Example request
{
"description": "Lunch med kund"
}
Example response
{
"data": {
"id": "a8f1…",
"description": "Lunch med kund",
"title_edited_at": "2026-06-01T10:00:00Z",
"cash_account_id": "7f3a…"
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
DELETE /api/v1/companies/:companyId/transactions/:id
transactions.delete · scope transactions:write
Delete an unbooked transaction that was added by hand (e.g. a duplicate you created).
Hard-deletes one transaction the company created in Accounted (manual entry or POST /transactions/ingest). Bank-synced and bank-file rows are an external record of money that moved and are never deleted: ignore them (POST /transactions/{id}/ignore). A booked or matched row is räkenskapsinformation and is never deleted either: unlink it or reverse (storno) its verifikat. Idempotent. Dry-runnable.
Use when: A manually added or API-ingested row is a mistake or a duplicate and has not been booked.
Don't use for: Rows from the bank feed or a bank file (POST /transactions/{id}/ignore), booked rows (unlink, or reverse the verifikat), or undoing a whole bank file (POST /imports/bank/{id}/undo).
Pitfalls
- A booked or matched row returns 409 TRANSACTION_DELETE_BOOKED.
- A bank-synced or file-imported row returns 409 TRANSACTION_DELETE_IMPORTED: ignore it instead.
- A row with payment match history returns 409 TRANSACTION_DELETE_HAS_AUDIT_TRAIL at commit (the history is append-only); the dry run cannot see it.
Risk: medium · Idempotent: yes · Reversible: no · Dry-run supported: yes
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
Response fields
| Name | Type |
|---|---|
transaction_id | string |
deleted | true |
Example response
{
"data": {
"transaction_id": "a8f1…",
"deleted": true
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}
DELETE /api/v1/companies/:companyId/transactions/:id/ignore
transactions.unignore · scope transactions:write
Restore an ignored bank transaction to the "to book" list.
Clears the ignore flag set by POST on the same path. The row comes back into the unbooked list and the reconciliation unmatched totals; no verifikat was ever written, so there is nothing to reverse. Idempotent: restoring a row that is not ignored returns was_ignored: false. Dry-runnable.
Use when: A row was ignored by mistake and should be booked after all.
Don't use for: Undoing a booking: that is a storno via POST /transactions/{id}/uncategorize.
Pitfalls
- Idempotency-Key is mandatory.
Risk: low · Idempotent: yes · Reversible: yes · Dry-run supported: yes
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dry_run | string | no | true (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits. |
Response fields
| Name | Type |
|---|---|
success | boolean |
transaction_id | string |
is_ignored | false |
was_ignored | boolean |
Example response
{
"data": {
"success": true,
"transaction_id": "tx_…",
"is_ignored": false,
"was_ignored": true
},
"meta": {
"request_id": "req_…",
"api_version": "2026-05-12"
}
}