Payload generation
How Ananke TCode generation works at a high level and how verification data is attached to stamped DataMatrix barcodes.
Overview
When you stamp a document, Ananke Labs generates verification data and renders it into a DataMatrix barcode embedded in the PDF.
The stamp is designed to stay compact for print usage while preserving reliable verification behavior across channels.
What a payload contains
| Field | Description |
|---|---|
| Header | Stamp identification and versioning metadata. |
| Record reference | Identifiers that map scans to the issuer verification record. |
| Metadata | Selected issuance metadata and verification context. |
| Evidence block | Integrity and issuer-validation evidence used by verification services. |
Generation flow
- You send a stamp request with the PDF and metadata.
- Ananke Labs creates verification references and evidence metadata.
- The platform builds the stamp payload for scanning workflows.
- The payload is encoded into a DataMatrix barcode.
- The barcode is rendered and placed on the PDF at the configured position.
- The stamped PDF is stored and a reference is returned.
API usage
Payload generation is automatic when using the stamp endpoint. You don't generate payloads separately — the stamp request handles everything:
curl -X POST https://api.anankelabs.net/v1/tcode/stamps \
-H "x-api-key: ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Invoice #1234",
"documentTypeCode": "INV",
"pdf": "<base64-encoded PDF>"
}'SDK usage
import { readFileSync } from "node:fs";
const stamp = await client.tcode.documents.stamp({
name: "Invoice #1234",
documentTypeCode: "INV",
pdf: readFileSync("./invoice.pdf"),
});
// The returned stamp includes the generated reference
console.log(stamp.reference); // "TCR-XXXX"Payload structure
The payload follows an internal structured format. Developers generally don't need to parse this directly — the verification API handles decode and validation.
The verification endpoint accepts the raw payload and returns a structured result without requiring the verifier to understand internal payload structure.
Next steps
- Stamping PDFs — Place the barcode into a document.
- Verification & scans — Verify stamped documents.
- Guide: Generate an Ananke TCode — End-to-end tutorial.