Skip to content

T3 Labels

Introduction

T3 Labels enables you to design, generate, and print fully customized labels using data directly from Metrc. Whether you're printing product tags, package labels, or compliance stickers, T3 Labels streamlines your entire labeling workflow.

There are three core ideas surrounding T3 Labels:

  1. Easily create flexible label templates.
    • Text, tables, images, and barcodes are all supported.
    • Label generation is all done via a standardized API, meaning you can take existing label designs and alter them inside T3 or on your own.
    • Label layouts are responsive, so printing the same label layout on a different-sized label is easy.
  2. Fill label templates with any data from Metrc.
    • Any data available in Metrc can be inserted into labels.
    • This includes, but is not limited to:
      • Plants
      • Plant batches
      • Packages
      • Test results, including THC/CBD totals and top terpenes
  3. Download labels in PDF format and print them on your own label printer.
    • All label printers support the PDF format and require no special software for printing.
    • Just open the PDF with any PDF reader and send the labels to your connected printer.

Introducing T3 Label Studio


How a label gets made

Three things go in and one PDF comes out. You assemble a template, a layout and a data list, post them together to a single endpoint, and the API renders and returns the finished document.

flowchart TB
    subgraph you["What you assemble, in Label Studio or your own script"]
        T["Template<br/>size, margins, padding,<br/>rows and columns per page"]
        L["Layout<br/>the elements on one label, each<br/>with a Jinja valueTemplate"]
        D["Label data<br/>one record per label, from Metrc,<br/>demo data, a file, or typed in"]
    end

    T --> REQ
    L --> REQ
    D --> REQ
    REQ["POST /v2/labels/generate"]

    subgraph api["What the T3 API does"]
        V["Validate the body against the endpoint schema"]
        M["Merge into every record: commonContentData,<br/>your images, and the built-in t3 values"]
        P["Page the records out against the template,<br/>applying print order and label copies"]
        R["Per label, render each element onto the page:<br/>TEXT, TABLE, BOX, IMAGE,<br/>CODE128_BARCODE, QR_CODE"]
        V --> M --> P --> R
    end

    REQ --> V
    R --> PDF["One PDF, returned inline or as a download"]
    PDF --> OUT(["The preview pane, a saved file,<br/>or straight to your printer"])

The template is physical and the layout is what gets printed, which is why the two are saved separately: one layout can be printed on any template you own. The data list decides how many labels you get, because each record in it becomes exactly one label.

Each element's valueTemplate is a Jinja expression evaluated against that label's record, so {{ package.item.name }} resolves to a different item name on every label in the run:

import requests

pdf = requests.post(
    "https://api.trackandtrace.tools/v2/labels/generate",
    headers={"X-T3-API-Key": SECRET_KEY},
    json={
        "labelTemplateLayoutConfig": template,
        "labelContentLayoutConfig": layout,
        "labelContentDataList": [{"package": p} for p in packages],
    },
)

with open("labels.pdf", "wb") as f:
    f.write(pdf.content)

Labels generated without a T3+ subscription are watermarked. Everything else, the full layout editor, starter templates and demo data, works the same either way.


Getting Started

Getting Started with T3 Labels


Generating PDFs

Guide to Generating Label PDFs


Printing PDFs

Step-by-step guide to Printing Label PDFs


Label Studio

Reference for the T3 Label Studio, the visual label builder in the T3 Chrome Extension


Building Label Layouts

Learn how to Build Custom Label Layouts


Retail ID

Learn how to generate Retail ID QR code labels from a CSV file


Tutorial

Follow along with step-by-step instructions in the T3 Label Tutorial


Next Steps