SDK npm package is not published yet and API environments may be unavailable.View status
Ananke TCode

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

MethodInputEndpointAuth required
By referenceDocument reference (e.g. TCR-ABCD1234)GET /v1/tcode/verify/reference/{reference}No
By hashDocument content fingerprintGET /v1/tcode/verify/hash/{hash}No
By payloadRaw Ananke TCode barcode scan payloadPOST /v1/tcode/verifyNo
Sync verifyPayload + verification contextPOST /v1/tcode/verify/syncNo

Verify by reference

SDK — 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

SDK — 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:

SDK — Verify scanned payload
const result = await client.tcode.verify.byPayload({
  payload: scannedPayloadBase64,
});

console.log(result.verdict);  // "valid"
curl — Verify scanned payload
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:

Sync verification
POST /v1/tcode/verify/sync
{
  "payload": "<base64-encoded payload>",
  "context": {
    "scannerId": "device-001",
    "location": "Checkpoint A"
  }
}

Verification outcomes

VerdictMeaning
validDocument is authentic and in Active state.
suspendedDocument is authentic but temporarily suspended.
revokedDocument is authentic but permanently revoked.
not_foundNo 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:

SDK — Scan history
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:

curl — Digital twin
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 400 with 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 revoked with 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