Ananke TCode
Stamp PDFs with DataMatrix barcodes that encode document metadata and a cryptographic signature. Scanners can verify the document offline or online.
What is Ananke TCode?
Ananke TCode is Ananke Labs's document stamping and scan-based verification product. It embeds a DataMatrix barcode into a PDF that encodes document metadata, a content hash, and a cryptographic signature. Anyone with a barcode scanner — either a mobile app or a desktop reader — can verify the document's authenticity.
Ananke TCode is designed for physical and printed documents where the verification must survive the transition from digital to paper and back.
When to use Ananke TCode
- Documents that will be printed and physically distributed.
- Scenarios where offline verification is important (no internet required for basic checks).
- Adding tamper-evidence to existing PDFs without changing document format.
- Government or regulatory contexts where a visible integrity mark is required.
Core objects
| Resource | Description |
|---|---|
Stamp | A stamped PDF with an embedded DataMatrix barcode. Has a reference, status, and metadata. |
Placement Template | Configures where and how the barcode appears on the PDF (position, size, margins). |
TDoc Template | Defines the document schema and field mapping for Ananke TCode stamps. |
BulkJob | Processes many stamps at once from a CSV + ZIP upload. |
Verification | Result of verifying an Ananke TCode — verdict, document status, and scan metadata. |
Main workflows
- Stamp a PDF — Upload a PDF and parameters. Ananke Labs generates the Ananke TCode payload, renders the DataMatrix barcode, and embeds it into the document.
- Verify by scan — Scan the barcode from the printed document. The payload is sent to the verification endpoint, which checks the signature and returns the document status.
- Verify by reference — Look up a stamp by its reference code for online verification.
- Verify by hash — Verify using the document's content hash.
- Lifecycle management — Suspend, revoke, or reactivate stamps as needed.
Relation to Ananke Trust
Ananke Trust and Ananke TCode are independent products that can be used together. When both are enabled, an Ananke Trust issuance can automatically include an Ananke TCode barcode on the document PDF, combining digital credential issuance with physical document verification.
See Ananke Trust vs Ananke TCode for a detailed comparison.
Quick example
import { AnankeClient } from "@ananke/sdk";
import { readFileSync } from "node:fs";
const client = new AnankeClient({
baseUrl: "http://localhost:5300",
apiKey: process.env.ANANKE_API_KEY!,
});
const stamp = await client.tcode.documents.stamp({
name: "Invoice #1234",
documentTypeCode: "INV",
pdf: readFileSync("./invoice.pdf"),
});
console.log(stamp.reference); // "TCR-XXXX"
console.log(stamp.status); // "Active"Next steps
- Payload generation — How Ananke TCode payloads are built.
- Stamping PDFs — Place a barcode into a document.
- Verification & scans — Verify stamped documents.
- Guide: Stamp a PDF — Step-by-step tutorial.
- Ananke TCode API Reference — Full endpoint documentation.