# Extract invoice (German/DATEV-optimized)

> `POST /job/add/workflow` · Section: Document AI — OCR & IDP · PaperOffice AI API, release `R20261020.1635`.

`POST https://api.paperoffice.ai/latest/job/add/workflow`

## Overview
Extract data from German invoices with DATEV-compatible fields. Fields: invoice number, date, supplier, customer, net, gross, VAT, IBAN, BIC.

## Request parameters
Use processing_lane for Start-SLA (no_sla|sla_24h|sla_12h|sla_6h|sla_1h|instant).

**Cost:** 10 credits (base, at Start-SLA `no_sla` / ×1; higher lanes multiply job price)

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `file_1` | string | One of (`file_1`, `pofid`) | Multipart file upload (PDF or image). At least one document input is required. |
| `model` | string | Yes | AI processing tier (flat pricing). Basic=OCR+Vision, Premium=+AI thinking, Ultra=+AI reasoning. pro/pro-max variants add higher page limits. (allowed: basic, basic-pro, basic-pro-max, premium, premium-pro, premium-pro-max, ultra, ultra-pro, ultra-pro-max) (default: "premium") |
| `idp_collection` | string | No | invoice:de = German output, invoice:en = English, invoice:es = Spanish (default: "invoice:de") |
| `idp_fields` | string | No | OPTIONAL: Additional fields as JSON (default: "") |
| `priority` | integer | No | LEGACY queue weight (numeric). Prefer processing_lane (Start-SLA). If processing_lane is set, the lane wins. Do not use as the public SLA product. |
| `client_wait` | boolean | No | Connection hold: true (default) = API holds this HTTP request while the job runs, up to the dynamic pipeline timeout (priority, pages, pipeline type; minimum about 20s, infrastructure cap about 295s). Returns the finished result when ready, or HTTP 202 with job_id and poll_url if the hold is exceeded. false = immediate job_id. |
| `async_only` | boolean | No | Force async: same as client_wait=false. Returns job_id immediately; poll GET /job/get/{job_id}. (default: false) |
| `processing_lane` | string | No | Start-SLA lane (wait-to-start guarantee, not completion). Values: no_sla (fair use ×1), sla_24h (×1.5), sla_12h (×2), sla_6h (×3), sla_1h (×4), instant (×5 interactive start). Prefer this over legacy numeric priority. If omitted: workspace default_processing_lane, else no_sla. (allowed: no_sla, sla_24h, sla_12h, sla_6h, sla_1h, instant) |
| `pofid` | string | One of (`file_1`, `pofid`) | Existing document POFID as an alternative to multipart upload (`file` / `file_1` / `files`). JSON `files` URL arrays are not supported on `/job/add/workflow`. |

## Required alternatives

Provide **at least one** of: `file_1` **or** `pofid`.

**Request body:** `multipart/form-data` — upload via field `file`, `file_1`, or `files` **or** pass `pofid` in the form body. Runtime accepts `file`, `files`, `file_1`, `file_2`, …. The parameter table lists `file_1` and `pofid` as **one of** when both exist. **Exception:** JSON `files` URL arrays are **not** supported on `/job/add/workflow` (unlike most `/job/add/{pipeline}` endpoints). Do not send `application/json` with a `files` array.

## Responses

Returns JSON with `status: "success"`; key fields: `job_id` or inline **`result`**. After poll, workflow/IDP payload stays in **`result`** (not `job_result`). When `idp_collection=invoice`: `pages_idp` / `pages_aiocr` with `_supplier_name`, `_total_amount`. Always read `result ?? job_result`. Optional `_billing` and `processing_time`. Errors: HTTP 4xx/5xx with `status: "error"`, `code`, and `message`.

## Connection hold & polling

- **Default (`client_wait` omitted or `true`):** The API holds **this HTTP connection** while the job runs, up to the **dynamic pipeline timeout** (priority, pages, pipeline type; minimum about 20s, infrastructure cap about 295s). Returns the finished result when ready.
- **Hold exceeded:** If the job is not finished in time → **HTTP 202** with `job_id`, `poll_url`, `max_wait_seconds`, and `client_wait: false`. The job **continues in the background** — poll `GET /job/get/{job_id}` every 5–10 seconds.
- **Immediate poll mode:** `client_wait=false` or `async_only=true` → `job_id` immediately (about 100ms), then poll as above.

**Response fields:** `client_wait` (boolean) — whether this response used connection hold; `max_wait_seconds` — actual hold duration attempted.

**Completed payload key:** After polling, OCR pipelines return the payload in `job_result`; workflow/IDP (`POST /job/add/workflow`) return it in `result`. Always read `result ?? job_result`. See **Job result schema**.

**Note:** Prefer `processing_lane` Start-SLA for wait-to-start / job price — see collection guide **Start-SLA (`processing_lane`) — wait-to-start**. Legacy `priority` is compat only.

## Essentials (all endpoints)

- **Base URL:** `https://api.paperoffice.ai/latest` · **Auth:** `Authorization: Bearer po_sk_…` or `po_ut_…` (server-side only); browser code uses `po_pk_…` with an allowlisted `Origin`. No Bearer at all on a product API returns HTTP 403 `TIER_RESTRICTED`.
- **Errors:** HTTP 4xx/5xx with `status: "error"`, `code` and `message`. Retry 429 (`Retry-After`) and 5xx with exponential backoff; do not retry validation errors.
- **Jobs:** `client_wait=true` (default) holds the connection. HTTP 202 means the job is still running — poll `GET /job/get/{job_id}` every 5–10 s until `job_status` is `completed`, then read `result ?? job_result`. `processing_lane` sets the Start-SLA; legacy `priority` is not part of the public contract.
- **Billing:** every billable product call costs at least 5 credits; read `_billing.job.credits_billed` on billed responses.
- **Mutations** use `POST` with action paths (e.g. `POST /documents/document-delete`), not HTTP `DELETE`.

---

All endpoints: [llms.txt](https://api.paperoffice.ai/latest/docs/llms.txt) · Everything in one file: [llms-full.txt](https://api.paperoffice.ai/latest/docs/llms-full.txt) · [OpenAPI 3.1](https://api.paperoffice.ai/latest/docs/openapi.json) · This page: https://api.paperoffice.ai/latest/docs/endpoints/po-extraction-invoice-germandeutsch.md

*Generated 2026-10-20 from live API documentation (release `R20261020.1635`).*
