OCR
Upload Credit Memo for OCR
Upload a credit memo PDF to begin OCR extraction. multipart/form-data.
Get Extraction
Get a vendor credit OCR extraction record with extracted header fields, matched lines, and related records (supplier, purchase order, duplicate vendor credit, referenced purchase invoice, candidate purchase orders).
Delete Extraction
Delete a vendor credit OCR extraction record and its associated stored file. Returns 204 No Content on success. Returns 422 if the extraction is confirmed (confirmed extractions cannot be deleted).
Stream Extraction PDF
Stream the original credit memo PDF through the backend (avoids CORS issues with direct storage URLs). The response is binary PDF content (Content-Type: application/pdf, Content-Disposition: inline) — not JSON. Returns 404 if the file is no longer available in storage.
Re-scan Extraction
Re-dispatch OCR processing for an existing extraction (e.g. after a failed scan or to pick up improved matching). Asynchronous — returns a new tracked_job_log_id. Returns 422 if the extraction is already confirmed or the original file is no longer available.
Create Vendor Credit from Extraction
Create a draft vendor credit from a reviewed OCR extraction. The OCR'd PDF is automatically attached to the new credit and the extraction is marked confirmed.
Attach Extraction to Existing Credit
Attach the OCR'd PDF to an existing vendor credit that was created manually (instead of creating a new credit from the extraction).
Apply OCR Results to Vendor Credit
Apply reviewed OCR extraction results onto an existing vendor credit (header values and/or lines).
Reclassify as Supplier Invoice
Reclassify a vendor credit extraction as a supplier invoice extraction — used when the scanned document turns out to be an invoice, not a credit memo. The vendor credit extraction is converted and a purchase invoice extraction is returned. No request body. Returns 422 if the extraction is already confirmed.
Scan Attachment with OCR
Trigger OCR processing for an existing vendor credit attachment. Only PDF attachments can be scanned (422 for other MIME types). Asynchronous — returns a tracked_job_log_id for the job progress tray. Returns 404 if the attachment does not belong to the vendor credit, and 422 if Vendor Credit OCR is not enabled in Settings → Invoice OCR.
Get Latest Attachment Extraction
Get the latest OCR extraction for a vendor credit attachment, including extracted header, matched lines, and related records. Returns data: null (200) when the attachment has never been scanned. Returns 404 if the attachment does not belong to the vendor credit.