---
title: "Correct Gl Guessed Account"
method: PUT
path: "/companies/{company_id}/gl/journal-entries/{entry_id}/guessed-account"
tags: ["gl"]
---

# Correct Gl Guessed Account

`PUT /companies/{company_id}/gl/journal-entries/{entry_id}/guessed-account`

## 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}/gl/journal-entries/{entry_id}/guessed-account`
- Auth: none declared

Correct the guessed expense account of a ``coding_guessed`` entry (accountant).

Swaps the guessed P&L line to ``account_code`` (full-line rebuild + version
bump + ``edited`` audit), clears the flag, and re-syncs the commercial
document so the corrected coding re-enters tier-2 history. 409 when the
entry is locked or its period is closed (no post-close correction); 422 for
a non-guessed/non-posted entry, an ambiguous multi-P&L-line coding, or an
unknown/inactive account.

## Path parameters

- `company_id` string, required
- `entry_id` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- GlGuessedAccountCorrectionIn: ``PUT /gl/journal-entries/{id}/guessed-account`` body (accountant). ``account_code`` is the correct expense account's chart *code* (resolved in the entry's fiscal-year chart; must be active + postable). The correction swaps the guessed P&L line's account in place (full-line rebuild, version bump, ``edited`` audit) and clears ``coding_guessed`` — the corrected document then re-enters tier-2 coding history with the corrected account.
  - `account_code` string, required

## Response `200`

Successful Response

- GlJournalEntryDetailOut
  - `id` string, required
  - `company_id` string, required
  - `entry_no` integer, nullable
  - `period_id` string, required
  - `posting_date` string, date, required
  - `status` string, required
  - `entry_type` string, required
  - `origin` string, required
  - `description` string, nullable
  - `debit_total_base` string, required
  - `credit_total_base` string, required
  - `line_count` integer, required
  - `version_no` integer, required
  - `reversal_of_entry_id` string, nullable
  - `reversed_by_entry_id` string, nullable
  - `auto_reverse_date` string, date, nullable
  - `coding_guessed` boolean
  - `untagged_subledger_control` boolean
  - `source_ref_type` string, nullable
  - `source_ref_id` string, nullable
  - `source_action` string, nullable
  - `created_at` string, date-time, required
  - `posted_by` string, nullable
  - `created_by` string, nullable
  - `posted_at` string, date-time, nullable
  - `lines` GlJournalLineOut[]
    - `id` string, required
    - `line_no` integer, required
    - `account_id` string, required
    - `amount_base` string, required
    - `currency` string, required
    - `amount_currency` string, required
    - `line_role` string, required
    - `counterparty_id` string, nullable
    - `open_item_id` string, nullable
    - `description` string, nullable
    - `vat_code` string, nullable
    - `vat_amount` string, nullable
    - `open_item` GlLineOpenItemIn: Open a new AR/AP subledger item from a manual control line (Gap B). Set ``create=true`` on the line posting to the AR/AP control account; ``due_date`` seeds aging. Direction is derived from the account's ``control_type``. To settle/adjust an *existing* item instead, pass ``open_item_id`` on the line (its balance is rebuilt on post).
      - `create` boolean
      - `due_date` string, date, nullable
  - `vat_postings` GlVatPostingOut[]
    - `id` string, required
    - `journal_entry_id` string, required
    - `base_line_id` string, required
    - `vat_line_id` string, required
    - `vat_code_id` string, required
    - `vat_code` string, nullable
    - `vat_period_id` string, nullable
    - `base_amount` string, required
    - `vat_amount` string, required
    - `gross_amount` string, required
    - `deductibility_percent` string, required
    - `non_deductible_amount` string, required
    - `return_box_code` string, nullable
  - `vat_zero_postings` GlVatZeroPostingOut[]
    - `id` string, required
    - `journal_entry_id` string, required
    - `base_line_id` string, required
    - `vat_code_id` string, required
    - `vat_code` string, nullable
    - `vat_period_id` string, nullable
    - `base_amount` string, required
    - `return_box_code` string, nullable
  - `open_items` GlOpenItemOut[]
    - `id` string, required
    - `company_id` string, required
    - `direction` string, required
    - `counterparty_id` string, nullable
    - `control_account_id` string, required
    - `original_amount_base` string, required
    - `open_amount_base` string, required
    - `currency` string, required
    - `original_amount_currency` string, nullable
    - `open_amount_currency` string, nullable
    - `base_currency` string, nullable
    - `due_date` string, date, nullable
    - `status` string, required
    - `created_at` string, date-time, required
  - `documents` GlDocumentOut[]
    - `id` string, required
    - `company_id` string, required
    - `document_type` string, required
    - `file_id` string, nullable
    - `filename` string, nullable
    - `issue_date` string, date, nullable
    - `created_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)
