Nov 10, 20258 minSudoMock Team
Shopify Product Images at Scale: API Approach
Automate Shopify product image generation with mockup APIs. Bulk create variants for your entire catalog.
Running a Shopify store with hundreds of products? Learn how to automate product image generation using mockup APIs - creating professional visuals for your entire catalog in minutes.
500+
Products
Handled in one batch
Fast
Rendering
Generation time
$1
Cost
Per 500 images
API
Integration
Shopify + SudoMock
The Shopify Image Problem
Every Shopify product needs multiple high-quality images. For POD stores, that means mockups showing your designs on actual products. Manual creation doesn't scale.
Multiple angles - Front, back, detail shots per product
Color variants - Same design, different product colors
Size consistency - Shopify expects uniform image dimensions
Fast updates - New designs need images immediately
Solution: API-Powered Pipeline
1
Upload Your Templates
Create mockup templates for each product type in your store. Upload them to SudoMock once.
Upload template
bash
1curl -X POST "https://api.sudomock.com/api/v1/psd/upload" \2 -H "X-API-KEY: YOUR_API_KEY" \3 -d '{4 "psd_file_url": "https://storage.com/tshirt-front.psd",5 "psd_name": "T-Shirt Front View"6 }'
2
Generate Mockups on Product Create
Use Shopify's product webhook to trigger mockup generation whenever you add a new product.
Shopify product handler
javascript
1// Express.js endpoint for Shopify webhook2app.post('/api/shopify/product-create', async (req, res) => {3 const product = req.body;45 // Get design URL from product metafield or description6 const designUrl = product.metafields?.design_url;78 if (!designUrl) {9 return res.status(200).send('No design URL');10 }1112 // Generate mockups for all templates13 const templates = ['tshirt_front', 'tshirt_back', 'lifestyle'];14 const mockupUrls = [];1516 for (const template of templates) {17 const response = await fetch('https://api.sudomock.com/api/v1/renders', {18 method: 'POST',19 headers: {20 'X-API-KEY': process.env.SUDOMOCK_API_KEY,21 'Content-Type': 'application/json'22 },23 body: JSON.stringify({24 mockup_uuid: TEMPLATE_IDS[template],25 smart_objects: [{26 uuid: SO_IDS[template],27 asset: { url: designUrl }28 }],29 export_options: {30 image_format: 'webp',31 image_size: 2048,32 quality: 9033 }34 })35 });3637 const result = await response.json();38 mockupUrls.push(result.data.print_files[0].export_path);39 }4041 // Add images to Shopify product42 await addImagesToProduct(product.id, mockupUrls);4344 res.status(200).send('Mockups generated');45});
3
Attach Images to Shopify
Use Shopify Admin API to attach the generated mockups to your product.
Add images to Shopify
javascript
1async function addImagesToProduct(productId, imageUrls) {2 const shopify = new Shopify({3 shopName: process.env.SHOPIFY_SHOP,4 apiKey: process.env.SHOPIFY_API_KEY,5 password: process.env.SHOPIFY_PASSWORD6 });78 for (const url of imageUrls) {9 await shopify.productImage.create(productId, {10 src: url,11 position: imageUrls.indexOf(url) + 112 });13 }14}
Variant Images
For products with color variants, generate a mockup for each variant and use Shopify's variant image association to show the correct mockup when customers select different colors.
No-Code Alternative: Zapier
Not a developer? Use Zapier to connect Shopify and SudoMock without writing code.
Trigger - New Shopify Product
Action 1 - Webhooks by Zapier → SudoMock API
Action 2 - Shopify → Add Product Image
Batch Processing Existing Products
Have an existing catalog? Process all products at once:
Batch process catalog
javascript
1const products = await shopify.product.list({ limit: 250 });23for (const product of products) {4 const designUrl = getDesignUrl(product);56 if (product.images.length === 0 && designUrl) {7 const mockups = await generateMockups(designUrl);8 await addImagesToProduct(product.id, mockups);910 console.log(`Generated images for: ${product.title}`);1112 // Respect rate limits13 await sleep(500);14 }15}
Result
A complete Shopify store with 500 products can have all mockup images generated in under 30 minutes - automatically.
Related Resources
Ready to Try SudoMock?
Start automating your mockups with 500 free API credits.