Menu

Supplier invoices

AP lifecycle: register, approve, book (deferred booking), mark paid, credit. With ROT/RUT and reverse-charge support.

Endpoints


GET /api/v1/companies/:companyId/supplier-invoices

supplier-invoices.list · scope suppliers:read

List supplier invoices for a company.

Cursor-paginated supplier-invoice list ordered by created_at DESC, id ASC (newest-registered first; the invoice_date column is the seller's invoice date and is filterable via ?date_from / ?date_to but is not the sort key). Filters: status, supplier_id, currency, date_from / date_to (filter by invoice_date).

Use when: You need to enumerate registered supplier invoices for an AP dashboard, a payment run, or a leverantörsreskontra reconciliation.

Don't use for: Fetching a single supplier invoice: use GET /supplier-invoices/{id}. Listing customer invoices (different resource).

Pitfalls

  • Credit notes (is_credit_note=true) appear in the same list as the originals; filter by status=credited or check the flag to separate.
  • remaining_amount is the unpaid portion; a partially_paid SI has remaining_amount > 0.
  • status does not say whether an invoice is attested (an attested invoice past its due date is overdue): read approved_at, which kontantmetoden companies leave null (no attest step there), or filter ?status=approved, which returns every attested invoice nothing is paid on, the overdue ones included. ?status=overdue also returns a part-paid invoice past its due date. bank_entered_at is set while a payment entered at the bank by hand has not landed; it clears itself when a payment is recorded on the invoice.
  • An invoice a bank payment or a payment file already covers keeps its status (approved, overdue) and remaining_amount until the payment lands: read open_payment, null when nothing covers it. payment_order.provider_status RCVD means the payment waits at the bank unsigned.
  • arrival_number is internal book-keeping, not the seller's invoice number: use supplier_invoice_number for matching to received documents.
  • Ordering is by created_at (registration time), not invoice_date. A late-registered invoice appears where it was registered: filter on ?date_from / ?date_to when you care about the seller's invoice date.
  • Cursor pagination: pass ?cursor=<next_cursor> from the previous response. A stale or tampered cursor is ignored and the first page is returned again.

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no

Query parameters

NameTypeRequiredDescription
status"registered" | "approved" | "paid" | "partially_paid" | "overdue" | "disputed" | "credited" | "reversed"noOnly supplier invoices in this status. approved = attested and nothing paid yet, past due or not (the row's status may read overdue). overdue = past due with money left, a part-paid one included (its status reads partially_paid). Every other value matches the stored status.
supplier_idstringnoOnly invoices from this supplier (id).
currencystringno3-letter ISO 4217 code, uppercase (e.g. SEK, EUR).
date_fromstringnoYYYY-MM-DD. Invoices with invoice_date on or after this date.
date_tostringnoYYYY-MM-DD. Invoices with invoice_date on or before this date.
cursorstringnoOpaque cursor from the previous page's meta.next_cursor. Omit for the first page.
limitnumbernoPage size, 1-100 (default 50). Larger values are clamped to 100.

Response fields

NameTypeDescription
[].idstring
[].handlestring (optional)Typed handle of this supplier invoice: sinv_ plus its id as 32 lowercase hex. Accepted wherever the id is.
[].supplier_idstring
[].supplier_namestring
[].arrival_numbernumber
[].supplier_invoice_numberstring | null
[].invoice_datestring
[].due_datestring
[].status"registered" | "approved" | "paid" | "partially_paid" | "overdue" | "disputed" | "credited" | "reversed"
[].currencystring
[].subtotalnumber
[].vat_amountnumber
[].totalnumber
[].paid_amountnumber
[].remaining_amountnumber
[].is_credit_noteboolean
[].is_self_billedboolean
[].self_billing_numbernumber | null
[].self_billing_agreement_refstring | null
[].paid_atstring | null
[].approved_atstring | null
[].bank_entered_atstring | null
[].created_atstring
[].open_paymentobject | null

Example response

{
  "data": [
    {
      "id": "0e9c…",
      "supplier_id": "a8f1…",
      "supplier_name": "Office Depot AB",
      "arrival_number": 42,
      "supplier_invoice_number": "2026-1234",
      "invoice_date": "2026-05-10",
      "due_date": "2026-06-09",
      "status": "registered",
      "currency": "SEK",
      "subtotal": 1000,
      "vat_amount": 250,
      "total": 1250,
      "paid_amount": 0,
      "remaining_amount": 1250,
      "is_credit_note": false,
      "paid_at": null,
      "approved_at": null,
      "bank_entered_at": null,
      "created_at": "2026-05-13T15:00:00Z",
      "open_payment": null
    }
  ],
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12",
    "next_cursor": null
  }
}

GET /api/v1/companies/:companyId/supplier-invoices/:id

supplier-invoices.get · scope suppliers:read

Retrieve a single supplier invoice by id.

Returns the full supplier-invoice record. Pass ?expand=supplier,items,payments to embed the related rows in the same response.

Use when: You need the full record before approving, paying, or crediting it, or for audit trail / reconciliation.

Don't use for: Listing supplier invoices (use the list endpoint). Customer-invoice lookups (different resource).

Pitfalls

  • Credit notes return is_credit_note=true and a credited_invoice_id pointing at the original.
  • A self-billing invoice (is_self_billed=true) is one the company issued in the supplier's name: supplier_invoice_number is the company's own series number and the document is GET .../self-billing-pdf.
  • registration_journal_entry_id and payment_journal_entry_id let you trace the SI to its bokföring rows; they are null when no JE has been posted (e.g. on a kontantmetoden SI before payment).
  • status does not say whether an invoice is attested (an attested invoice past its due date is overdue): read approved_at, which kontantmetoden companies leave null (no attest step there). bank_entered_at is set while a payment entered at the bank by hand has not landed; it clears itself when a payment is recorded on the invoice.

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no

Query parameters

NameTypeRequiredDescription
expandstringnoComma-separated related records to embed: supplier, items, payments. An unknown key returns 400 VALIDATION_ERROR.

Response fields

NameTypeDescription
idstring
handlestring (optional)Typed handle of this supplier invoice: sinv_ plus its id as 32 lowercase hex. Accepted wherever the id is.
supplier_idstring
arrival_numbernumber
supplier_invoice_numberstring | null
invoice_datestring
due_datestring
received_datestring
delivery_datestring | null
statusstring
currencystring
exchange_ratenumber | null
subtotalnumber
vat_amountnumber
totalnumber
vat_treatmentstring
reverse_chargeboolean
reverse_charge_kind"eu_goods" | "eu_services" | null
paid_amountnumber
remaining_amountnumber
is_credit_noteboolean
credited_invoice_idstring | null
is_self_billedboolean
self_billing_numbernumber | null
self_billing_agreement_refstring | null
registration_journal_entry_idstring | null
payment_journal_entry_idstring | null
notesstring | null
approved_atstring | null
bank_entered_atstring | null
created_atstring
updated_atstring

Example response

{
  "data": {
    "id": "0e9c…",
    "supplier_id": "a8f1…",
    "arrival_number": 42,
    "supplier_invoice_number": "2026-1234",
    "status": "registered",
    "currency": "SEK",
    "subtotal": 1000,
    "vat_amount": 250,
    "total": 1250,
    "remaining_amount": 1250,
    "is_credit_note": false
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

GET /api/v1/companies/:companyId/supplier-invoices/:id/attestations

supplier-invoices.attestations.list · scope suppliers:read

Where the attest of one supplier invoice stands: who attested, who is left, every decision.

Answers whether the attest policy requires attest for the invoice, whether it is satisfied, the attesters who approved in the current round and those whose approval would move it on (with their limits), how many approvals it still needs and whether one must come from an attester whose limit covers the amount, the latest rejection with its comment, every decision (approved or rejected, who, when, source app / email_link / api / mcp) and whether the API key's user may approve or reject it now. A rejection starts a new round: approvals before it no longer count. With förattest, stage and pre_attest say which step the invoice is at.

Use when: An invoice is left out of payment with attest_required, or before attesting.

Don't use for: The policy itself (GET /supplier-invoices/attest-policy).

Pitfalls

  • An invoice of another company answers 404 SI_NOT_FOUND.

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no

Response fields

NameTypeDescription
supplier_invoice_idstring
requiredbooleanThe policy requires attest for this invoice.
satisfiedbooleanAttested: approved_at is set, or the policy is satisfied.
blockedbooleanNobody may attest the invoice under the policy (for example the only attester registered it).
approved_atstring | null
approved_byobject | null
approvedobject[]Attesters who approved in the current round.
remainingobject[]Who may give an approval that moves the invoice on at the step it is at (only those with a covering limit when that is what is missing), and the substitutes standing in for them.
amount_seknumber | nullThe invoice total in SEK the limits are judged against; null for a foreign invoice without a rate.
steps1 | 2How many different attesters the invoice needs: 2 from the policy's two_step_from_sek.
approvals_needednumberHow many more approvals the invoice needs; 0 once attested.
needs_coveringbooleanOne of the missing approvals must come from an attester whose limit covers amount_sek.
stage"pre" | "final" | nullWith förattest: pre while a förattest is missing, final once the attest is what is left. Null without förattest or once attested.
pre_attestobject[]The förattests the invoice needs, in order; empty without förattest.
acts_forobject | nullThe attester the key's user would approve for, as their substitute; null in their own name.
latest_rejectionobject | null
attestationsobject[]
viewerobject

Example response

{
  "data": {
    "supplier_invoice_id": "0e9c…",
    "required": true,
    "satisfied": false,
    "blocked": false,
    "approved_at": null,
    "approved_by": null,
    "approved": [],
    "remaining": [
      {
        "user_id": "3f0c…",
        "name": "Anna Ek",
        "email": "anna@example.se",
        "limit_sek": null,
        "stands_in_for": null
      }
    ],
    "amount_sek": 12500,
    "steps": 1,
    "approvals_needed": 1,
    "needs_covering": true,
    "stage": null,
    "pre_attest": [],
    "acts_for": null,
    "latest_rejection": null,
    "attestations": [],
    "viewer": {
      "may_approve": false,
      "may_reject": false,
      "reason": "registrant"
    }
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

GET /api/v1/companies/:companyId/supplier-invoices/:id/self-billing-pdf

supplier-invoices.self-billing-pdf · scope suppliers:read

Download the self-billing invoice (självfaktura) PDF.

Returns the self-billing invoice the company issued in the supplier's name as application/pdf: "Självfakturering", the number from the company's own series, both parties, the agreement and the acceptance clause. A credit note of one renders as its kreditfaktura.

Use when: You need the document of a self-billing invoice (is_self_billed=true) to send to the supplier or archive outside Accounted.

Don't use for: An ordinary supplier invoice: its document is the supplier's own, in the document archive (document_id). That answers 404.

Pitfalls

  • Only for is_self_billed=true; any other supplier invoice answers 404 SI_NOT_FOUND.
  • Rendered from the parties frozen at issue, so later changes to the supplier card or the company settings do not change it.

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no

Example response

{
  "_note": "Returns application/pdf binary stream."
}

GET /api/v1/companies/:companyId/supplier-invoices/attest-policy

supplier-invoices.attest-policy.get · scope suppliers:read

Read the company's attest policy for supplier invoices.

Whether the policy is on, the amount in SEK from which attest is required (null = every invoice), the attesters with their limits in SEK (limit_sek, null = no limit), mode any (one attester is enough) or all (every attester who may attest the invoice), whether the person who registered an invoice may attest it, and two_step_from_sek: from that amount two different attesters must approve. Below it one approval by an attester whose limit covers the invoice is enough; at or above it two, at least one with a covering limit, in any order. Ordered steps: with förattest (pre_attesters, project_attesters per project code of dimension 6) every project on an invoice's lines first needs one approval by its attesters (lines without a project of their own by pre_attesters), and only then do the attesters attest; one person's approval counts once per invoice, so a förattestant does not also attest it. substitutes: while a period runs, the substitute attests wherever the attester may, as them. With the policy on, an invoice that needs attest is left out of bank payments and payment files until the policy is satisfied. Kontantmetoden has no attest step and the policy does not apply there.

Use when: Before attesting or preparing payments: who may attest, and why an invoice waits.

Don't use for: Where one invoice's attest stands (GET /supplier-invoices/{id}/attestations).

Pitfalls

  • A company that never saved a policy answers enabled false with no attesters.
  • With levels on (a limit or two_step_from_sek), an attest through an API key is capped by the lower of the key user's limit and the key's unattended ceiling.
  • A company without förattest and substitutes answers pre_attesters [], project_attesters [] and substitutes [].

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: no

Response fields

NameTypeDescription
enabledboolean
threshold_amountnumber | nullAttest is required at or above this total in SEK; null = every invoice.
mode"any" | "all"any: one attester is enough; all: every attester who may attest the invoice.
attestersobject[]
preparer_may_attestbooleanFalse: the person who registered an invoice cannot attest it.
two_step_from_seknumber | nullFrom this total in SEK two different attesters must approve, at least one with a covering limit; null = one is enough.
pre_attestersobject[]Förattest: one of them approves first an invoice (or a line) without a project of its own in project_attesters; empty = none.
project_attestersobject[]Förattest per project (dimension 6 code): every project on an invoice's lines needs one approval by one of its attesters before the attesters may attest.
substitutesobject[]Substitutes that run now or later.
updated_atstring | null

Example response

{
  "data": {
    "enabled": true,
    "threshold_amount": 5000,
    "mode": "any",
    "attesters": [
      {
        "user_id": "3f0c…",
        "name": "Anna Ek",
        "email": "anna@example.se",
        "limit_sek": 50000
      },
      {
        "user_id": "8b2d…",
        "name": "Bo Lind",
        "email": "bo@example.se",
        "limit_sek": null
      }
    ],
    "preparer_may_attest": false,
    "two_step_from_sek": 100000,
    "pre_attesters": [],
    "project_attesters": [
      {
        "project": "P100",
        "project_name": "Kv. Eken",
        "attesters": [
          {
            "user_id": "5a7e…",
            "name": "Cecilia Berg",
            "email": "cecilia@example.se"
          }
        ]
      }
    ],
    "substitutes": [
      {
        "substitute_id": "1c4f…",
        "user": {
          "user_id": "8b2d…",
          "name": "Bo Lind",
          "email": "bo@example.se"
        },
        "substitute": {
          "user_id": "3f0c…",
          "name": "Anna Ek",
          "email": "anna@example.se"
        },
        "starts_on": "2026-12-21",
        "ends_on": "2027-01-06",
        "active": false
      }
    ],
    "updated_at": "2026-10-14T09:00:00.000Z"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

POST /api/v1/companies/:companyId/supplier-invoices

supplier-invoices.create · scope suppliers:register

Register a new supplier invoice.

Creates a supplier invoice in registered status and posts the registration journal entry under faktureringsmetoden (Debit expense + Debit 2641 Ingående moms / Credit 2440 Leverantörsskulder). Under kontantmetoden no JE is posted at this stage, except for an EU goods acquisition (reverse_charge_kind eu_goods): ML 2023:200 7 kap. 26 § puts its reverse-charge moms in the period the invoice is issued whatever the accounting method, so it is booked like under faktureringsmetoden and its payment clears 2440. Under both methods an EU goods registration is dated on the invoice date, or on the 15th of the month after delivery_date when that is earlier (7 kap. 26 §: the moms belongs at the latest to the period holding that day); send delivery_date to apply it. Under defer_invoice_booking (faktureringsmetoden, Registrera men bokför inte) no JE is posted either: book it afterwards with POST /supplier-invoices/{id}/book. Idempotent (mandatory Idempotency-Key). Dry-runnable.

Use when: You're registering an incoming leverantörsfaktura. Use dry-run first to validate VAT calculations + period-lock state before committing.

Don't use for: Marking an existing SI as paid (use POST /:id/mark-paid). Issuing a credit note (use POST /:id/credit). Customer invoices (different resource).

Pitfalls

  • Idempotency-Key is mandatory.
  • A dry run answers the would-be verifikat in preview.verifikat (entry_date, lines with account_number, debit_amount, credit_amount), null when the registration posts none (kontantmetoden, defer_invoice_booking), and refuses what the commit refuses: a line account that is deactivated or not in BAS 2026 returns 400 ACCOUNTS_NOT_IN_CHART. A BAS account merely missing from the chart passes; the commit adds it.
  • invoice_date must fall within an open fiscal period: a date covered by a locked period or the company-wide bookkeeping lock returns 400 PERIOD_LOCKED.
  • Under faktureringsmetoden the registration JE is posted atomically with the SI row. JE failure aborts the whole call and no SI row is left behind (strict-mode).
  • supplier_id must reference an existing, non-archived supplier in the same company: 404 SUPPLIER_NOT_FOUND otherwise.
  • Duplicate (supplier_id, supplier_invoice_number) returns 409 SI_CREATE_DUPLICATE_INVOICE_NUMBER. Use the credit flow on the original instead of re-registering with a tweaked number.
  • Foreign currency: omit exchange_rate and the server fetches Riksbanken's rate for invoice_date (ML 8 kap 21-23 §). If no rate can be resolved the create is refused with 400 SI_FX_RATE_MISSING rather than stored unconverted: pass exchange_rate explicitly to proceed. A SEK invoice needs no rate and gets total_sek = total.
  • exchange_rate is SEK per 1 unit of the invoice currency and must satisfy 0 < rate < 100000, the same bounds the supplier_invoices CHECK enforces. Out-of-range values return 400 VALIDATION_ERROR; passing an invoice total where a rate belongs is the usual cause.
  • Project/cost-center tagging: pass default_dimensions ({"6":"P001"} = project, {"1":"KS01"} = kostnadsställe) for the whole invoice and/or items[].dimensions per line (per-line wins per key). Omitted default_dimensions takes the default_dimensions of the supplier; {} registers the invoice untagged. The registration JE lines are tagged accordingly. When the company has the dimension registry enabled, unknown or archived codes are rejected with 400 DIMENSION_VALIDATION_FAILED: list valid codes via GET /dimensions.
  • Tjänstepension invoices (Avanza etc.): set items[].apply_slp=true on the 741x premium line and the registration JE also books särskild löneskatt (debit 7533 / credit 2514 at 24.26% of the line amount) beyond the payable: 2440 stays at the invoice total. apply_slp on a non-741x account returns 400 SI_CREATE_SLP_INVALID_ACCOUNT.
  • Underlag: upload the invoice PDF with POST /documents first and pass its id as document_id. The document is stored on the invoice and linked to the registration verifikat. A document that is missing, belongs to another company, or is already linked returns 400 SI_CREATE_INVALID_INPUT.
  • Paid privately (eget utlägg): set paid_with_private_funds=true. The invoice is registered as paid and one verifikat books the expense against the payer: the owner (2893 AB, 2018 EF; claimant_name names them) or an employee (employee_id, 2820). payment_date is the out-of-pocket date (defaults to invoice_date). inbox_item_id takes the underlag from an inbox item and is only accepted on this path. With reverse charge the verifikat also books the fiktiv moms and basis pair the registration would, and the payer is owed the net. Not combinable with periodisering.
  • Reverse charge from a supplier in another EU country books the basis pair as services (4535/4598, momsdeklaration ruta 21) unless reverse_charge_kind says "eu_goods" (4515/4598, ruta 20); the fiktiv moms on 2645/2614 is the same. reverse_charge_kind on an invoice without reverse charge, or from a supplier that is not eu_business, returns 400 SI_CREATE_INVALID_INPUT.
  • Periodisering: items[].accrual_period_start + accrual_period_end (and optionally accrual_balance_account: omitted, 2990 (2960 for 84xx) for a period wholly before the invoice month, else a 17xx förutbetald kostnad by cost account) spread the cost over the period under faktureringsmetoden. A 17xx account for a period wholly before the invoice month returns 400 VALIDATION_ERROR: those months are an upplupen kostnad. Refused under kontantmetoden and with reverse charge. A 29xx accrual_balance_account (e.g. 2990) books an upplupen kostnad: a period wholly before the invoice month (a period reaching that month returns 400 VALIDATION_ERROR: split the line), each month booked on its last day (debit cost / credit 29xx) right after the registration, which debits 29xx on the invoice date. A month that is locked, closed, on or before the company lock date or without a fiscal year refuses the whole registration with 400 SI_ACCRUED_COST_PERIOD_LOCKED (details.blocked); nothing is written.
  • A company that is not VAT-registered cannot book input VAT: a line with vat_rate or vat_amount above 0 returns 400 SI_CREATE_INVALID_INPUT, and an omitted vat_rate defaults to 0. items[].vat_amount overrides line_total × vat_rate (partial deduction, rounding on the supplier's side).
  • VAT is booked per rate the way the invoice states it: on the summed base of each rate (not rounded line by line), or the per-rate figure in vat_breakdown ([{ vat_rate: 0.25, vat_amount: 3864.11 }]) when it lies within half an öre per line of that. The figure is spread over the lines (items[].vat_amount in the response, at most one öre from each line's own rounding) so they sum to it. A figure further off, a rate the lines do not carry or leave out, or a rate with an items[].vat_amount override returns 400 VAT_BREAKDOWN_MISMATCH.
  • due_date is optional: omitted, it is invoice_date plus the supplier's default_payment_terms (30 days when unset).
  • Självfaktura (self-billing, ML 17 kap 15 §): set is_self_billed=true and omit supplier_invoice_number. The company issues the invoice in the supplier's name: the number comes from the company's own series (company_settings.self_billing_prefix, SF-001, SF-002, ...), and the document (with "Självfakturering", the agreement and the acceptance clause) is archived as the underlag; download it with GET /supplier-invoices/{id}/self-billing-pdf. The agreement is self_billing_agreement_ref, defaulting to the supplier's; none gives 400 SI_SELF_BILL_AGREEMENT_MISSING. A supplier or company card missing a name, address, the seller's VAT number or the buyer's org number gives 400 SI_SELF_BILL_PARTY_INCOMPLETE. SEK only, standard Swedish VAT only, no reverse charge, no document_id, inbox_item_id or paid_with_private_funds: 400 SI_SELF_BILL_UNSUPPORTED (details.reason).

Risk: medium · Idempotent: yes · Reversible: yes · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Request body

NameTypeRequired
supplier_idstringyes
document_idstringno
supplier_invoice_numberstringno
is_self_billedbooleanno
self_billing_agreement_refstringno
invoice_datestringyes
due_datestringno
delivery_datestring | ""no
currency"SEK" | "EUR" | "USD" | "GBP" | "NOK" | "DKK" | "CHF" | "CAD"no
exchange_ratenumberno
vat_treatment"standard_25" | "reduced_12" | "reduced_6" | "reverse_charge" | "export" | "exempt"no
reverse_chargebooleanno
reverse_charge_kind"eu_goods" | "eu_services"no
payment_referencestringno
notesstringno
ore_roundingbooleanno
paid_with_private_fundsbooleanno
employee_idstring | nullno
claimant_namestringno
inbox_item_idstring | nullno
payment_datestringno
default_dimensionsobjectno
vat_breakdownobject[]no
itemsobject[]yes

Response fields

NameTypeDescription
idstring
handlestring (optional)Typed handle of this supplier invoice: sinv_ plus its id as 32 lowercase hex. Accepted wherever the id is.
supplier_idstring
arrival_numbernumber
supplier_invoice_numberstring
invoice_datestring
due_datestring
statusstring
currencystring
subtotalnumber
vat_amountnumber
totalnumber
remaining_amountnumber
is_credit_noteboolean
is_self_billedboolean
self_billing_numbernumber | null
self_billing_agreement_refstring | null
document_idstring | null
registration_journal_entry_idstring | null
created_atstring

Example request

{
  "supplier_id": "a8f1…",
  "supplier_invoice_number": "2026-1234",
  "invoice_date": "2026-05-10",
  "due_date": "2026-06-09",
  "default_dimensions": {
    "6": "P001"
  },
  "items": [
    {
      "description": "Office supplies",
      "amount": 1000,
      "account_number": "5410",
      "vat_rate": 0.25
    }
  ]
}

Example response

{
  "data": {
    "id": "0e9c…",
    "supplier_id": "a8f1…",
    "arrival_number": 42,
    "supplier_invoice_number": "2026-1234",
    "status": "registered",
    "total": 1250,
    "registration_journal_entry_id": "7b3a…"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

POST /api/v1/companies/:companyId/supplier-invoices/:id/approve

supplier-invoices.approve · scope suppliers:write

Approve a registered or overdue supplier invoice.

Attests a supplier invoice that has not been approved yet (status registered or overdue) as the API key's user. With the company's attest policy on (GET /supplier-invoices/attest-policy) only its attesters may attest, the registrant not unless the policy allows it, and in mode all the invoice is attested only when every attester has approved: until then the status stays and attest.remaining_user_ids names who is left. The resulting status is approved, or overdue when the invoice is still past its due date. No journal entry is posted here: the registration JE was already booked at :create under accrual (or, under defer_invoice_booking, is posted by POST /supplier-invoices/{id}/book), or is deferred to :mark-paid under cash. Idempotent. Dry-runnable.

Use when: A registered SI has been reviewed and you want to mark it ready for payment. With the attest policy on, payments leave an unattested invoice out (attest_required).

Don't use for: Posting a journal entry (already done at :create under accrual). Paying the SI (use :mark-paid). Re-approving an already-approved SI (returns 400 SI_APPROVE_NOT_REGISTERED).

Pitfalls

  • Idempotency-Key is mandatory.
  • Returns 400 SI_APPROVE_NOT_REGISTERED when the invoice is already approved (approved_at set) or sits in a settled status. Use the detail endpoint to inspect status first if unsure.
  • Returns 403 ATTEST_NOT_ALLOWED when the attest policy does not let this user attest the invoice (not an attester, or the registrant), and 409 ATTEST_ALREADY_GIVEN when the user already attested it in this round.
  • Returns 403 ATTEST_LIMIT_EXCEEDED when the user's attest limit does not cover the invoice and their approval cannot count (details.reason limit), or, with attest levels on, when the lower of the user's limit and the key's unattended ceiling does not cover it (details.reason key_limit). details.limit_sek and details.amount_sek say by how much.
  • From the policy's two_step_from_sek two different attesters must approve: the first approval keeps the status and attest.remaining_user_ids names who may give the second.
  • A still-past-due invoice comes back with status "overdue", not "approved": approved_at is the attest marker, the status is derived from the due date.

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Response fields

NameTypeDescription
idstring
handlestring (optional)Typed handle of this supplier invoice: sinv_ plus its id as 32 lowercase hex. Accepted wherever the id is.
status"approved" | "overdue" | "registered"
arrival_numbernumber
supplier_invoice_numberstring | null
approved_atstring | null
attestobject

Example response

{
  "data": {
    "id": "0e9c…",
    "status": "approved",
    "arrival_number": 42,
    "supplier_invoice_number": "2026-1234",
    "approved_at": "2026-10-14T09:00:00.000Z",
    "attest": {
      "approved": true,
      "required": true,
      "remaining_user_ids": []
    }
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

POST /api/v1/companies/:companyId/supplier-invoices/:id/bank-entered

supplier-invoices.mark-bank-entered · scope suppliers:write

Mark a supplier invoice as entered in the internet bank ("inlagd i banken"), or clear the mark.

Records that the payment was entered in the bank by hand, so the invoice stops showing as waiting to be paid. A mark, not a payment: it books nothing and changes no amount or status; the payment is still recorded by :mark-paid or the bank match, and the mark clears itself when one of those lands. entered=true needs an unpaid, payable invoice (approved, overdue, partially_paid, and registered under kontantmetoden, which has no attest step; never a credit note); entered=false clears it in any status. Marking an already marked invoice keeps the first timestamp. Idempotent. Dry-runnable.

Use when: The user paid the invoice by typing it into the internet bank (not through a betalfil) and wants the list to say so until the bank transaction arrives.

Don't use for: Recording the payment itself (POST /supplier-invoices/{id}/mark-paid) or payment batches (betalfil).

Pitfalls

  • A registered invoice still waiting for attest (faktureringsmetoden), a paid or credited invoice, or a credit note, answers 400 SI_BANK_ENTERED_NOT_PAYABLE with details.currentStatus.
  • details.reason race means a payment landed between the read and the write: reload.

Risk: low · Idempotent: yes · Reversible: yes · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Request body

NameTypeRequiredDescription
enteredbooleanyestrue marks the invoice as entered in the bank, false clears the mark.

Response fields

NameType
supplier_invoice_idstring
bank_entered_atstring | null

Example request

{
  "entered": true
}

Example response

{
  "data": {
    "supplier_invoice_id": "3b4c…",
    "bank_entered_at": "2026-09-06T10:00:00.000Z"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

POST /api/v1/companies/:companyId/supplier-invoices/:id/book

supplier-invoices.book · scope suppliers:write

Book a registered supplier invoice that was registered without a verifikat (the deferred Bokför step).

For companies with defer_invoice_booking=true (Registrera men bokför inte): POST /supplier-invoices registers the invoice without posting anything, and this step posts the registration verifikat afterwards (Debit cost accounts per line + 2641 ingående moms, or fiktiv moms for reverse charge; Credit 2440 Leverantörsskulder; periodiserade lines on 17xx or 29xx with their schedules). Dated on the invoice date. An upplupen kostnad (29xx line) books each month of its period on the last day of that month right after; a month that cannot take the entry refuses the booking with SI_ACCRUED_COST_PERIOD_LOCKED before anything is posted. The invoice is claimed with a compare-and-set, so a concurrent book, payment or credit cancels this entry instead of double-posting. The retained source document is anchored to the verifikat. Idempotent. Dry-runnable: the dry run previews the exact lines and writes nothing.

Use when: A supplier invoice is registered, approved or overdue, has no registration_journal_entry_id, and the company books supplier invoices in a separate step (defer_invoice_booking).

Don't use for: Paid or partially paid invoices (a payment books the registration first through this step; a kontantmetoden payment books the whole invoice), credit notes, or any supplier invoice under kontantmetoden (booked at payment via :mark-paid).

Pitfalls

  • An invoice that already has a registration_journal_entry_id answers 400 SI_BOOK_ALREADY_BOOKED.
  • Status other than registered, approved or overdue answers 400 SI_BOOK_INVALID_STATUS with details.currentStatus.
  • Under kontantmetoden answers 400 SI_BOOK_CASH_METHOD.
  • A locked or closed period, or an invoice date on or before the company lock date (bookkeeping_locked_through), answers 400 PERIOD_LOCKED with details.reason, details.fiscal_period_id and details.invoice_date. Nothing is generated, so no voucher number is spent: unlock the period (only if the user asked for that correction) and retry.
  • No open fiscal year covering the invoice date answers 400 SI_BOOK_NO_FISCAL_PERIOD.
  • Booking does not attest the invoice: :approve is a separate step and may come before or after.
  • Settling an unbooked invoice (mark-paid, a bank match, a samlingsbetalning, a link to an existing verifikat) runs this step first and refuses the payment with its code when it refuses: there is no need to call it before paying, and no way to pay around it.

Risk: high · Idempotent: yes · Reversible: no · Dry-run supported: yes · Stage for approval: yes (?stage=true)

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.
stagestringnotrue 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

NameType
supplier_invoiceobject
journal_entry_idstring

Example response

{
  "data": {
    "supplier_invoice": {
      "id": "3b4c…",
      "arrival_number": 118,
      "supplier_invoice_number": "55012",
      "status": "approved",
      "invoice_date": "2026-09-03",
      "due_date": "2026-10-03",
      "currency": "SEK",
      "total": 6250,
      "registration_journal_entry_id": "6d7e…"
    },
    "journal_entry_id": "6d7e…"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

POST /api/v1/companies/:companyId/supplier-invoices/:id/credit

supplier-invoices.credit · scope suppliers:write

Issue a credit note for a supplier invoice.

Creates a kreditfaktura that reverses the whole original supplier invoice. When the original reached the ledger the reversing JE is posted on the credit note's date (Debit 2440 / Credit expense + Credit 2641). The original status flips to credited; periodisering schedules on it stop. With inbox_item_id (a supplier's credit note in the inbox) the credit note carries that document's date, number and file as underlag, and the item is marked handled. Idempotent. Dry-runnable.

Use when: The supplier sent a credit note for a whole registered, approved, partially_paid or paid invoice (pass inbox_item_id when it is in the inbox), or you need to nullify such an invoice (a returned shipment, a vendor dispute resolution). Use dry-run to confirm the totals first.

Don't use for: A credit note for PART of an invoice (400 SI_CREDIT_PARTIAL: this always reverses the whole invoice). Editing line items on an unchanged invoice (use PATCH on registered SIs). Crediting an already-credited SI (409 SI_CREDIT_ALREADY_CREDITED); undo a credit with POST /supplier-invoices/{id}/uncredit.

Pitfalls

  • Idempotency-Key is mandatory.
  • An invoice with a bank payment order that is signed or being signed returns 409 SI_BANK_PAYMENT_UNDER_WAY, also under dry-run: the bank still pays it. Cancel the order first; once the money has left, match its bank row to the invoice instead.
  • The credit note is dated credit_date, else the inbox item's credit note date, else today (Stockholm). That date must fall in an open fiscal period: a locked one returns 400 SI_CREDIT_PERIOD_LOCKED and is never re-dated for you.
  • With inbox_item_id the credit note must be from the invoice's supplier and for its whole total in its currency: otherwise 400 SI_CREDIT_PARTIAL or SI_CREDIT_DOCUMENT_MISMATCH (details carry both totals). A credit_date or document date before the invoice date is a 400 VALIDATION_ERROR.
  • The reversal is built from the invoice's stored rows. Rows that do not add up to the invoice total, or no rows at all (typically an invoice imported from another system), return 409 SI_CREDIT_ROWS_MISMATCH with details.rows_payable_sek and details.invoice_payable_sek, on a dry run too and before anything is written. Do not retry: book the credit note as a verifikat of its own (debit 2440 by the invoice total, credit the cost accounts and 2641), then settle a still unpaid invoice against that verifikat in the app or with the MCP tool gnubok_link_supplier_invoice_to_voucher.
  • Cash basis (kontantmetoden): an unpaid original gets no reversing JE; recognition waits for the refund. The credit-note row is still created so the AP audit trail stays consistent.
  • The original SI is flipped to credited regardless of how much of it was already paid; reconcile the bank refund via the transactions endpoints.

Risk: high · Idempotent: yes · Reversible: no · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Request body

NameTypeRequiredDescription
credit_datestringnoThe credit note's own date (YYYY-MM-DD). Defaults to the inbox item's reading, else today.
supplier_credit_note_numberstringnoThe supplier's number on the credit note. Defaults to the inbox item's reading, else KREDIT-<original number>.
document_idstringnoThe credit note document: attached as underlag to the credit verifikat. Defaults to the inbox item's document.
inbox_item_idstringnoThe inbox item holding the supplier's credit note: its date, number and document are used, and it is marked handled.

Response fields

NameType
credit_note_idstring
original_idstring
arrival_numbernumber
supplier_invoice_numberstring | null
invoice_datestring
registration_journal_entry_idstring | null
document_idstring | null
inbox_item_idstring | null

Example request

{
  "inbox_item_id": "1b2c…"
}

Example response

{
  "data": {
    "credit_note_id": "4d2a…",
    "original_id": "0e9c…",
    "arrival_number": 43,
    "supplier_invoice_number": "K-10045",
    "invoice_date": "2026-09-18",
    "registration_journal_entry_id": "9c2f…",
    "document_id": "4f1c…",
    "inbox_item_id": "1b2c…"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

POST /api/v1/companies/:companyId/supplier-invoices/:id/mark-paid

supplier-invoices.mark-paid · scope suppliers:write

Record a payment against a supplier invoice.

Books the payment journal entry (Debit 2440 / Credit the payment account under accrual; or Debit expense + Debit 2641 / Credit the payment account under cash) and flips the SI status to paid (full settlement) or partially_paid. The payment account is payment_account when supplied, otherwise 1930 Företagskonto. A booking failure leaves the SI unchanged. Idempotent. Dry-runnable.

Use when: You paid a registered or approved leverantörsfaktura through a channel other than the synced bank flow. For bank-matched payments use POST /transactions/{id}/match-supplier-invoice instead: that path also reconciles the bank line.

Don't use for: Refunding a payment (the public API does not expose unmark-paid; credit the SI instead). Paying a credited or already-paid SI (returns 409 SI_PAID_ALREADY). Paying a credit note (returns 400 SI_PAID_NOT_PAYABLE with details.reason credit_note).

Pitfalls

  • Idempotency-Key is mandatory.
  • amount above what the SI still owes returns 400 MATCH_SI_AMOUNT_EXCEEDS_REMAINING with details.remaining_amount and details.excess, and books nothing. Issue a credit note via :credit for over-billing, or book a refund through the transactions endpoints.
  • payment_date after today (Swedish calendar day) returns 400 PAYMENT_DATE_IN_FUTURE: a payment is booked on the day the money moved.
  • payment_date must fall in an open fiscal period: locked period returns 400 SI_PAID_PERIOD_LOCKED.
  • Foreign-currency SIs under accrual: amount is in the invoice currency and the verifikat is in SEK. The SEK cleared off 2440 is read from the ledger (the registration verifikat minus earlier payments), never computed by the caller; an SI with no registration verifikat (migrated) clears at its own exchange_rate, and one with no rate either returns 400 SI_FX_RATE_MISSING. State what the payment cost in SEK with amount_sek (the SEK that left the payment account; the difference to the cleared SEK books on 3960 gain / 7960 loss) or with exchange_rate_difference (cleared SEK minus paid SEK; 0 for none). One of the two is required, not both.
  • Foreign-currency SI whose linked vouchers contradict each other (a batch voucher shared with another invoice, payment rows that do not add up to paid_amount, a registration or payment voucher reversed with no single correction), or whose 2440 balance is more than 10% away from remaining_amount x exchange_rate (reason ledger_rate_mismatch: the registration was corrected for something other than the rate), or whose history is longer than one request resolves (reason ledger_history_too_long: more than 50 payment rows or 20 storno hops), returns 409 SI_PAID_SEK_UNRESOLVED with details.reason and books nothing. Check the SEK against the ledger and resend with explicit SEK lines.
  • Kontantmetoden company paying an SI that was registered on 2440 (booked at receipt, before a switch of method): the payment clears 2440 like under faktureringsmetoden, so a foreign-currency one needs amount_sek or exchange_rate_difference too. Only an SI never registered gets the cash entry (expense + ingående moms at payment).
  • Faktureringsmetoden with defer_invoice_booking (Registrera men bokför inte): an SI registered without its verifikat is booked first by the :book step (Debit cost + 2641 / Credit 2440, dated on the invoice date, periodiseringar included), then the payment clears that 2440. registration_journal_entry_id in the response names it, and the dry run returns it as registration_journal_entry. 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 SI SI_BOOK_INVALID_STATUS), the payment is refused with that code, details.registration_first is true, and nothing is booked.
  • A failure while booking changes nothing: a voucher left without its payment row or status is cancelled and its number documented as a gap (500 SI_PAID_FAILED). Retry the call.
  • Cash basis (kontantmetoden) recognizes the expense + ingående moms HERE, not at :create.
  • Cash basis + öresavrundning: a SEK invoice with ore_rounding on and an öre-bearing total is paid in whole kronor, so the generated entry credits the payment account with the rounded amount and books the residual on 3740 (no VAT). amount, paid_amount and remaining_amount stay in exact öre. Invoices whose rounding is already an invoice row on 3740 have a whole-krona total and are unaffected.
  • payment_account picks the BAS account credited for the payment (the company's primary bank account when omitted, on both the accrual and the cash path). It must be active in the chart of accounts: an unknown or deactivated account returns 400 ACCOUNTS_NOT_IN_CHART and books nothing. Beyond that it is credited exactly as given, with no range check: 19xx bank or kassa is the ordinary choice, but 1630 (betald via skattekontot) and 2893 / 2018 / 2820 (someone else paid, utlägg) are equally valid, so choosing an account that does not represent where the money actually came from is the caller's error to avoid. Unlike the dashboard dialog, this endpoint does not read the company's last-used payment account: omitting the field always means the primary bank account.
  • An invoice with a bank payment order that is signed or being signed (awaiting_signature, awaiting_second_signer, accepted) returns 409 SI_BANK_PAYMENT_UNDER_WAY, also under dry-run and with no force: the bank still pays it. Let that payment settle the invoice, or cancel the order first; once the money has left, match its bank row to the invoice instead.
  • Duplicate-payment guard: on a full settlement, if a business bank transaction of the same amount around payment_date carries the supplier name (first distinctive token, so abbreviated bank text such as "HI3G" for Hi3G Access AB counts), returns 409 SI_PAID_LIKELY_DUPLICATE with candidate transactions. A candidate with match_reason already_booked is a bank row that is ALREADY a verifikat: do not pay the invoice, correct the double booking instead. Retry with force: true only after the user confirms, and with a fresh Idempotency-Key (the original is body-hash bound). Also evaluated under dry-run. A forced full settlement is recorded in behandlingshistorik together with the candidates the guard would have flagged.

Risk: medium · Idempotent: yes · Reversible: no · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Request body

NameTypeRequiredDescription
amountnumberno
payment_datestringno
exchange_rate_differencenumberno
amount_seknumbernoForeign-currency invoices only: the SEK that left the payment account for this payment. Defaults to the SEK the invoice carries on 2440 for the paid share (no kursdifferens); a different figure books the difference on 3960 (gain) or 7960 (loss). Under kontantmetoden (no registration verifikat) it instead translates the whole payment verifikat at the rate it implies. Not combinable with exchange_rate_difference or lines.
notesstringno
forcebooleanno
payment_accountstringno
linesobject[]no

Response fields

NameTypeDescription
idstring
handlestring (optional)Typed handle of this supplier invoice: sinv_ plus its id as 32 lowercase hex. Accepted wherever the id is.
status"paid" | "partially_paid"
totalnumber
paid_amountnumber
remaining_amountnumber
paid_atstring | null
payment_journal_entry_idstring | null
registration_journal_entry_idstring | null

Example request

{
  "payment_date": "2026-05-13"
}

Example response

{
  "data": {
    "id": "0e9c…",
    "status": "paid",
    "total": 1250,
    "paid_amount": 1250,
    "remaining_amount": 0,
    "paid_at": "2026-05-13",
    "payment_journal_entry_id": "7b3a…",
    "registration_journal_entry_id": "5d1f…"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

POST /api/v1/companies/:companyId/supplier-invoices/:id/reject

supplier-invoices.reject · scope suppliers:write

Reject (neka) the attest of a supplier invoice that waits for it, with an optional comment.

Records the rejection and its comment in the attest trail as the API key's user. The attest round starts over: approvals given so far no longer count, and the attest mail's links for the invoice stop working. The invoice stays registered (or overdue past its due date); nothing is booked or paid. Whoever may approve at some step may reject: with the attest policy on its attesters and förattestants and their substitutes, not the registrant unless the policy allows it. Idempotency-Key is mandatory: a replay answers the first call. Dry-runnable.

Use when: An attester does not accept the invoice (wrong amount, not ordered, wrong supplier) and the registrant should look again.

Don't use for: Withdrawing a booked invoice (POST /supplier-invoices/{id}/credit) or deleting an unbooked one.

Pitfalls

  • ATTEST_NOT_PENDING: the invoice is already attested or settled.
  • ATTEST_NOT_ALLOWED: the attest policy does not let this user decide on the invoice.
  • FORBIDDEN: no attest policy governs the invoice and this user does not keep the books (details.reason read_only or not_member).

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Request body

NameTypeRequiredDescription
commentstring | nullnoWhy: shown to the registrant on the invoice.

Response fields

NameType
supplier_invoice_idstring
attestation_idstring
statusstring

Example request

{
  "comment": "Fel belopp, kontakta leverantören."
}

Example response

{
  "data": {
    "supplier_invoice_id": "0e9c…",
    "attestation_id": "9a1b…",
    "status": "registered"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

POST /api/v1/companies/:companyId/supplier-invoices/:id/uncredit

supplier-invoices.uncredit · scope suppliers:write

Undo the credit of a supplier invoice ("Ångra kreditering"): storno the credit note's verifikat and restore the invoice.

For an original supplier invoice with status credited: posts a storno cancelling the live credit note's verifikat (dated on that verifikat's date, never an edit or delete), marks the credit note reversed (the row is kept for the archive and the ankomstnummer series), and restores the original's status and remaining amount from its payments (paid, partially_paid, overdue, approved, or registered when it has no verifikat). The invoice can be credited again afterwards. An invoice that is not credited is an idempotent no-op (changed=false). Dry-runnable: the preview names the storno and the restored status.

Use when: A supplier invoice was credited by mistake and the credit should be taken back.

Don't use for: Crediting an invoice (POST /supplier-invoices/{id}/credit), deleting an unbooked invoice (DELETE /supplier-invoices/{id}) or reversing an arbitrary verifikat.

Pitfalls

  • Pass the ORIGINAL invoice id, not the credit note's.
  • The credit note's verifikat must lie in an open, unlocked period: otherwise the dry run answers 400 PERIOD_LOCKED and the commit 400 SI_UNCREDIT_FAILED.
  • A credit verifikat already reversed by hand is fine: the row cleanup still runs and reversal_entry_id is null.

Risk: high · Idempotent: yes · Reversible: no · Dry-run supported: yes · Stage for approval: yes (?stage=true)

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.
stagestringnotrue 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

NameTypeDescription
supplier_invoiceobject
reversal_entry_idstring | nullThe storno verifikat, when the credit note had a posted one.
reversed_credit_note_idstring | null
changedbooleanFalse when the invoice was not credited (nothing done).

Example response

{
  "data": {
    "supplier_invoice": {
      "supplier_invoice_id": "3b4c…",
      "arrival_number": 118,
      "supplier_invoice_number": "55012",
      "status": "approved",
      "invoice_date": "2026-09-03",
      "due_date": "2026-10-03",
      "currency": "SEK",
      "total": 6250,
      "remaining_amount": 6250,
      "registration_journal_entry_id": "6d7e…"
    },
    "reversal_entry_id": "9a8b…",
    "reversed_credit_note_id": "5c6d…",
    "changed": true
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

POST /api/v1/companies/:companyId/supplier-invoices/attest-substitutes

supplier-invoices.attest-substitutes.create · scope suppliers:write

Name a substitute for a supplier invoice attester for a period.

While the period runs (Stockholm dates, both days included, at most a year), substitute_user_id attests supplier invoices wherever user_id may, as them: in their place in the order (förattest or attest), with their limit. The decision is recorded as the substitute's, for the attester (on_behalf_of), and the attest mail and Att göra reach the substitute. An owner or admin names a substitute for anyone; anyone else only for themselves. Dry-runnable.

Use when: An attester will be away (vacation, leave) and invoices must still be attested.

Don't use for: Making someone an attester for good (PUT /supplier-invoices/attest-policy).

Pitfalls

  • ATTEST_SUBSTITUTE_NOT_MEMBER: both must be members whose attest can count; details.user_ids names the others.
  • FORBIDDEN: only an owner or admin names a substitute for someone else.
  • ATTEST_SUBSTITUTE_NO_POLICY: the company has never saved an attest policy.
  • One person approves an invoice once: a substitute who already approved it in their own name cannot approve it again for the attester.

Risk: high · Idempotent: yes · Reversible: yes · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Request body

NameTypeRequiredDescription
user_idstringyesThe attester who is away.
substitute_user_idstringyesWho attests in their place: a member whose attest can count.
starts_onstringyesThe first day, a Stockholm date.
ends_onstringyesThe last day, a Stockholm date, included.

Response fields

NameType
substitute_idstring
user_idstring
substitute_user_idstring
starts_onstring
ends_onstring

Example request

{
  "user_id": "8b2d…",
  "substitute_user_id": "3f0c…",
  "starts_on": "2026-12-21",
  "ends_on": "2027-01-06"
}

Example response

{
  "data": {
    "substitute_id": "1c4f…",
    "user_id": "8b2d…",
    "substitute_user_id": "3f0c…",
    "starts_on": "2026-12-21",
    "ends_on": "2027-01-06"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

PATCH /api/v1/companies/:companyId/supplier-invoices/:id

supplier-invoices.update · scope suppliers:register

Update a registered supplier invoice.

Patches a supplier invoice with the supplied fields. Only allowed on registered status: once approved, paid, or credited, the record is effectively immutable from the API's perspective. Idempotent (mandatory Idempotency-Key). Dry-runnable.

Use when: You need to adjust due_date, or attach a payment reference / notes to a registered SI before approval. Use dry-run to confirm the merged state first.

Don't use for: Editing line items (immutable: credit the SI and register a new one). Changing status (use action verbs). Approved/paid/credited SIs (returns 400 SI_NOT_DRAFT). invoice_date / supplier_invoice_number on an SI that already has a registration verifikat (returns 400 SI_EDIT_VERIFIKAT_LOCKED).

Pitfalls

  • Returns 400 SI_NOT_DRAFT when current status !== "registered".
  • invoice_date and supplier_invoice_number are on the posted registration verifikat (entry_date and description). Once registration_journal_entry_id is set, patching them returns 400 SI_EDIT_VERIFIKAT_LOCKED: correct the entry via a rättelse (gnubok_correct_entry) or credit the SI and re-register. Resending the unchanged value is accepted.
  • Patching a field never re-posts the registration JE.

Risk: low · Idempotent: yes · Reversible: yes · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Request body

NameTypeRequired
supplier_invoice_numberstringno
invoice_datestringno
due_datestringno
delivery_datestring | ""no
payment_referencestringno
notesstringno
auto_debitbooleanno

Response fields

NameTypeDescription
idstring
handlestring (optional)Typed handle of this supplier invoice: sinv_ plus its id as 32 lowercase hex. Accepted wherever the id is.
supplier_idstring
arrival_numbernumber
supplier_invoice_numberstring | null
invoice_datestring
due_datestring
received_datestring
delivery_datestring | null
statusstring
currencystring
exchange_ratenumber | null
subtotalnumber
vat_amountnumber
totalnumber
vat_treatmentstring
reverse_chargeboolean
reverse_charge_kind"eu_goods" | "eu_services" | null
paid_amountnumber
remaining_amountnumber
is_credit_noteboolean
credited_invoice_idstring | null
is_self_billedboolean
self_billing_numbernumber | null
self_billing_agreement_refstring | null
registration_journal_entry_idstring | null
payment_journal_entry_idstring | null
notesstring | null
approved_atstring | null
bank_entered_atstring | null
created_atstring
updated_atstring

Example request

{
  "payment_reference": "OCR-1234567890"
}

Example response

{
  "data": {
    "id": "0e9c…",
    "payment_reference": "OCR-1234567890"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

PATCH /api/v1/companies/:companyId/supplier-invoices/:id/items/:itemId

supplier-invoices.update-item-account · scope suppliers:write

Move one supplier-invoice line to another account, correcting the registration verifikat inline.

Changes the account of one line on an unsettled supplier invoice (registered, approved, overdue). When the invoice has a posted registration verifikat, the same verifikat is corrected inside itself through the inline rättelse (the old line is struck and replaced, split when the verifikat carries one line per account), logged with who and when (BFL 5 kap 5 §); that is only allowed in an open, unlocked period. Without a verifikat only the line changes. A standard BAS account missing from the chart is added. Idempotent. Dry-runnable: the preview carries the planned rättelse lines.

Use when: A supplier invoice line was booked on the wrong cost account (e.g. 6580 instead of 6550) and the period is still open.

Don't use for: Settled invoices (paid, credited), locked or closed periods (storno through POST /journal-entries/{id}/reverse and a new verifikat), or changing amounts or VAT.

Pitfalls

  • A settled invoice answers 409 SI_ITEM_ACCOUNT_SETTLED.
  • A locked or closed period answers 409 JOURNAL_RATTELSE_PERIOD_LOCKED: past a lock, storno is the only lawful correction.
  • When the verifikat was already corrected by hand and holds no matching line on the old account, the answer is 409 SI_ITEM_ACCOUNT_NO_MATCHING_LINE and nothing changes.
  • A foreign-currency line moves the kronor the registration booked (the line at the invoice's stored rate); an invoice without that rate answers 409 SI_ITEM_ACCOUNT_FX_RATE_UNKNOWN and nothing changes.
  • account_number is a STRING ("6550"), never a number.

Risk: high · Idempotent: yes · Reversible: yes · Dry-run supported: yes · Stage for approval: yes (?stage=true)

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.
stagestringnotrue 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

NameTypeRequiredDescription
account_numberstringyesThe BAS account to move the line to, as a string, e.g. "6550".

Response fields

NameTypeDescription
changedbooleanFalse when the line was already on that account.
correctedboolean (optional)True when the registration verifikat was corrected inline.

Example request

{
  "account_number": "6550"
}

Example response

{
  "data": {
    "changed": true,
    "corrected": true
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

PUT /api/v1/companies/:companyId/supplier-invoices/attest-policy

supplier-invoices.attest-policy.update · scope suppliers:write

Save the company's attest policy for supplier invoices.

Replaces the policy: enabled, threshold_amount (SEK, null = every invoice), mode any or all, the attesters (company members who may write, or viewers), preparer_may_attest, and optionally two_step_from_sek and limits (the attest limit per attester in SEK; both left as they are when left out), and optionally pre_attesters and project_attesters, the förattest that comes first (left as they are when left out). With it on, POST /supplier-invoices/{id}/approve only accepts the attesters (not the registrant unless preparer_may_attest) whose approval can count under their limit, approved_at is set when the policy is satisfied, and payments leave an invoice out until then (attest_required). The policy and the limits are saved together. Owners and admins only. Idempotent. Dry-runnable.

Use when: Setting up or changing who attests supplier invoices.

Don't use for: Attesting an invoice (POST /supplier-invoices/{id}/approve).

Pitfalls

  • ATTEST_POLICY_NO_ATTESTERS: a policy that is on needs at least one attester.
  • ATTEST_POLICY_ATTESTER_NOT_MEMBER: every attester must be a member who may write or a viewer; details.user_ids names the others.
  • ATTEST_POLICY_TWO_STEP_NEEDS_TWO: two_step_from_sek with the policy on needs at least two attesters.
  • ATTEST_LIMIT_NOT_ATTESTER: a limit is for an attester; details.user_ids names the others.
  • ATTEST_PROJECT_NOT_FOUND: a project in project_attesters is not a code of dimension 6; details.projects names them.
  • One person approves an invoice once: someone who is both förattestant and attester for an invoice gives one of the two, and the other step needs someone else.
  • Keep at least one attester without a limit (null): an invoice above every limit has nobody whose approval covers it.
  • FORBIDDEN: only an owner or admin saves the policy.

Risk: high · Idempotent: yes · Reversible: yes · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Request body

NameTypeRequiredDescription
enabledbooleanyes
threshold_amountnumber | nullyesAttest from this total in SEK; null = every invoice.
mode"any" | "all"yes
attestersstring[]yesUser ids of company members whose attest can count: owner, admin, member, or viewer (who attests and changes nothing else). At least one when enabled.
preparer_may_attestbooleanno
two_step_from_seknumber | nullnoTwo different attesters from this total in SEK, at least one with a covering limit; null = one is enough. Left out: unchanged.
limitsobject[]noAttest limits per attester; replaces every limit (an attester left out has none). Left out: unchanged.
pre_attestersstring[]noFörattest for invoices (and lines) without a project of their own in project_attesters: one of them approves first. Empty = none. Left out: unchanged.
project_attestersobject[]noFörattest per project: replaces every project's (a project left out has none). Left out: unchanged.

Response fields

NameTypeDescription
enabledboolean
threshold_amountnumber | nullAttest is required at or above this total in SEK; null = every invoice.
mode"any" | "all"any: one attester is enough; all: every attester who may attest the invoice.
attestersobject[]
preparer_may_attestbooleanFalse: the person who registered an invoice cannot attest it.
two_step_from_seknumber | nullFrom this total in SEK two different attesters must approve, at least one with a covering limit; null = one is enough.
pre_attestersobject[]Förattest: one of them approves first an invoice (or a line) without a project of its own in project_attesters; empty = none.
project_attestersobject[]Förattest per project (dimension 6 code): every project on an invoice's lines needs one approval by one of its attesters before the attesters may attest.
substitutesobject[]Substitutes that run now or later.
updated_atstring | null

Example request

{
  "enabled": true,
  "threshold_amount": 5000,
  "mode": "any",
  "attesters": [
    "3f0c…",
    "8b2d…"
  ],
  "preparer_may_attest": false,
  "two_step_from_sek": 100000,
  "limits": [
    {
      "user_id": "3f0c…",
      "max_amount_sek": 50000
    },
    {
      "user_id": "8b2d…",
      "max_amount_sek": null
    }
  ]
}

Example response

{
  "data": {
    "enabled": true,
    "threshold_amount": 5000,
    "mode": "any",
    "attesters": [
      {
        "user_id": "3f0c…",
        "name": "Anna Ek",
        "email": "anna@example.se",
        "limit_sek": 50000
      },
      {
        "user_id": "8b2d…",
        "name": "Bo Lind",
        "email": "bo@example.se",
        "limit_sek": null
      }
    ],
    "preparer_may_attest": false,
    "two_step_from_sek": 100000,
    "updated_at": "2026-10-14T09:00:00.000Z"
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

DELETE /api/v1/companies/:companyId/supplier-invoices/:id

supplier-invoices.delete · scope suppliers:write

Delete an unbooked, unpaid supplier invoice (no verifikat, no payment).

Removes a supplier invoice that never reached the books: status registered, approved or overdue, no registration verifikat, no payment, no accrual schedule and no payment-batch row. Its lines go with it. A booked invoice is never deleted: withdraw it with a credit note (POST /supplier-invoices/{id}/credit), which keeps both verifikat in the audit trail (BFL 5 kap 5 §). Idempotent. Dry-runnable.

Use when: A supplier invoice was registered by mistake (a duplicate, the wrong company, a quote) under defer_invoice_booking or kontantmetoden, so no verifikat exists yet.

Don't use for: Booked invoices (credit them), credit notes (undo the credit on the original: POST /supplier-invoices/{id}/uncredit) or discarding an inbox item (DELETE /inbox-items/{id}).

Pitfalls

  • An invoice with a registration verifikat, a payment or an accrual schedule answers 400 SI_DELETE_HAS_BOOKING with details.reason (registration_journal_entry, payments, accrual_schedule).
  • A credit note answers 400 SI_DELETE_CREDIT_NOTE; paid, partially paid or credited invoices answer 400 SI_DELETE_INVALID_STATUS.
  • An invoice in a payment batch (even a cancelled one) answers 409 SI_DELETE_IN_PAYMENT_BATCH: the batch rows document the payment instruction.
  • The ankomstnummer the invoice held is not reused.

Risk: medium · Idempotent: yes · Reversible: no · Dry-run supported: yes · Stage for approval: yes (?stage=true)

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.
stagestringnotrue 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

NameType
supplier_invoice_idstring
deletedtrue

Example response

{
  "data": {
    "supplier_invoice_id": "3b4c…",
    "deleted": true
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}

DELETE /api/v1/companies/:companyId/supplier-invoices/attest-substitutes/:id

supplier-invoices.attest-substitutes.delete · scope suppliers:write

Remove a substitute for a supplier invoice attester.

Ends the substitution at once: the substitute no longer attests in the attester's place. What they attested stays. An owner or admin removes any; the attester who is away removes their own. Dry-runnable.

Use when: The attester is back early, or the substitute was named by mistake.

Don't use for: Changing who attests for good (PUT /supplier-invoices/attest-policy).

Pitfalls

  • ATTEST_SUBSTITUTE_NOT_FOUND: no such substitute in this company (or already removed).

Risk: low · Idempotent: yes · Reversible: no · Dry-run supported: yes

Query parameters

NameTypeRequiredDescription
dry_runstringnotrue (any case) previews the write without committing it, like the X-Dry-Run: true header. Any other value commits.

Response fields

NameType
substitute_idstring
removedtrue

Example response

{
  "data": {
    "substitute_id": "1c4f…",
    "removed": true
  },
  "meta": {
    "request_id": "req_…",
    "api_version": "2026-05-12"
  }
}