Factuarea APIDevelopers
Added

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

EndpointDescription
POST /v1/purchase_scansUpload up to 20 files in one multipart batch
GET /v1/purchase_scansList scans, filterable by document_kind, file_kind and supplier_link_state
GET /v1/purchase_scans/statsStatus 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}/sourceDownload the original, encrypted file as binary
POST /v1/purchase_scans/{id}/retryStart or re-run OCR on a received or failed scan
PUT /v1/purchase_scans/{id}/reviewPatch reviewed fields and lines, including catalog_selection
POST /v1/purchase_scans/{id}/duplicate_resolutionLink to an existing purchase or archive as a confirmed duplicate — irreversible
POST /v1/purchase_scans/{id}/convertCreate the linked purchase draft — irreversible
DELETE /v1/purchase_scans/{id}Archive a scan
POST /v1/purchase_scans/{id}/restoreRestore an archived scan
GET /v1/purchase_scan_emailsList inbound scanner-mailbox emails, including pending, parked and failed results, sender_authentication and reason
GET /v1/purchase_invoices/expense_categoriesList the expense categories available for a simplified purchase

What each operation adds

  • New listing filters — GET /v1/purchase_scans filters by source, supplier_id, document_kind, file_kind, supplier_link_state, has_issues and sender; source and supplier_id accept a comma-separated list of values. List items carry the same three classification fields plus issue_count, the count of pending issues left to review — not the raw per-field issue count. document_kind is one of invoice, simplified_qualified, ticket, delivery_note, other or undetermined.
  • Per-line purchase fields and catalog_selection in review — a line patch in PUT /v1/purchase_scans/{id}/review can set the five purchase-specific fields once available on the scan (supplier_sku, unit_code, price_unit_code, package_quantity, measured_base_quantity) and catalog_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 a 422.
  • scope and facets in stats — GET /v1/purchase_scans/stats accepts scope=inbox (default) or scope=history, and adds facets.by_document_kind, facets.by_file_kind and facets.by_supplier_link_state next to its existing status counters.
  • Multi-value results in the mailbox — GET /v1/purchase_scan_emails filters by several result values at once and each entry now also publishes sender_authentication and, 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_large body, not an app-level error.

Two existing operations change too

  • POST /v1/purchase_invoices and PUT /v1/purchase_invoices/{id} now accept up to 10,000 characters in notes — up from 1,000 — matching the limit scan review already uses.
  • Both also reject an external_id starting with the reserved purchase-scan: prefix with a 422 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

EndpointDescription
GET/v1/purchase_invoices/expense_categoriesList expense categories
GET/v1/purchase_scan_emailsList purchase scanner emails
DEL/v1/purchase_scans/{purchase_scan}Archive a purchase scan
POST/v1/purchase_scans/{purchase_scan}/convertCreate the expense from a scan
POST/v1/purchase_scansUpload documents to the purchase scanner
POST/v1/purchase_scans/{purchase_scan}/duplicate_resolutionResolve a duplicate purchase scan
GET/v1/purchase_scansList purchase scans
POST/v1/purchase_scans/{purchase_scan}/restoreRestore an archived purchase scan
POST/v1/purchase_scans/{purchase_scan}/retryRetry a failed purchase scan
PUT/v1/purchase_scans/{purchase_scan}/reviewSave the review of a purchase scan
GET/v1/purchase_scans/{purchase_scan}Retrieve a purchase scan
GET/v1/purchase_scans/{purchase_scan}/sourceDownload the original document
GET/v1/purchase_scans/statsGet purchase scanner stats

Updated endpoints2

EndpointDescription
POST/v1/purchase_invoicesCreate an expense
PUT/v1/purchase_invoices/{purchase_invoice}Update an expense

On this page

Need a hand?Contact support