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"]

    REQ --> PDF["One PDF, one label per record"]
    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. The layout editor, starter templates and demo data work the same either way.


Next Steps