Skip to main content

Retry Failed Extraction

POST 

/api/document-inbox/customer_po/:extraction_id/retry

Re-dispatch OCR processing for a failed extraction. Path param type must be one of customer_po, supplier_invoice, vendor_credit, or landed_cost_invoice (regex-constrained); id is the matching extraction ID.

Validations (return 422):

  • Extraction status must be 'failed'
  • Original file must still be present (file_path != null)
  • type must be customer_po, supplier_invoice, vendor_credit, or landed_cost_invoice

On success for customer_po / supplier_invoice: resets the extraction status to 'processing', clears error_message, dispatches the appropriate OCR job.

For vendor_credit: routes, which claims the extraction for processing, then re-runs the parse from the stored Azure raw_response synchronously when available (no second Azure charge), or dispatches the Scan Credit Memo job otherwise. Returns 422 with the manager's error message if the credit's documents are locked or a scan is already in progress.

For landed_cost_invoice: routes, which marks the extraction as processing and re-dispatches a background job. Returns 422 with the manager's error message on failure.

Response 200:

{ "message": "Retry queued." }

Request

Responses

Successful response