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 webhook
2app.post('/api/shopify/product-create', async (req, res) => {
3 const product = req.body;
4
5 // Get design URL from product metafield or description
6 const designUrl = product.metafields?.design_url;
7
8 if (!designUrl) {
9 return res.status(200).send('No design URL');
10 }
11
12 // Generate mockups for all templates
13 const templates = ['tshirt_front', 'tshirt_back', 'lifestyle'];
14 const mockupUrls = [];
15
16 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: 90
33 }
34 })
35 });
36
37 const result = await response.json();
38 mockupUrls.push(result.data.print_files[0].export_path);
39 }
40
41 // Add images to Shopify product
42 await addImagesToProduct(product.id, mockupUrls);
43
44 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_PASSWORD
6 });
7
8 for (const url of imageUrls) {
9 await shopify.productImage.create(productId, {
10 src: url,
11 position: imageUrls.indexOf(url) + 1
12 });
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 });
2
3for (const product of products) {
4 const designUrl = getDesignUrl(product);
5
6 if (product.images.length === 0 && designUrl) {
7 const mockups = await generateMockups(designUrl);
8 await addImagesToProduct(product.id, mockups);
9
10 console.log(`Generated images for: ${product.title}`);
11
12 // Respect rate limits
13 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.