Factuarea APIDevelopers
Contract

Purchase scans: bounded history, deferred OCR and supplier facet

The scan detail now returns the 50 most recent attempts and audit events with their totals, scans waiting for the daily OCR quota say so, and the stats add a per-supplier facet.

24 September 2026 — three additions to the purchase scanner API. Only the first one changes something you already receive. See the scanner guide.

  • The scan detail returns the 50 most recent attempts and audit events — newest first, in GET /v1/purchase_scans/{id} and in every operation that returns the full scan (retry, review, duplicate_resolution, convert, archive, restore), plus the get_purchase_scan MCP tool. Before, both lists grew with every retry and every edit. Two new integers, attempts_total and audit_total, hold how many there are in all, so a scan with 60 attempts returns 50 entries and attempts_total: 60. Read the totals instead of counting the lists. Nothing else in the entries changes.
  • Scans waiting for the daily OCR quota say so — deferred_until (ISO 8601) and deferred_reason (ocr_daily_quota_reached) appear in the list items and in the detail. While deferred_until is set, the scan retries on its own once the company quota resets: there is no need to call retry. Both are null otherwise.
  • New facets.by_supplier in the stats — GET /v1/purchase_scans/stats lists the suppliers with at least one linked scan within the requested scope, each with its id, name and count, ordered by count descending and then by name, capped at 100 entries.

Updated endpoints3

EndpointDescription
GET/v1/purchase_scansList purchase scans
GET/v1/purchase_scans/{purchase_scan}Retrieve a purchase scan
GET/v1/purchase_scans/statsGet purchase scanner stats