Google Sheets Integration
Generate mockups directly from your Google Sheets. Perfect for bulk processing and team collaboration.
Bulk Processing Made Easy
List designs in a spreadsheet → Run script → Get mockup URLs in new column
Use Cases
Bulk Mockup Generation
Process hundreds of designs from a spreadsheet
Team Workflows
Share sheet with team, anyone can trigger generation
CSV Import
Import product list, generate all mockups at once
Reporting
Track mockup generation status and costs
Setup Guide
Prepare Your Spreadsheet
Create a Google Sheet with these columns:
- A: Design URL — Public URL to your design image
- B: Product Type — t-shirt, mug, poster, etc.
- C: Mockup URL — Will be filled by script
- D: Status — Processing status
Open Apps Script
Go to Extensions → Apps Script. This opens the script editor.
Add the Script
Replace the default code with:
1// Google Apps Script for SudoMock Integration2const SUDOMOCK_API_KEY = 'YOUR_API_KEY';3const API_URL = 'https://api.sudomock.com/api/v1/renders';45// Template configuration6const TEMPLATES = {7 't-shirt': { mockup_uuid: 'your-tshirt-uuid', smart_object_uuid: 'your-so-uuid' },8 'mug': { mockup_uuid: 'your-mug-uuid', smart_object_uuid: 'your-so-uuid' },9 'poster': { mockup_uuid: 'your-poster-uuid', smart_object_uuid: 'your-so-uuid' },10 'hoodie': { mockup_uuid: 'your-hoodie-uuid', smart_object_uuid: 'your-so-uuid' }11};1213/**14 * Generate mockups for all rows with design URLs15 * Run this function from the Apps Script editor16 */17function generateAllMockups() {18 const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();19 const data = sheet.getDataRange().getValues();20 21 // Skip header row22 for (let i = 1; i < data.length; i++) {23 const designUrl = data[i][0];24 const productType = data[i][1]?.toLowerCase();25 const mockupUrl = data[i][2];26 27 // Skip if no design URL or already processed28 if (!designUrl || mockupUrl) continue;29 30 // Update status31 sheet.getRange(i + 1, 4).setValue('Processing...');32 SpreadsheetApp.flush();33 34 try {35 const result = generateMockup(designUrl, productType);36 sheet.getRange(i + 1, 3).setValue(result.mockupUrl);37 sheet.getRange(i + 1, 4).setValue('Done');38 } catch (error) {39 sheet.getRange(i + 1, 4).setValue('Error: ' + error.message);40 }41 42 // Small delay to avoid rate limits43 Utilities.sleep(500);44 }45 46 SpreadsheetApp.getUi().alert('Mockup generation complete!');47}4849/**50 * Generate a single mockup51 */52function generateMockup(designUrl, productType) {53 const template = TEMPLATES[productType];54 55 if (!template) {56 throw new Error('Unknown product type: ' + productType);57 }58 59 const payload = {60 mockup_uuid: template.mockup_uuid,61 smart_objects: [{62 uuid: template.smart_object_uuid,63 asset: { url: designUrl }64 }],65 export_options: {66 image_format: 'webp',67 image_size: 2000,68 quality: 9569 }70 };71 72 const options = {73 method: 'post',74 contentType: 'application/json',75 headers: {76 'X-API-KEY': SUDOMOCK_API_KEY77 },78 payload: JSON.stringify(payload),79 muteHttpExceptions: true80 };81 82 const response = UrlFetchApp.fetch(API_URL, options);83 const result = JSON.parse(response.getContentText());84 85 if (!result.success) {86 throw new Error(result.detail || 'API error');87 }88 89 return {90 mockupUrl: result.data.print_files[0].export_path91 };92}9394/**95 * Add custom menu to spreadsheet96 */97function onOpen() {98 SpreadsheetApp.getUi()99 .createMenu('SudoMock')100 .addItem('Generate All Mockups', 'generateAllMockups')101 .addItem('Generate Selected Row', 'generateSelectedRow')102 .addToUi();103}104105/**106 * Generate mockup for currently selected row107 */108function generateSelectedRow() {109 const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();110 const row = sheet.getActiveCell().getRow();111 112 if (row === 1) {113 SpreadsheetApp.getUi().alert('Please select a data row, not the header.');114 return;115 }116 117 const designUrl = sheet.getRange(row, 1).getValue();118 const productType = sheet.getRange(row, 2).getValue()?.toLowerCase();119 120 if (!designUrl) {121 SpreadsheetApp.getUi().alert('No design URL in selected row.');122 return;123 }124 125 sheet.getRange(row, 4).setValue('Processing...');126 127 try {128 const result = generateMockup(designUrl, productType);129 sheet.getRange(row, 3).setValue(result.mockupUrl);130 sheet.getRange(row, 4).setValue('Done');131 SpreadsheetApp.getUi().alert('Mockup generated successfully!');132 } catch (error) {133 sheet.getRange(row, 4).setValue('Error: ' + error.message);134 SpreadsheetApp.getUi().alert('Error: ' + error.message);135 }136}Configure API Key
Replace YOUR_API_KEY with your SudoMock API key. Replace the template UUIDs with your actual mockup template IDs.
Security Note
PropertiesService.getScriptProperties().setProperty('SUDOMOCK_API_KEY', 'your-key');Run the Script
Save the script (Ctrl+S), then reload your spreadsheet. You'll see a new "SudoMock" menu. Click it to generate mockups.
Alternative: Using n8n
For more complex workflows, use n8n with Google Sheets trigger:
1// n8n Workflow Structure21. Google Sheets Trigger3 - Trigger on: Row Added4 - Sheet: Your product sheet562. HTTP Request (SudoMock)7 - POST https://api.sudomock.com/api/v1/renders8 - Headers: X-API-KEY = {{ $credentials.sudomockApi.apiKey }}9 - Body: Dynamic based on row data10113. Google Sheets Update12 - Update row with mockup URLReady to Automate?
Get your API key and start generating mockups from Google Sheets.