Templates
Pre-made design templates
Endpoints
GET
/api/v1/templates
Requires: read
List all templates
GET
/api/v1/templates/:id
Requires: read
Get a template
POST
/api/v1/templates
Requires: write
Create a template
PATCH
/api/v1/templates/:id
Requires: write
Update a template
DELETE
/api/v1/templates/:id
Requires: delete
Delete a template
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id
|
uuid | Optional | Unique identifier |
name
|
string | Required | Template name |
description
|
text | Optional | Template description |
store_id
|
uuid | Required | Associated store ID |
active
|
boolean | Optional | Whether template is active |
canvas_data
|
object | Optional | Fabric.js canvas JSON data |
thumbnail_url
|
string | Optional | Thumbnail image URL |
Examples
List Templates
curl -X GET "https://trucustom.net/api/v1/templates" \
-H "Authorization: Bearer pc_your_api_key" \
-H "Content-Type: application/json"
Response:
{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"id": {},
"name": "example",
"description": "example"
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 42,
"total_pages": 3
}
}
Get Single Template
curl -X GET "https://trucustom.net/api/v1/templates/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer pc_your_api_key" \
-H "Content-Type: application/json"
Create Template
curl -X POST "https://trucustom.net/api/v1/templates" \
-H "Authorization: Bearer pc_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "value",
"store_id": {}
}'
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page |
integer | Page number (default: 1) |
per_page |
integer | Items per page (default: 20, max: 100) |
q |
string | Search query (searches name field) |