Verification & scans
Verify Ananke TCode stamps by reference, by fingerprint, or by scanning the DataMatrix barcode. Understand scan flows, verification outcomes, and edge cases.
Overview
Ananke TCode verification checks the authenticity and status of a stamped document. It works through three inputs: the document reference, its content fingerprint, or the raw barcode payload from a scan. All methods return the same structured result with a verdict and document status.
Verification methods
| Method | Input | Endpoint | Auth required |
|---|---|---|---|
| By reference | Document reference (e.g. TCR-ABCD1234) | GET /v1/tcode/verify/reference/{reference} | No |
| By hash | Document content fingerprint | GET /v1/tcode/verify/hash/{hash} | No |
| By payload | Raw Ananke TCode barcode scan payload | POST /v1/tcode/verify | No |
| Sync verify | Payload + verification context | POST /v1/tcode/verify/sync | No |
Verify by reference
const result = await client.tcode.verify.byReference("TCR-ABCD1234");
console.log(result.verdict); // "valid"
console.log(result.status); // "Active"
console.log(result.issuerName); // "Acme Corp"Verify by hash
const result = await client.tcode.verify.byHash(
"e3b0c44298fc1c149afbf4c8996fb924..."
);
console.log(result.verdict); // "valid" | "revoked" | "not_found"Verify by payload (scan)
When a user scans the DataMatrix barcode, the scanner decodes the scan payload. Send it to the verification endpoint:
const result = await client.tcode.verify.byPayload({
payload: scannedPayloadBase64,
});
console.log(result.verdict); // "valid"curl -X POST https://api.anankelabs.net/v1/tcode/verify \
-H "Content-Type: application/json" \
-d '{ "payload": "<base64-encoded barcode payload>" }'Sync verification
Sync verification is used when the scanner provides additional context (location, device info) that should be recorded alongside the verification result:
POST /v1/tcode/verify/sync
{
"payload": "<base64-encoded payload>",
"context": {
"scannerId": "device-001",
"location": "Checkpoint A"
}
}Verification outcomes
| Verdict | Meaning |
|---|---|
valid | Document is authentic and in Active state. |
suspended | Document is authentic but temporarily suspended. |
revoked | Document is authentic but permanently revoked. |
not_found | No matching stamp found. The payload may be corrupted or the stamp does not exist. |
Scan history
Retrieve the verification / scan history for a specific document:
const scans = await client.tcode.verify.documentScans("TCR-ABCD1234", {
page: 1,
pageSize: 25,
});
for (const scan of scans.items) {
console.log(scan.verdict, scan.verifiedAt);
}Digital twin
Retrieve the digital twin — the full document record associated with an Ananke TCode stamp:
GET /v1/tcode/verify/digital-twin/{reference}This returns the stamp metadata, verification status, and document details without requiring any authentication. Useful for building public verification landing pages.
Advanced integration
For advanced integrators building custom verification workflows, use the published verification endpoints and SDK methods to avoid coupling to internal stamp internals.
Edge cases
- Corrupted barcode — If the payload cannot be decoded, the endpoint returns
400with a descriptive error. - Expired documents — Ananke TCode stamps do not expire by default. Lifecycle is managed via explicit suspend/revoke actions.
- Replaced documents — Verifying the old reference returns
revokedwith a pointer to the replacement. - Offline verification — The barcode payload includes a signature that can be checked locally for quick validation. The online check is needed to confirm the current lifecycle state.
Next steps
- Guide: Build a verification page — Frontend UI patterns.
- Ananke TCode API Reference — Full endpoint documentation.
- TypeScript SDK: Ananke TCode — SDK method reference.