API Reference · Templates
User Guide
Developer
Templates: the catalog, as JSON
The same 11-template catalog that drives the galleries, the 3D generators, and the dieline generators — served verbatim, no auth required. The catalog is small enough that a single list call returns everything.
GET
/templatesNo authLists templates, optionally filtered. Both filters combine (AND). category must be one of the ids below; q is a case-insensitive substring match over the template id, name, and description (max 200 chars).
| Field | Type | Description |
|---|---|---|
| category | query string | A template category id from the table below. |
| q | query string | Free-text search over id, name, and description. |
curl — filter by category
curl "http://localhost/api/templates?category=mailer-boxes"200 OK
{
"templates": [
{
"id": "mailer-box",
"name": "Mailer Box",
"category": "mailer-boxes",
"kind": "box",
"defaultDimensions": { "widthMm": 230, "heightMm": 160, "depthMm": 70 },
"materials": ["cardboard", "kraft", "corrugated"],
"finishes": ["matte", "gloss", "soft-touch", "foil"],
"dielineAvailable": true,
"description": "Self-locking e-commerce mailer with tuck-in flaps. The workhorse of subscription boxes and DTC shipping."
}
],
"total": 1,
"categories": [
{ "id": "folding-cartons", "label": "Folding Cartons", "count": 1 },
{ "id": "mailer-boxes", "label": "Mailer Boxes", "count": 1 },
…
]
}total counts the filtered results, while categories always reports counts over the full catalog — faceted UIs stay stable while filters change.
| Field | Type | Description |
|---|---|---|
| 400 | ApiError | “Unknown template category '<id>'.” — the category is not one of the ten ids. |
GET
/templates/:idNo authFetches a single template definition by id.
curl
curl http://localhost/api/templates/rsc-box200 OK
{
"template": {
"id": "rsc-box",
"name": "RSC Shipping Box",
"category": "shipping-boxes",
"kind": "box",
"defaultDimensions": { "widthMm": 300, "heightMm": 220, "depthMm": 180 },
"materials": ["corrugated", "kraft"],
"finishes": ["matte"],
"dielineAvailable": true,
"description": "Regular Slotted Container — the standard corrugated shipping box, FEFCO 0201 style."
}
}| Field | Type | Description |
|---|---|---|
| 404 | ApiError | “Template '<id>' was not found.” |
Category ids
| id | label |
|---|---|
| folding-cartons | Folding Cartons |
| mailer-boxes | Mailer Boxes |
| rigid-boxes | Rigid Boxes |
| shipping-boxes | Shipping Boxes |
| product-boxes | Product Boxes |
| bottles-jars | Bottles & Jars |
| cans-tins | Cans & Tins |
| pouches-bags | Pouches & Bags |
| tubes | Tubes |
| labels-sleeves | Labels & Sleeves |
The ParametricTemplate shape
| Field | Type | Description |
|---|---|---|
| id | string | Stable identifier — used in editor URLs and project creation. |
| name | string | Display name. |
| category | string | One of the ten category ids above. |
| kind | string | box · bottle · jar · can · pouch · tube. |
| defaultDimensions | object | { widthMm, heightMm, depthMm } — millimetres. On round containers, width/depth are the diameter. |
| materials | string[] | Allowed material ids: cardboard, kraft, corrugated, plastic, glass, aluminum. |
| finishes | string[] | Allowed finish ids: matte, gloss, soft-touch, foil. |
| dielineAvailable | boolean | True for the six box templates; false for containers (no folding blank). |
| description | string | One-line human description. |