---
title: "Create Ledger Account"
method: POST
path: "/companies/{company_id}/ledger-accounts"
tags: ["accounting-settings"]
---

# Create Ledger Account

`POST /companies/{company_id}/ledger-accounts`

## Request

- Base URL: `https://app.zeno-works.ch` (the document declares no server; this is the origin it was published from)
- URL: `https://app.zeno-works.ch/companies/{company_id}/ledger-accounts`
- Auth: none declared

Manually add a ledger account (accountant). 409 on a duplicate code in that year.

The chart is **FY-scoped** (``gl_account``, keyed ``(company, fiscal_year, code)``), so
a duplicate is the same account number *within the resolved year*. The request's
``fiscal_year`` is **load-bearing**, not cosmetic: it selects the year written into —
the requested year (created if absent), else the company's latest, else the current
calendar year; a closed year is refused with 409. It is also echoed into the
synthesized response.

## Path parameters

- `company_id` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- LedgerAccountCreate: ``POST /companies/{id}/ledger-accounts`` body (admin) — manual add. ``category`` is taken as given (a manual correction); ``is_profit_loss`` is always derived from it server-side. The source label is recorded as ``"manual"``.
  - `fiscal_year` integer, required
  - `account_number` string, required
  - `account_name` string, nullable
  - `category` 'asset' | 'liability' | 'equity' | 'income' | 'expense' | 'tax' | 'other' | 'unknown': The account-type axis of a ledger account (Swiss-KMU chart of accounts). Distinct from — but derived from — ``LineRole`` (the journal-line semantic role). ``unknown`` is the conservative default when classification can't decide; ``other`` covers genuinely ambiguous / closing (9xxx) accounts.
  - `account_number_guess` string, nullable
  - `is_intentional` boolean

## Response `201`

Successful Response

- LedgerAccountResponse: ``POST/PUT /ledger-accounts/{id}`` → ``{"ledger_account": ...}``.
  - `ledger_account` LedgerAccountOut, required: One chart-of-accounts row.
    - `id` string, required
    - `company_id` string, required
    - `fiscal_year` integer, required
    - `account_number` string, required
    - `account_name` string, nullable
    - `category` 'asset' | 'liability' | 'equity' | 'income' | 'expense' | 'tax' | 'other' | 'unknown', required: The account-type axis of a ledger account (Swiss-KMU chart of accounts). Distinct from — but derived from — ``LineRole`` (the journal-line semantic role). ``unknown`` is the conservative default when classification can't decide; ``other`` covers genuinely ambiguous / closing (9xxx) accounts.
    - `is_profit_loss` boolean, required
    - `is_contra` boolean
    - `is_intentional` boolean
    - `account_number_guess` string, nullable
    - `first_seen_date` string, date, nullable
    - `last_seen_date` string, date, nullable
    - `journal_usage_count` integer, required
    - `sources` string[]
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

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