---
title: "Apply Chart Standardization"
method: POST
path: "/ledger-accounts/standardize/{proposal_id}/apply"
tags: ["accounting-settings"]
---

# Apply Chart Standardization

`POST /ledger-accounts/standardize/{proposal_id}/apply`

## 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/ledger-accounts/standardize/{proposal_id}/apply`
- Auth: none declared

Apply a (user-adjusted) chart-standardization proposal (accountant).

Loads the proposal flat-by-id (404/403), scopes by its company. **409** if it is no
longer ``pending`` or if ``expected_request_hash`` is given and differs. **422** if a
submitted mapping's ``old_account_number`` is unknown to the proposal, or the remap is
invalid (merge/collision/dropped-balance/unbalanced). **409** if the chart drifted or
the accepted snapshot moved, or if the affected accounts already carry FY journal
entries. On success the chart is remapped + the accepted snapshot forked.

## Path parameters

- `proposal_id` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- ChartStandardizeApplyIn: ``POST /ledger-accounts/standardize/{id}/apply`` body (admin) — apply the remap. ``mappings`` is the final (user-adjusted) set of account mappings to apply. ``expected_request_hash`` optionally guards against applying a proposal that drifted (409 when it no longer equals the stored ``request_hash``).
  - `mappings` ChartMappingEditIn[], required
    - `old_account_number` string, required
    - `new_account_number` string, required
    - `new_account_name` string, nullable
    - `new_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.
  - `expected_request_hash` string, nullable

## Response `200`

Successful Response

- ChartStandardizationProposalOut: A generated chart-standardization proposal (the accountant proposal payload). ``response`` is the full verbatim accountant proposal (``mappings`` / ``new_accounts`` / ``unmapped`` / ``risk_flags`` / ``confidence`` / ...). The frontend renders the mapping table from ``response.mappings`` (``old_account_number`` / ``new_account_number`` / ``new_account_name`` / ``new_category`` / ``is_change`` / ``confidence`` / ``rationale``). ``is_stale`` / ``stale_reasons`` / ``pending_newer`` are **computed** (never stored — see ``app.accounting.services.standardization_staleness``): only a ``pending`` proposal can be stale, with reasons ``chart_changed`` | ``snapshot_replaced``. ``apply_status`` is ``pending`` | ``applied`` | ``discarded`` | ``superseded``. ``processing_status`` (``pending`` | ``processing`` | ``done`` | ``failed``) is the async generation-job lifecycle: ``generate`` returns ``202`` with a ``pending`` proposal and ``response=None``; the analyzer runs the accountant LLM call and flips it to ``done`` (``response`` populated) or ``failed`` (``error`` set). The frontend polls until terminal.
  - `id` string, required
  - `company_id` string, required
  - `fiscal_year` integer, required
  - `target_framework` string, required
  - `status` string, required
  - `apply_status` string, required
  - `processing_status` string, required
  - `error` string, nullable
  - `request_hash` string, required
  - `response` object, nullable
  - `accountant_metadata` object, nullable
  - `applied_snapshot_id` string, nullable
  - `generated_by` string, nullable
  - `applied_by` string, nullable
  - `created_at` string, date-time, required
  - `applied_at` string, date-time, nullable
  - `is_stale` boolean
  - `stale_reasons` string[]
  - `pending_newer` boolean
  - `resolved_questions` string[]

## 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)
