---
title: "Update a journal entry"
method: PUT
path: "/journal-entries/{id}"
tags: ["Journal Entries"]
---

# Update a journal entry

`PUT /journal-entries/{id}`

## Request

- Base URL: `https://api.lumabill.ch/v1`
- URL: `https://api.lumabill.ch/v1/journal-entries/{id}`
- Auth: HTTP bearer

Mutations to entries in closed fiscal years are rejected with `403`. System entries (opening balance, FX revaluation) answer 400 SYSTEM_ENTRY_READ_ONLY. An entry with a foreign-currency line or a line on a foreign-currency (FW) account answers 400 FX_REVALUATION_LIVE when a live FX revaluation run exists for its current or target fiscal year: an in-place edit would leave the run looking current. Reverse the entry (`POST /journal-entries/{id}/reverse`) and book a new one, or re-run the revaluation.

## Request body

- JournalEntryWrite
  - `entryDate` string, date, required
  - `description` string
  - `fiscalYearId` string, uuid, nullable: Optional; must be the year covering entryDate
  - `documentUrl` string, nullable
  - `lines` JournalLineWrite[], required: Must balance in CHF: sum of debits = sum of credits (1 cent tolerance). A residual that only comes from converting FX lines is booked on the FX result account (400 FX_ROUNDING_RESIDUAL when the profile has none).
    - `chartAccountId` string, uuid, required: Chart-of-accounts UUID (see /chart-accounts)
    - `side` 'DEBIT' | 'CREDIT', required
    - `amount` number, double: CHF amount; omit when originalCurrency is given
    - `vatCode` string, nullable
    - `originalCurrency` 'CHF' | 'EUR' | 'USD' | 'GBP' | 'JPY' | 'CAD' | 'AUD' | 'SEK' | 'NOK' | 'DKK' | 'HUF': ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.
    - `originalAmount` number, double
    - `exchangeRate` number, double: CHF per 1 unit of originalCurrency

## Response `200`

Updated journal entry

- JournalEntry
  - `id` string, uuid, required
  - `fiscalYearId` string, uuid, nullable
  - `entrySeq` integer, nullable: Buchungsnummer
  - `entryDate` string, date, required
  - `description` string
  - `referenceType` string: MANUAL, INVOICE, INVOICE_PAYMENT, EXPENSE, REVENUE, ...
  - `referenceId` string, uuid, nullable
  - `isReversal` boolean
  - `reversedEntryId` string, uuid, nullable
  - `externalSource` string, nullable: `system` on the entries the year close and the FX revaluation post (opening balance, Neubewertung). They are read-only here: PUT, DELETE, reverse and the VAT-code edit answer 400 SYSTEM_ENTRY_READ_ONLY (re-run the revaluation, or reopen and close the year again).
  - `documentUrl` string, nullable
  - `createdAt` string, date-time
  - `lines` JournalLine[], required
    - `id` string, uuid, required
    - `chartAccountId` string, uuid, required
    - `accountCode` string: Swiss chart of accounts (Kontenplan KMU) account number
    - `accountName` string
    - `side` 'DEBIT' | 'CREDIT', required
    - `amount` number, double, required: Amount in CHF (the profile base currency), always positive
    - `vatCode` string, nullable
    - `originalCurrency` 'CHF' | 'EUR' | 'USD' | 'GBP' | 'JPY' | 'CAD' | 'AUD' | 'SEK' | 'NOK' | 'DKK' | 'HUF': ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.
    - `originalAmount` number, double, nullable: Amount in `originalCurrency`. On an FW account it moves the FW saldo; it is 0 only on FX result lines (`fxKind` set), which move CHF only.
    - `exchangeRate` number, double, nullable: CHF per 1 unit of `originalCurrency`
    - `fxKind` 'realized' | 'revaluation', nullable: Set on FX result lines: `realized` (Kursdifferenz of a payment, a transfer or a zero FW saldo), `revaluation` (year-end revaluation). Never carries a VAT code (400 FX_KIND_INVALID on the VAT-code edit).

## Other responses

- `400`: Validation error
- `401`: Invalid or missing API key
- `403`: Subscription required or read-only key on a write endpoint
- `404`: Resource not found
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/lumabill/apis/lumabill-api.md) · [All operations](https://skmtc.dev/lumabill/apis/lumabill-api/llms.txt) · [OpenAPI document](https://skmtc.dev/lumabill/apis/lumabill-api/revisions/e48e7099b545?raw)
