Skip to main content

Get Attachment OCR Extraction

GET 

/api/purchase-invoices/:purchaseInvoice/attachments/:attachment/ocr

Get the latest OCR extraction result for an invoice attachment. Read-only — never triggers a scan.

Required scope: purchase-orders:read

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Returns "data": null when the attachment has not been scanned yet (or the first scan is still running). Re-scanning keeps history; only the newest extraction is returned.

The extraction contains:

  • header — extracted invoice fields, each as {value, confidence} (invoice_number, invoice_date, due_date, vendor_name, total_amount, subtotal, tax_amount, currency_code, po_number, addresses).
  • extracted_lines — document lines matched to purchase order product lines (matched_po_line_id) or cost lines (matched_financial_line_id), with match_confidence of high, medium, low, or none, plus unit price variance versus the PO.
  • unmatched_lines — lines that could not be matched; ignored reflects choices saved via Apply OCR Extraction to Invoice.

Returns 404 if the attachment does not belong to the given invoice. Requires the purchase-orders:read token scope.

Request

Responses

OK

Response Headers
    Content-Type