Documentation menu

Verification

Verify many references in one ordered result.

Batch verification uses the same provider detection as the universal route and preserves one result for every submitted item.

Endpoint

POST/verify-batchBatch access required
Submit multiple references in one request, up to your workspace’s batch limit.
json
{
  "references": [
    { "reference": "ABC123DE45" },
    { "reference": "FT12AB34CD56", "suffix": "12345678" }
  ]
}
typescript
import { veritas } from "@/lib/veritas";

type BatchResult = {
  success: boolean;
  total: number;
  succeeded: number;
  failed: number;
  results: Array<{
    index: number;
    reference: string;
    success: boolean;
    provider?: string;
    data?: unknown;
    error?: string;
  }>;
};

const batch = await veritas<BatchResult>("/verify-batch", {
  method: "POST",
  body: JSON.stringify({
    references: [
      { reference: "ABC123DE45" },
      { reference: "FT12AB34CD56", suffix: "12345678" },
    ],
  }),
});

for (const item of batch.results) {
  console.log(item.index, item.success, item.error ?? item.data);
}

Results

json
{
  "success": true,
  "total": 2,
  "succeeded": 1,
  "failed": 1,
  "results": [
    { "index": 0, "success": true, "reference": "ABC123DE45", "provider": "telebirr", "data": {} },
    { "index": 1, "success": false, "reference": "FT12AB34CD56", "error": "Verification failed" }
  ]
}

Items run with limited concurrency. Output remains aligned to input through the numeric index, even when some checks fail.

Credits and partial failure

The workspace is charged for the full references.length before per-item validation. Partial failure does not refund credits. Batch-size and rate limits still apply when a workspace has unlimited monthly verification enabled.