Documentation

Duplicate Detection

Check a saved invoice against recent invoice history using deterministic duplicate scoring.


POST/v1/intelligence/duplicate-checkPro

Duplicate detection is available on Pro and Business. The endpoint accepts an invoice_id from a prior extraction and compares that invoice with recent invoices in the same workspace.

How It Works

The detector scores candidate pairs in priority order:

ScoreMatch signal
1.0Normalized invoice number matches exactly
0.95Same normalized vendor, exact amount, and same issue date
0.85Same normalized vendor, amount within 2%, and issue date within 3 days
0.60Same normalized vendor, amount within 5%, and issue date within 14 days
0.0No duplicate signal

A score of 0.85 or higher is treated internally as a likely duplicate.

Request

{
  "invoice_id": "2f7d7f8a-32fb-4a7c-a3b1-53b61b64252f"
}
curl -X POST https://api.parsurai.com/v1/intelligence/duplicate-check \
  -H "X-API-Key: $PARSURAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"invoice_id": "2f7d7f8a-32fb-4a7c-a3b1-53b61b64252f"}'

Response

{
  "score": 0.95,
  "reason": "likely_duplicate",
  "matching_invoice_ids": ["0b017f0d-e9d5-4bb3-a7d0-1f3df6ea9c10"]
}
FieldTypeDescription
scorenumberBest duplicate-likelihood score from 0.0 to 1.0
reasonstringno_match, possible_duplicate, or likely_duplicate
matching_invoice_idsUUID string[]Candidate invoices with the best score

Review and DATEV Export

Detection is advisory on its own, but it has one hard consequence. An invoice whose duplicate risk reaches 0.85 blocks DATEV CSV export for the entire date range until a person rules on it, and the export refuses with 409 datev_export_blocked naming the invoices that are in the way.

Recording that decision — this invoice duplicates another, or it does not, or keep it but never book it — is duplicate review. It is the only thing that clears the block.

Run duplicate checks after extraction and before writing invoice data into accounting or approval systems.