Purchase scanner: public API and MCP
Upload, review, resolve duplicates and convert purchase scans through the public API and MCP. Thirteen operations cover the full flow, the scanner mailbox and expense categories.
24 September 2026 — the purchase scanner joins the public API and MCP server, alongside the existing app: upload supplier invoices and receipts, review the extracted data, resolve duplicates and convert a reviewed scan into a purchase draft. See the scanner guide.
Thirteen new operations
| Endpoint | Description |
|---|---|
POST /v1/purchase_scans | Upload up to 20 files in one multipart batch |
GET /v1/purchase_scans | List scans, filterable by document_kind, file_kind and supplier_link_state |
GET /v1/purchase_scans/stats | Status counters, plus facets broken down the same three ways |
GET /v1/purchase_scans/{id} | Full scan detail: extraction, lines, issues, duplicate and audit trail |
GET /v1/purchase_scans/{id}/source | Download the original, encrypted file as binary |
POST /v1/purchase_scans/{id}/retry | Start or re-run OCR on a received or failed scan |
PUT /v1/purchase_scans/{id}/review | Patch reviewed fields and lines, including catalog_selection |
POST /v1/purchase_scans/{id}/duplicate_resolution | Link to an existing purchase or archive as a confirmed duplicate — irreversible |
POST /v1/purchase_scans/{id}/convert | Create the linked purchase draft — irreversible |
DELETE /v1/purchase_scans/{id} | Archive a scan |
POST /v1/purchase_scans/{id}/restore | Restore an archived scan |
GET /v1/purchase_scan_emails | List inbound scanner-mailbox emails, including pending, parked and failed results, sender_authentication and reason |
GET /v1/purchase_invoices/expense_categories | List the expense categories available for a simplified purchase |
What each operation adds
- New listing filters —
GET /v1/purchase_scansfilters bysource,supplier_id,document_kind,file_kind,supplier_link_state,has_issuesandsender;sourceandsupplier_idaccept a comma-separated list of values. List items carry the same three classification fields plusissue_count, the count of pending issues left to review — not the raw per-field issue count.document_kindis one ofinvoice,simplified_qualified,ticket,delivery_note,otherorundetermined. - Per-line purchase fields and
catalog_selectionin review — a line patch inPUT /v1/purchase_scans/{id}/reviewcan set the five purchase-specific fields once available on the scan (supplier_sku,unit_code,price_unit_code,package_quantity,measured_base_quantity) andcatalog_selection, which ties an extracted line to a resolved product, variant or presentation; omitting it keeps the current selection and a product from another company is a422. scopeand facets in stats —GET /v1/purchase_scans/statsacceptsscope=inbox(default) orscope=history, and addsfacets.by_document_kind,facets.by_file_kindandfacets.by_supplier_link_statenext to its existing status counters.- Multi-value results in the mailbox —
GET /v1/purchase_scan_emailsfilters by severalresultvalues at once and each entry now also publishessender_authenticationand, when applicable,reason. - 413 at the edge — a batch or file over the upload limits (20 files, 20
MiB per file, 100 MiB per batch) is rejected before it reaches the
application, with a JSON
413 payload_too_largebody, not an app-level error.
Two existing operations change too
POST /v1/purchase_invoicesandPUT /v1/purchase_invoices/{id}now accept up to 10,000 characters innotes— up from 1,000 — matching the limit scan review already uses.- Both also reject an
external_idstarting with the reservedpurchase-scan:prefix with a422 parameter_invalid_value: that prefix is reserved for the invoices the scanner itself creates on conversion.
See Purchase Scans error codes for the 23
codes, and the MCP tool catalog for the eleven
new tools — ten for the scanner plus
list_purchase_invoice_expense_categories.
New endpoints13
| Endpoint | Description |
|---|---|
GET/v1/purchase_invoices/expense_categories | List expense categories |
GET/v1/purchase_scan_emails | List purchase scanner emails |
DEL/v1/purchase_scans/{purchase_scan} | Archive a purchase scan |
POST/v1/purchase_scans/{purchase_scan}/convert | Create the expense from a scan |
POST/v1/purchase_scans | Upload documents to the purchase scanner |
POST/v1/purchase_scans/{purchase_scan}/duplicate_resolution | Resolve a duplicate purchase scan |
GET/v1/purchase_scans | List purchase scans |
POST/v1/purchase_scans/{purchase_scan}/restore | Restore an archived purchase scan |
POST/v1/purchase_scans/{purchase_scan}/retry | Retry a failed purchase scan |
PUT/v1/purchase_scans/{purchase_scan}/review | Save the review of a purchase scan |
GET/v1/purchase_scans/{purchase_scan} | Retrieve a purchase scan |
GET/v1/purchase_scans/{purchase_scan}/source | Download the original document |
GET/v1/purchase_scans/stats | Get purchase scanner stats |
Updated endpoints2
| Endpoint | Description |
|---|---|
POST/v1/purchase_invoices | Create an expense |
PUT/v1/purchase_invoices/{purchase_invoice} | Update an expense |