T-Shirt Mockup Generator API
Generate professional t-shirt mockups in under 1 second. Front, back, and lifestyle shots — all via REST API.
Why Use an API for T-Shirt Mockups?
Manual mockup creation doesn't scale. Opening Photoshop, placing designs, exporting files — it takes 5-10 minutes per mockup. With hundreds of designs and multiple color variants, that's weeks of work. SudoMock's REST API generates production-ready t-shirt mockups in milliseconds via a simple HTTP POST request.
Perfect For
- ✓Print-on-demand sellers with large design catalogs
- ✓E-commerce platforms generating product images automatically
- ✓Design tools offering mockup preview features
- ✓Marketing teams creating campaign visuals at scale
Setting Up T-Shirt Templates
Start by uploading your t-shirt PSD templates. Each template should have Smart Object layers for design placement. SudoMock supports unlimited Smart Objects per template — front print, back print, sleeve prints, all in one PSD.
1# Upload t-shirt template2curl -X POST "https://api.sudomock.com/api/v1/psd/upload" \3 -H "Content-Type: application/json" \4 -H "X-API-KEY: YOUR_API_KEY" \5 -d '{6 "psd_file_url": "https://your-storage.com/tshirt-front-black.psd",7 "psd_name": "Black T-Shirt Front"8 }'910# Response includes mockup_uuid and smart_object UUIDs11{12 "success": true,13 "data": {14 "uuid": "tshirt-black-front-uuid",15 "name": "Black T-Shirt Front",16 "smart_objects": [17 {18 "uuid": "design-area-uuid",19 "name": "Design Placement",20 "size": { "width": 2400, "height": 3200 }21 }22 ]23 }24}Generating T-Shirt Mockups
Once your template is uploaded, generate mockups by calling the render endpoint with your design URL. The API returns a CDN-hosted image URL in under 1 second.
1import requests23def generate_tshirt_mockup(design_url, color="black"):4 """Generate a t-shirt mockup with the given design"""5 6 # Template UUIDs for different t-shirt colors7 TEMPLATES = {8 "black": {9 "mockup_uuid": "tshirt-black-front-uuid",10 "smart_object_uuid": "design-area-uuid"11 },12 "white": {13 "mockup_uuid": "tshirt-white-front-uuid", 14 "smart_object_uuid": "design-area-uuid"15 },16 "navy": {17 "mockup_uuid": "tshirt-navy-front-uuid",18 "smart_object_uuid": "design-area-uuid"19 }20 }21 22 template = TEMPLATES.get(color, TEMPLATES["black"])23 24 response = requests.post(25 "https://api.sudomock.com/api/v1/renders",26 headers={27 "X-API-KEY": "YOUR_API_KEY",28 "Content-Type": "application/json"29 },30 json={31 "mockup_uuid": template["mockup_uuid"],32 "smart_objects": [{33 "uuid": template["smart_object_uuid"],34 "asset": {35 "url": design_url,36 "fit": "contain" # Preserve aspect ratio37 }38 }],39 "export_options": {40 "image_format": "webp",41 "image_size": 2000,42 "quality": 9543 }44 }45 )46 47 result = response.json()48 return result["data"]["print_files"][0]["export_path"]4950# Generate mockups for all colors51design = "https://cdn.example.com/designs/summer-vibes.png"52for color in ["black", "white", "navy"]:53 mockup_url = generate_tshirt_mockup(design, color)54 print(f"{color}: {mockup_url}")Batch Processing for Variants
For POD businesses with many color variants, batch processing is essential. SudoMock supports up to 50 concurrent requests, letting you generate an entire product line in seconds.
1// Generate all t-shirt variants in parallel2const TSHIRT_COLORS = ['black', 'white', 'navy', 'red', 'gray'];3const TSHIRT_VIEWS = ['front', 'back', 'lifestyle'];45async function generateAllVariants(designUrl) {6 const renderPromises = [];7 8 for (const color of TSHIRT_COLORS) {9 for (const view of TSHIRT_VIEWS) {10 renderPromises.push(11 renderMockup({12 templateId: `tshirt-${color}-${view}`,13 designUrl,14 outputName: `${color}_${view}.webp`15 })16 );17 }18 }19 20 // 15 mockups generated in parallel21 // Total time: ~2 seconds (not 15 seconds!)22 const results = await Promise.all(renderPromises);23 24 return results;25}Pro Tip: Use WebP Format
Automation Workflows
Connect SudoMock to your design pipeline with n8n, Zapier, or Make. When a new design is uploaded to your storage, automatically generate all t-shirt mockups and push them to your e-commerce platform.
n8n Integration
Build visual workflows with the official SudoMock node.
Zapier Integration
Connect to 5,000+ apps with no-code automations.
Start Generating T-Shirt Mockups
500 free API credits to test. No credit card required.