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

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

FieldDescription
HeaderStamp identification and versioning metadata.
Record referenceIdentifiers that map scans to the issuer verification record.
MetadataSelected issuance metadata and verification context.
Evidence blockIntegrity and issuer-validation evidence used by verification services.

Generation flow

  1. You send a stamp request with the PDF and metadata.
  2. Ananke Labs creates verification references and evidence metadata.
  3. The platform builds the stamp payload for scanning workflows.
  4. The payload is encoded into a DataMatrix barcode.
  5. The barcode is rendered and placed on the PDF at the configured position.
  6. 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 — Stamp request (payload generated automatically)
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

SDK — Stamp (includes payload generation)
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