Generate mockups
Generate product mockups for a template and return download links.
POST https://cotlet.dev/api/v1/printful/templates/{template_id}/mockups/generate
write
Generates the mockups for one template in the styles you ask for, waits until they are ready, and returns one link per image. Printful limits how often mockups can be generated, so a long list of templates runs one at a time. It writes only to the mockup page, reaches no one and changes no order, so it does not ask for confirmation.
Parameters
| Name | Type | Description |
|---|---|---|
| template_id integer required | integer | Template ID from list_product_templates. |
| styles string[] | string[] | Mockup styles to generate. Default: every style Printful offers for the product. |
Request
curl -X POST https://cotlet.dev/api/v1/printful/templates/7723/mockups/generate \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"styles":["front_flat","lifestyle"]}' result = client.call("printful", "generate_mockups", {"template_id":7723,"styles":["front_flat","lifestyle"]}) const result = await cotlet.call('printful', 'generate_mockups', {"template_id":7723,"styles":["front_flat","lifestyle"]}); cotlet call printful generate_mockups --data '{"template_id":7723,"styles":["front_flat","lifestyle"]}' Example response
{
"template_id": 7723,
"mockups": [
{
"style": "front_flat",
"url": "https://files.example.com/mockups/7723-front-flat.png"
},
{
"style": "lifestyle",
"url": "https://files.example.com/mockups/7723-lifestyle.png"
}
]
}