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 hash, 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 hash, 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 hashSHA-256 content hashGET /v1/tcode/verify/hash/{hash}No
By payloadRaw Ananke TCode barcode 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 binary 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.

Public key retrieval

For advanced integrators building offline verification, retrieve the signing public key:

curl — Public key
GET /v1/tcode/verify/public-key

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 verified against the public key without an internet connection. The online check is needed to confirm the current lifecycle state.

Next steps