Generate Mockup
Composite a design image onto a garment blank to create a realistic mockup.
Each generation costs 1 token.
Endpoint
POST https://garmint.app/api/v1/generate
Request Body
URL of the design image to place on the garment. Must be publicly accessible.
ID of the garment from the /garments endpoint.
Direct URL to the garment blank image (specific color variant).
Color variant name (e.g., “Black”, “White”, “Navy”).
Print zone to use. Options: front, back, left-chest, right-chest.
Design placement configuration.Show Placement properties
Horizontal position (0-100%). 50 = centered.
Vertical position (0-100%). 35 = typical chest placement.
Size scale (0.1-1.0). 1.0 = maximum print area.
Rotation in degrees (-180 to 180).
Apply subtle fabric texture effect for realism.
URL to receive a POST callback when generation completes.
Response
Unique generation ID (e.g., gen_1703001234_abc123).
Generation status: pending, processing, completed, or failed.
URL of the generated mockup image (when completed).
URL of a smaller thumbnail version.
Number of tokens consumed (always 1).
ISO 8601 timestamp of when the generation started.
ISO 8601 timestamp of when the generation finished.
Error message if status is failed.
Example
curl -X POST https://garmint.app/api/v1/generate \
-H "Authorization: Bearer gm_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"designUrl": "https://example.com/my-design.png",
"garmentId": "gildan-5000",
"garmentImageUrl": "https://cdn.shopify.com/s/files/1/.../black-tee.png",
"color": "Black",
"placement": {
"x": 50,
"y": 35,
"scale": 0.8
}
}'
Response Example
{
"id": "gen_1703001234_abc123",
"status": "completed",
"mockupUrl": "https://res.cloudinary.com/garmint/image/upload/v123/api-generations/abc123.jpg",
"thumbnailUrl": "https://res.cloudinary.com/garmint/image/upload/v123/api-generations/abc123.jpg",
"tokensUsed": 1,
"createdAt": "2024-12-19T12:00:00.000Z",
"completedAt": "2024-12-19T12:00:02.500Z"
}
Webhooks
If you provide a webhookUrl, we’ll POST the completed generation to your endpoint:
{
"event": "generation.completed",
"timestamp": "2024-12-19T12:00:02.500Z",
"data": {
"id": "gen_1703001234_abc123",
"status": "completed",
"mockupUrl": "https://...",
"tokensUsed": 1
}
}
Webhook requests have a 10-second timeout. Respond with a 200 status quickly.
Errors
| Code | Status | Description |
|---|
invalid_request | 400 | Missing required fields or invalid URLs |
insufficient_tokens | 402 | Not enough tokens |
not_found | 404 | Garment ID not found |