Create Purchase Invoice from PDF
create_purchase_invoice_from_pdfCreate a draft purchase invoice from PDF-extracted data, attaching the source file and preserving exact prices.
Instructions
Create a draft purchase invoice from extracted document data and attach the source file. Direct-call contract: pass exact invoice vat_price/gross_price when known, never recalculate; non-EUR requires currency_rate (EUR per 1 foreign unit); base_* may lock actual EUR settlement.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Items [{custom_title, cl_purchase_articles_id, purchase_accounts_id, purchase_accounts_dimensions_id?, total_net_price, vat_rate_dropdown?, amount?, vat_accounts_id?, vat_accounts_dimensions_id?, cl_vat_articles_id?, reversed_vat_id?}]. purchase_accounts_dimensions_id is REQUIRED when the expense account has dimensions; same for vat_accounts_dimensions_id on dimensioned VAT accounts. | |
| notes | No | Optional notes (assumptions made, manual adjustments). Do NOT use the source document filename — the document is already uploaded and attached. | |
| currency | No | Currency code (default EUR). Use the original invoice currency (e.g. USD) and supply currency_rate. | |
| file_path | Yes | Absolute path to the source invoice document (PDF/JPG/PNG); uploaded during creation. | |
| term_days | Yes | Payment term days | |
| vat_price | No | EXACT total VAT from the original invoice; never recalculate. Omit only if truly absent from the document. | |
| ref_number | No | Reference number | |
| gross_price | No | EXACT total gross from the original invoice; never recalculate. Omit only if truly absent from the document. | |
| invoice_date | Yes | Invoice date (YYYY-MM-DD) | |
| journal_date | Yes | Turnover/booking date (YYYY-MM-DD) | |
| currency_rate | No | Exchange rate as EUR per 1 foreign currency unit. Required when currency != EUR. | |
| base_net_price | No | EUR equivalent of net_price; auto-derived from currency_rate when omitted. | |
| base_vat_price | No | EUR equivalent of vat_price; auto-derived from currency_rate when omitted. | |
| invoice_number | Yes | Invoice number | |
| bank_account_no | No | Supplier bank account | |
| base_gross_price | No | Actual settled EUR gross total; auto-derived from currency_rate when omitted. | |
| supplier_client_id | Yes | Supplier client ID (from resolve_supplier) | |
| liability_accounts_id | No | Liability account (default 2310) |