Documentation

Duplicate Review

Resolve high-risk duplicate invoices so a blocked DATEV export can run again.


An invoice scored at 0.85 or higher by duplicate detection blocks DATEV CSV export until someone rules on it. Duplicate review is how that decision is recorded, and recording it is the only thing that clears the block.

The decision never deletes, merges, or edits invoice data. It only says what the invoice is.

Why an Export Blocks

Every invoice saved on a plan that includes intelligence features carries a duplicate risk score computed at extraction time against your recent invoices. An invoice blocks a DATEV export when both of these are true:

  • its duplicate risk is 0.85 or higher, and
  • it has no review decision yet — its review status is absent or pending.

One blocking invoice fails the whole export. No partial CSV is produced: booking a duplicate into DATEV double-books it, so the export fails closed rather than quietly dropping a row.

The refusal is a 409:

{
  "error": {
    "code": "datev_export_blocked",
    "message": "DATEV export is blocked because potential duplicate invoices require review. Resolve or explicitly classify them before exporting.",
    "blocking_invoice_count": 2,
    "blocking_invoice_ids": [
      "6f1c2b8e-0f2a-4a1d-9c47-7b4e1f2a3d55",
      "b3d9a1c4-52e7-4f08-8c3b-1a9d6e5f0c22"
    ]
  }
}

Only your own invoice IDs are returned — never vendor names, amounts, or invoice numbers.

The Review Queue Is Dashboard-Only

The queue that lists blocked invoices side by side with their duplicate candidates is not part of the public API. GET /v1/internal/user/invoices/duplicate-review-queue is an internal route: it is excluded from the OpenAPI schema and authenticates with the dashboard's own internal credential, not with your API key.

Open it in the dashboard under Settings → Security, in the Data Export section, where a blocked DATEV export opens the review dialog for the invoices it named.

The decision endpoint below is public, so an integration that already knows which invoices are blocked — the export's blocking_invoice_ids tell it — can resolve them without the dashboard. What it cannot do through the public API is fetch the side-by-side comparison the dashboard shows.

Recording a Decision

PATCH /v1/invoices/{invoice_id}/duplicate-review records the decision. It is authenticated with your API key and is not plan-gated: DATEV export requires Pro or Business, but any authenticated owner can clear a block.

curl -X PATCH "https://api.parsurai.com/v1/invoices/6f1c2b8e-0f2a-4a1d-9c47-7b4e1f2a3d55/duplicate-review" \
  -H "X-API-Key: $PARSURAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "confirmed_duplicate",
    "note": "Same invoice re-sent by the vendor on 12 June.",
    "duplicate_of_invoice_id": "b3d9a1c4-52e7-4f08-8c3b-1a9d6e5f0c22"
  }'
FieldTypeRequiredDescription
statusstringYesThe decision. pending is rejected — it is not a decision
notestringNoFree text, at most 1000 characters
duplicate_of_invoice_idUUIDConditionalRequired for confirmed_duplicate, rejected for every other status
{
  "invoice_id": "6f1c2b8e-0f2a-4a1d-9c47-7b4e1f2a3d55",
  "duplicate_review_status": "confirmed_duplicate",
  "duplicate_reviewed_at": "2026-06-14T09:12:44Z",
  "duplicate_of_invoice_id": "b3d9a1c4-52e7-4f08-8c3b-1a9d6e5f0c22"
}

Decisions and What They Do

StatusMeaningEffect on the next DATEV export
confirmed_duplicateThis invoice duplicates another invoice you ownUnblocks the export; this invoice produces no booking row
confirmed_not_duplicateThe match is a false positiveUnblocks the export; this invoice is exported normally
excluded_from_exportKeep the invoice, but never book itUnblocks the export; this invoice produces no booking row
pending—Rejected: an invoice cannot be set back to pending

Use excluded_from_export when the invoice should not be booked but you cannot name the invoice it duplicates. confirmed_duplicate always requires that ID.

Excluding an invoice from the export leaves it untouched in your workspace — it is dropped from the batch, not deleted.

Error Handling

StatusCodeTypical cause
404—The invoice is not in your workspace
422invalid_duplicate_reviewstatus is pending
422invalid_duplicate_reviewconfirmed_duplicate without duplicate_of_invoice_id
422invalid_duplicate_reviewduplicate_of_invoice_id sent with any other status
422invalid_duplicate_reviewduplicate_of_invoice_id names the invoice itself
422invalid_duplicate_reviewduplicate_of_invoice_id is not an invoice you own

A referenced invoice you do not own is reported as "not found" rather than "not yours", so the endpoint cannot be used to probe for another workspace's invoice IDs.

Resolve the whole blocking_invoice_ids list before retrying the export. A single unresolved invoice fails the batch again, so clearing them one at a time costs one refused export per invoice.