---
title: "Extract Open Items"
method: POST
path: "/onboarding/extract-open-items"
tags: ["onboarding"]
---

# Extract Open Items

`POST /onboarding/extract-open-items`

## 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/onboarding/extract-open-items`
- Auth: none declared

Extract pre-Zeno open AR/AP items from an upload (eligible; ZET-59).

Stateless: stages the bytes (provenance for the create) and returns draft open
items, writing nothing to the DB. Accepts open invoices (direction resolved
against ``company_name``, else ``direction_hint``) or an OP-Liste export
(direction from the list kind). **422** for any other document type; **413** when the
file exceeds the upload cap or the analyzer's own (lower) one; **503** when doculyse
is unreachable. Rate-limited per user (LLM call).

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Response `200`

Successful Response

- OnboardingOpenItemExtractOut: ``POST /onboarding/extract-open-items`` → draft open items (no DB write). ``items`` rows are drafts for the wizard table — the user reviews/edits before they enter the atomic create. Credit notes (negative open amounts) are EXCLUDED with a document-level warning: ``gl_open_item`` holds magnitudes.
  - `items` OnboardingOpenItemDraft[]
    - `direction` 'receivable' | 'payable', required
    - `counterparty_name` string
    - `amount_cents` integer
    - `invoice_number` string, nullable
    - `issue_date` string, date, nullable
    - `due_date` string, date, nullable
    - `vat_rate_bps` integer, nullable
    - `vat_amount_cents` integer, nullable
    - `vat_basis` 'agreed' | 'collected', nullable
    - `vat_method` 'effective' | 'net_tax_rate' | 'flat_tax_rate', nullable
    - `supply_date` string, date, nullable
    - `invoice_gross_cents` integer, nullable
    - `vat_recognised_cents` integer, nullable
    - `staging_ref` string, nullable
    - `currency` string, nullable
  - `document` OnboardingOpenItemSourceDocument, required: The staged source document behind an extract-open-items call (provenance).
    - `staging_ref` string, required
    - `filename` string, required
    - `document_type` string, required
  - `warnings` OnboardingOpenItemWarning[]
    - `code` string, required
    - `message` string, required
    - `row_index` integer, nullable

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