LumaBill Journal Entries API
Double-entry bookkeeping journal entries
Double-entry bookkeeping journal entries
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/lumabill-ch:lumabill-ch-journal-entries-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Lumabill Journal Entries API
version: '1.0'
description: 'The Lumabill API gives **Pro and Lifetime** subscribers programmatic access to
Swiss invoicing and bookkeeping data. You can create and manage invoices,
clients, expenses, journal entries, and more - the same data you see in the
Lumabill dashboard. ## Authentication
All requests must carry a Bearer API key in the `Authorization` header:
```
Authorization: Bearer lmb_your_api_key_here
```
API keys are created in **Settings → API Keys** inside the Lumabill dashboard. ## Profile scoping
A Lumabill account can have multiple profiles (companies). By default the key
is scoped to the profile it was created for. If a key has access to multiple
profiles, supply the `X-Profile-Id` header with the UUID of the target profile. ## Rate limits
| Operation | Limit |
|-----------|-------|
| Reads (GET) | 60 requests / minute per API key |
| Writes (POST, PUT, DELETE) | 20 requests / minute per API key |
When the limit is exceeded the API returns `429 Too Many Requests` with a
`Retry-After` header indicating when you may retry (seconds from now). ## Pagination
List endpoints support cursor-free page-based pagination via query parameters:
| Parameter | Default | Maximum |
|-----------|---------|---------|
| `page` | 1 | - |
| `per_page` | 50 | 100 |
Responses include a top-level `meta` object:
```json
{
"data": [...],
"meta": { "page": 1, "per_page": 50, "total": 243 }
}
```
## Errors
All error responses share a common shape:
```json
{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable description"
}
}
```
Common error codes: `INVALID_API_KEY`, `FORBIDDEN`, `NOT_FOUND`,
`VALIDATION_ERROR`, `RATE_LIMIT_EXCEEDED`, `SUBSCRIPTION_REQUIRED`,
`READ_ONLY_KEY`, `CLIENT_NOT_FOUND`, `INTERNAL_ERROR`. ## Smart defaults
When creating invoices or offers the API auto-resolves most fields from
your profile so you can send minimal payloads. Only `lines` is required. | Field | Auto-resolved from |
|-------|-------------------|
| `invoice_number` | Profile prefix + sequential counter (e.g. `IV-010`) |
| `issue_date` | Today |
| `due_date` | `issue_date` + profile payment deadline (default 30 days) |
| `currency` | Profile default currency (default `CHF`) |
| `vat_rate` (on lines) | Profile default tax rate |
| Sender details | Profile company name, address, IBAN, etc. |
| Payment info | Profile payment template and deadline |
**`client_id` shorthand** - pass a `client_id` UUID instead of a full
client object. The API fetches the client and snapshots the data
automatically. Returns `404` with code `CLIENT_NOT_FOUND` if the client
does not exist in your profile. **Minimal example:**
```json
POST /invoices
{
"client_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"lines": [
{ "description": "Consulting", "quantity": 2, "price": 150 }
]
}
```
Any field you explicitly provide overrides the auto-resolved default. ## MCP Server (AI Assistant Integration)
Connect your Lumabill account to AI assistants like Claude, ChatGPT, and Cursor
using the Model Context Protocol (MCP). **Endpoint:** `https://mcp.lumabill.ch/mcp?key={your_api_key}`
**Setup for Claude Desktop** - add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"lumabill": {
"type": "streamable-http",
"url": "https://mcp.lumabill.ch/mcp?key=lmb_your_key_here"
}
}
}
```
**Setup for Claude Code** - add to `.mcp.json` in your project:
```json
{
"mcpServers": {
"lumabill": {
"type": "streamable-http",
"url": "https://mcp.lumabill.ch/mcp?key=lmb_your_key_here"
}
}
}
```
**Setup for Cursor** - add to MCP settings:
- Name: `lumabill`
- Type: `streamable-http`
- URL: `https://mcp.lumabill.ch/mcp?key=lmb_your_key_here`
The MCP server exposes all API endpoints as tools. Your AI assistant can:
- Create and manage invoices, offers, and expenses
- Look up clients and vendors
- Generate financial reports (P&L, balance sheet, VAT)
- Import bank transactions
- Query revenue data
**API key permissions apply:** Read-only keys only expose read tools.'
contact:
name: Lumabill Support
url: https://lumabill.com/contact
license:
name: Proprietary
servers:
- url: https://api.lumabill.ch/v1
description: Production
- url: https://api.dev.lumabill.ch/v1
description: Development / Sandbox
security:
- BearerAuth: []
tags:
- name: Journal Entries
description: Double-entry bookkeeping journal entries
paths:
/journal-entries:
parameters:
- $ref: '#/components/parameters/ProfileIdHeader'
get:
operationId: listJournalEntries
summary: List journal entries
tags:
- Journal Entries
description: 'A Storno carries `isReversal: true` and `reversedEntryId`; the entry it reverses carries `reversedById` / `reversedBySeq`. With `includeVoided=true` the list also returns entries removed before Storno bookings existed that still hold a Buchungsnummer, marked with `deletedAt` and `voidReason`; they never count toward any balance.'
parameters:
- name: dateFrom
in: query
schema:
type: string
format: date
- name: dateTo
in: query
schema:
type: string
format: date
- name: fiscalYearId
in: query
schema:
type: string
format: uuid
- name: referenceType
in: query
schema:
type: string
- name: search
in: query
schema:
type: string
- name: limit
in: query
schema:
type: integer
- name: offset
in: query
schema:
type: integer
- name: includeVoided
in: query
schema:
type: boolean
default: false
responses:
'200':
description: A paginated list of journal entries
content:
application/json:
schema:
type: object
properties:
entries:
type: array
items:
$ref: '#/components/schemas/JournalEntry'
total:
type: integer
voidedTotal:
type: integer
position:
type:
- integer
- 'null'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimitExceeded'
'500':
$ref: '#/components/responses/InternalError'
post:
operationId: createJournalEntry
summary: Create a journal entry
tags:
- Journal Entries
description: Debits and credits across all lines must balance (sum of debits = sum of credits). Mutations to entries in closed fiscal years are rejected.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JournalEntryWrite'
responses:
'201':
description: Journal entry created
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
createdAt:
type: string
format: date-time
message:
type: string
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimitExceeded'
'500':
$ref: '#/components/responses/InternalError'
/journal-entries/{id}:
parameters:
- $ref: '#/components/parameters/ProfileIdHeader'
- $ref: '#/components/parameters/ResourceId'
get:
operationId: getJournalEntry
summary: Get a journal entry
tags:
- Journal Entries
responses:
'200':
description: Journal entry object
content:
application/json:
schema:
$ref: '#/components/schemas/JournalEntry'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimitExceeded'
'500':
$ref: '#/components/responses/InternalError'
put:
operationId: updateJournalEntry
summary: Update a journal entry
tags:
- Journal Entries
description: '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.'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JournalEntryWrite'
responses:
'200':
description: Updated journal entry
content:
application/json:
schema:
$ref: '#/components/schemas/JournalEntry'
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimitExceeded'
'500':
$ref: '#/components/responses/InternalError'
delete:
operationId: deleteJournalEntry
summary: Withdraw a manual journal entry (posts a Storno)
tags:
- Journal Entries
description: 'Posted bookings are never removed. Deleting a MANUAL entry posts a Storno, exactly like `POST /journal-entries/{id}/reverse`: a new numbered entry on the same date with debit and credit swapped, linked to the original. Errors (400 with `errorCode`): `NOT_MANUAL` (undo automatic bookings through their invoice, expense, payment or bank transaction), `ALREADY_REVERSED`, `IS_REVERSAL`, `FISCAL_YEAR_CLOSED`.'
responses:
'200':
description: Storno posted
content:
application/json:
schema:
type: object
properties:
reversalId:
type: string
format: uuid
reversalEntrySeq:
type:
- integer
- 'null'
message:
type: string
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimitExceeded'
'500':
$ref: '#/components/responses/InternalError'
/journal-entries/{id}/reverse:
parameters:
- $ref: '#/components/parameters/ProfileIdHeader'
- $ref: '#/components/parameters/ResourceId'
post:
operationId: reverseJournalEntry
summary: Reverse a manual journal entry (Storno)
tags:
- Journal Entries
description: 'Posts a Storno for a MANUAL entry: a new numbered entry on the original''s date with debit and credit swapped, linked via `reversedEntryId`. The original stays in the journal. An entry can be reversed once; its fiscal year must be open. An automatic entry is accepted only when orphaned: its document exists but no document links to the entry (e.g. a double-posted expense). Errors (400 with `errorCode`): `NOT_MANUAL`, `ALREADY_REVERSED`, `IS_REVERSAL`, `FISCAL_YEAR_CLOSED`.'
responses:
'201':
description: Storno posted
content:
application/json:
schema:
$ref: '#/components/schemas/StornoResult'
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimitExceeded'
'500':
$ref: '#/components/responses/InternalError'
components:
schemas:
Currency:
type: string
description: 'ISO 4217 code of a currency the API converts (ESTV/BAZG rates). The same list applies to every currency field of the API.
'
enum:
- CHF
- EUR
- USD
- GBP
- JPY
- CAD
- AUD
- SEK
- NOK
- DKK
- HUF
example: CHF
JournalEntryWrite:
type: object
required:
- entryDate
- lines
properties:
entryDate:
type: string
format: date
example: '2025-05-15'
description:
type: string
example: Invoice payment received from Müller AG
fiscalYearId:
type:
- string
- 'null'
format: uuid
description: Optional; must be the year covering entryDate
documentUrl:
type:
- string
- 'null'
link:
type:
- object
- 'null'
description: 'Optional year-end back-reference, written in the same transaction as the entry. The linked row must belong to the profile (400 otherwise); a second live profit allocation answers 409 ALREADY_ALLOCATED. The date and lines of a linked entry cannot be edited (PUT answers 409 LINKED_ENTRY): reverse it and book again; its description and document can. The id is the year-end closing (PROFIT_ALLOCATION), the fixed asset (FIXED_ASSET_DEPRECIATION), the accrual (ACCRUAL, ACCRUAL_REVERSAL) or the fiscal year of a tax provision (TAX_PROVISION, dated in that year, one live provision per year: 409 TAX_PROVISION_ALREADY_BOOKED). A journal card of the AI accountant is not booked here: it is added to the list of prepared closing bookings and posted from there, with the domain link it resolves.
'
required:
- type
- id
properties:
type:
type: string
enum:
- PROFIT_ALLOCATION
- FIXED_ASSET_DEPRECIATION
- ACCRUAL
- ACCRUAL_REVERSAL
- TAX_PROVISION
id:
type: string
format: uuid
lines:
type: array
minItems: 2
description: '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).
'
items:
$ref: '#/components/schemas/JournalLineWrite'
ErrorResponse:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
example: NOT_FOUND
message:
type: string
example: The requested resource was not found.
JournalEntry:
type: object
required:
- id
- entryDate
- lines
properties:
id:
type: string
format: uuid
example: c3d4e5f6-3456-789a-cdef-012345678901
fiscalYearId:
type:
- string
- 'null'
format: uuid
entrySeq:
type:
- integer
- 'null'
description: Buchungsnummer
entryDate:
type: string
format: date
example: '2025-05-15'
description:
type: string
example: Invoice payment received from Müller AG
referenceType:
type: string
description: MANUAL, INVOICE, INVOICE_PAYMENT, EXPENSE, REVENUE, ...
referenceId:
type:
- string
- 'null'
format: uuid
isReversal:
type: boolean
reversedEntryId:
type:
- string
- 'null'
format: uuid
externalSource:
type:
- string
- 'null'
description: '`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:
type:
- string
- 'null'
createdAt:
type: string
format: date-time
lines:
type: array
minItems: 2
items:
$ref: '#/components/schemas/JournalLine'
StornoResult:
type: object
properties:
id:
type: string
format: uuid
description: The Storno (reversal) entry
entrySeq:
type:
- integer
- 'null'
description: Buchungsnummer of the Storno entry
reversedEntryId:
type: string
format: uuid
message:
type: string
JournalLineWrite:
type: object
required:
- chartAccountId
- side
description: 'Give either `amount` (CHF) or `originalCurrency` + `originalAmount` + `exchangeRate` (the CHF amount is then originalAmount x exchangeRate, rounded to cents). A line on an FW account must carry `originalCurrency` = the account currency and its `originalAmount` (400 FX_ACCOUNT_CURRENCY / FX_ACCOUNT_AMOUNT). Manual entries cannot post FX result lines (`fxKind`).
'
properties:
chartAccountId:
type: string
format: uuid
description: Chart-of-accounts UUID (see /chart-accounts)
side:
type: string
enum:
- DEBIT
- CREDIT
amount:
type: number
format: double
description: CHF amount; omit when originalCurrency is given
example: 1000.0
vatCode:
type:
- string
- 'null'
example: VM81
originalCurrency:
$ref: '#/components/schemas/Currency'
originalAmount:
type: number
format: double
example: 1062.47
exchangeRate:
type: number
format: double
description: CHF per 1 unit of originalCurrency
example: 0.9412
JournalLine:
type: object
required:
- id
- chartAccountId
- side
- amount
properties:
id:
type: string
format: uuid
chartAccountId:
type: string
format: uuid
accountCode:
type: string
description: Swiss chart of accounts (Kontenplan KMU) account number
example: '1020'
accountName:
type: string
example: Bank
side:
type: string
enum:
- DEBIT
- CREDIT
amount:
type: number
format: double
description: Amount in CHF (the profile base currency), always positive
example: 1000.0
vatCode:
type:
- string
- 'null'
example: VM81
originalCurrency:
allOf:
- $ref: '#/components/schemas/Currency'
description: 'Currency of the line. Always set on a line of a foreign-currency (FW) account (the account currency); on CHF accounts such as 1100 Debitoren it is a document trail only.
'
originalAmount:
type:
- number
- 'null'
format: double
description: '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:
type:
- number
- 'null'
format: double
description: CHF per 1 unit of `originalCurrency`
fxKind:
type:
- string
- 'null'
enum:
- realized
- revaluation
- null
description: '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).
'
responses:
ValidationError:
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: VALIDATION_ERROR
message: The field 'due_date' must be on or after 'issue_date'.
RateLimitExceeded:
description: Rate limit exceeded
headers:
Retry-After:
description: Number of seconds to wait before retrying
schema:
type: integer
example: 30
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: RATE_LIMIT_EXCEEDED
message: Rate limit exceeded. Please retry after 30 seconds.
Forbidden:
description: Subscription required or read-only key on a write endpoint
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
subscription_required:
summary: Subscription required
value:
error:
code: SUBSCRIPTION_REQUIRED
message: A Pro or Lifetime subscription is required to use this endpoint.
read_only_key:
summary: Read-only key
value:
error:
code: READ_ONLY_KEY
message: This API key is read-only and cannot perform write operations.
Unauthorized:
description: Invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: INVALID_API_KEY
message: The provided API key is invalid or has been revoked.
NotFound:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: NOT_FOUND
message: The requested resource was not found.
InternalError:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: INTERNAL_ERROR
message: An unexpected error occurred. Please try again later.
parameters:
ResourceId:
name: id
in: path
required: true
description: UUID of the resource
schema:
type: string
format: uuid
example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
ProfileIdHeader:
name: X-Profile-Id
in: header
description: 'UUID of the target profile. Required when the API key is not already scoped to a single profile.
'
required: false
schema:
type: string
format: uuid
example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: lmb_...
description: API key obtained from Lumabill dashboard → Settings → API Keys