ingest_purchase_pdf
AI extracts purchase data from PDFs and images, reads supplier, lines, and taxes, and creates a purchase document while deduplicating by invoice identity to avoid duplicate invoices.
Instructions
Queue a purchase PDF/image for AI extraction (OCR -> deduped purchase).
The AI reads the supplier, lines and taxes and creates the purchase doc, deduplicating by invoice identity (contact + supplier_invoice_number, fallback total + date) so the same invoice never lands twice. Runs async: this returns a job immediately — poll get_ingest_job(job_id) until its status is done, then read result for the created document.
Args: file_path: local path to a PDF / JPG / PNG / WebP / HEIC. force: bypass dedup and ingest anyway (use only when you are sure it is a genuinely distinct invoice).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | ||
| file_path | Yes |