How to Use Mockupanda's Sets Feature via API to Render a Full Collection of Templates With a Single Request

By Mockupanda12 min read
How to Use Mockupanda's Sets Feature via API to Render a Full Collection of Templates With a Single Request

If you're integrating mockup generation into a custom workflow or building a print-on-demand app, you already know that managing dozens of template IDs is a headache. You end up maintaining long arrays, updating them every time your preferred template list changes, and writing extra logic just to keep everything in sync.

Mockupanda's Sets feature was built to solve exactly that. Instead of passing a raw list of template_ids in every API request, you group your favorite templates into a named Set inside the dashboard, save it once, and then reference that Set by a single set_id whenever you want to render the whole collection. One ID, one request, your entire curated collection of mockups rendered and returned.

This guide covers everything: what Sets actually are under the hood, how to build and manage them in the web app, how to hit the API correctly, and what a real-world implementation looks like for a POD catalog workflow.

What Sets Are and Why They Matter

Before diving into code, it's worth understanding the concept clearly so you can design your workflow around it properly.

Sets Are Saved, Ordered Groups of Templates

A Set in Mockupanda is a named, ordered collection of templates you define yourself. Think of it like a playlist. You curate which templates belong in the Set, arrange them in the order you want, give the Set a meaningful name, and save it. From that point on, the Set has its own unique set_id.

The ordering matters because it determines how your rendered mockup outputs are returned and displayed. If you're building a Shopify or Etsy listing flow, you probably want your hero lifestyle shot first, your close-up detail second, and your room context shot third. Sets let you encode that preference once instead of re-specifying it every time.

Sets can contain both built-in Mockupanda templates and your own custom uploaded PSD templates, which means your Set can reflect exactly the visual style your shop has established, mixing platform defaults with your own branded scenes.

The Alternative Without Sets Is Painful at Scale

To understand why Sets are valuable, imagine the alternative. You have a shop with 80 active designs. Each design should be rendered across 10 templates. Without Sets, every render request requires you to pass the same array of 10 template IDs. If you ever want to swap one template out because it's outdated or you found a better scene, you have to update that array in your code or database, redeploy, and hope nothing breaks.

With Sets, you log into the Mockupanda dashboard, edit the Set, swap the template, save, and every future API call using that set_id automatically picks up the change. No code deployment required. Your workflow stays clean and your template curation lives where it belongs: in the tool, not hardcoded into your application.

Takeaway: Use Sets any time you have a recurring group of templates you plan to render together. Even if you start with just three templates, wrapping them in a Set gives you flexibility without technical debt.

Creating and Managing Sets in the Dashboard

The easiest place to start is the web interface. You don't need to touch the API to create or edit a Set. The dashboard handles all of that, and then the API just references what you've already configured.

Building Your First Set

Log into your Mockupanda account and navigate to the Sets section of the dashboard. From there you can create a new Set, give it a descriptive name (something like "Boho Wall Art Collection" or "Square Poster Lifestyle Pack"), and start adding templates.

The template browser lets you search and filter to find exactly what you need. Mockupanda's template search uses hybrid semantic search, meaning you can type something like "natural wood frame bedroom" and it will return contextually relevant results rather than just exact keyword matches. This makes it genuinely faster to find the right scenes for your collection.

print on demand mockup templates browser interface grid view
print on demand mockup templates browser interface grid view

As you add templates to your Set, you can reorder them by dragging. Once you've arranged them the way you want, save the Set. At that point, Mockupanda assigns it a set_id, which you'll use in all your API calls.

If you want to add your own custom PSD templates to the Set, you'll need to upload those first via the custom PSD template upload feature. PSDs can be up to 300 MB, and they require a Smart Object layer named Design set as the active layer so Mockupanda knows exactly where to place your artwork. Once your custom templates are uploaded, they show up alongside the built-in library and can be added to any Set.

Editing Sets Over Time

One of the underappreciated benefits of Sets is how easy they are to maintain. As your shop evolves and you discover new templates that better match your brand aesthetic, you can open the Set, add the new templates, remove the old ones, adjust the order, and save. Your API integration doesn't need to change at all.

This is especially useful if you're running a shop where seasons or trends influence your presentation style. You might have a "Winter Collection" Set with cozy, warm-toned room scenes and a "Minimalist Pack" Set with clean white-wall frames. You can switch between them in the API simply by passing a different set_id, and the underlying template curation is managed entirely in the dashboard.

Takeaway: Spend a few minutes organizing your templates into Sets before you write a single line of API code. Getting the curation right upfront makes every downstream workflow cleaner and more flexible.

Calling the Sets API

Once your Set is created, integrating it into your workflow is straightforward. The Mockupanda REST API lives at https://www.mockupanda.com/api/v1 and uses API key authentication, which you manage under Dashboard, then API Keys.

Fetching Your Sets

Before you render anything, you might want to programmatically retrieve the Sets you've created. The API provides two endpoints for this.

To list all your Sets, make a GET request to /sets. The response gives you each Set's set_id, its name, the number of templates it contains, and the ordered list of template metadata. This is useful if you're building an admin interface or want to let users pick which Set to render against.

To fetch a specific Set's details, including its full ordered template list, call GET /sets/{id} with the set_id in the path. This is handy when you want to inspect what's in a Set before triggering a render, or when you're building UI that previews available template collections.

Here's what a basic request to retrieve a Set looks like in JavaScript:

const response = await fetch('https://www.mockupanda.com/api/v1/sets/your_set_id_here', {
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

const setData = await response.json();
console.log(setData);

The response will include the Set's name, creation date, and its full ordered template list, so you have everything you need to render or display it.

Rendering Mockups Using a Set ID

The core render call happens at POST /mockups/generate. When using a Set, you pass the set_id field instead of a template_ids array. Mockupanda handles the rest, iterating over every template in the Set and rendering your artwork into each one.

Here's a minimal working example in Python:

import requests

response = requests.post(
    'https://www.mockupanda.com/api/v1/mockups/generate',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'set_id': 'your_set_id_here',
        'artwork_urls': [
            'https://yourcdn.com/designs/floral-print-v1.png'
        ]
    }
)

result = response.json()
print(result)

The response returns the rendered mockup URLs in the same order as your Set. Simple templates render in one to two seconds, more complex scenes in two to four seconds, and if you've requested 4000px output width, expect three to five seconds. For a Set of ten templates, the whole batch is typically returned within a few seconds.

If a request fails for any reason, Mockupanda does not charge credits for it, so you never burn API budget on broken requests. Credits are priced at one cent each, meaning a ten-template Set render costs $0.10. At that rate, rendering 1,000 designs across a ten-template Set costs $100, which is on par with what you'd spend on a single seat of a design tool that can't automate anything.

Takeaway: Once you have your Set configured, the actual API call is minimal. Pass your set_id and your artwork_url, and you get back a full collection of rendered mockups in the order you defined. Start with a small Set of three to four templates to test your integration before scaling up.

Handling Multi-Frame Templates and Custom Artwork in Sets

Sets work seamlessly with Mockupanda's more advanced template types, and understanding how to handle these edge cases will save you debugging time later.

Multi-Frame Templates: Diptychs and Triptychs

Some templates in the Mockupanda library are multi-frame, meaning a single template scene contains two frames (diptych) or three frames (triptych). These are popular for wall art collections where buyers want to see how a series of prints looks arranged together.

When you include multi-frame templates in a Set and render via the API, you need to pass multiple artwork URLs in the artwork_urls array. The order of the URLs maps directly to the order of the frames in the template. So for a triptych template, you'd pass three URLs:

{
  "set_id": "your_set_id_here",
  "artwork_urls": [
    "https://yourcdn.com/designs/panel-1.png",
    "https://yourcdn.com/designs/panel-2.png",
    "https://yourcdn.com/designs/panel-3.png"
  ]
}

For single-frame templates within the same Set, Mockupanda uses only the first URL in the array. This means you can include a mix of single and multi-frame templates in one Set and pass the maximum number of artwork URLs needed, without breaking the single-frame renders.

Artwork Requirements and Quality Considerations

Artwork uploaded or referenced via URL must be JPEG, PNG, GIF, or WebP. Transparent PNG alpha is preserved through the render process, which matters a lot if your design has a transparent background that should blend naturally into the template scene.

The maximum artwork file size via the API is 20 MB, and the maximum output width is 4000px (default is 2000px). If you're producing listings for high-resolution marketplaces or plan to use mockups for print advertising, requesting 4000px output is worth the slightly longer render time. For standard Etsy listing thumbnails, 2000px is more than sufficient and renders faster.

Mockupanda explicitly does not apply AI distortion or blurring to your artwork. What you upload is what appears in the mockup, pixel-perfect. This is important to call out because some competing tools use AI warping that can subtly degrade fine text or intricate patterns in your designs.

Takeaway: If your Set includes multi-frame templates, always pass the full array of artwork URLs in the correct order. Test each multi-frame template individually first to confirm how many frames it expects before adding it to a production Set.

Real-World Workflow: Automating a POD Catalog Launch

Let's put this all together in a concrete scenario. Say you run a print-on-demand shop selling botanical wall art. You have 25 new designs ready to list. Each design should appear in 8 mockup scenes. Without automation, that's 200 individual renders to manage.

Etsy digital print wall art shop listing product photography
Etsy digital print wall art shop listing product photography

The Setup Phase

First, go into Mockupanda and create a Set called "Botanical Wall Art Launch Pack." Add your eight preferred templates: a white-wall gallery frame, a natural wood bedroom scene, a Scandinavian living room shelf, a close-up linen texture, and so on. Order them with the most conversion-friendly hero shot first. Save the Set and note the set_id.

Next, upload your 25 design files to your CDN or file storage (S3, Cloudflare R2, or even a public Dropbox link works as long as the URL is publicly accessible). Prepare a simple array or database table mapping each design to its artwork URL.

The Automation Loop

With your Set configured and your artwork URLs ready, the automation is straightforward. Loop through your 25 designs, and for each one, POST to /mockups/generate with your set_id and the artwork URL. Collect the returned mockup URLs and write them to your database keyed by design ID and template position.

designs = [
    {'id': 'fern-print-01', 'url': 'https://yourcdn.com/fern-print-01.png'},
    {'id': 'orchid-print-02', 'url': 'https://yourcdn.com/orchid-print-02.png'},
    # ... 23 more
]

results = []

for design in designs:
    response = requests.post(
        'https://www.mockupanda.com/api/v1/mockups/generate',
        headers={'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json'},
        json={'set_id': 'your_set_id_here', 'artwork_urls': [design['url']]}
    )
    data = response.json()
    results.append({'design_id': design['id'], 'mockups': data['mockups']})

At one cent per mockup and eight templates per Set, each design costs $0.08 to fully render. All 25 designs cost exactly $2.00. The renders come back in seconds. Compare that to manually creating 200 mockups in a traditional editor and the time savings are enormous, even before you factor in the consistency benefits of using the same curated template Set every time.

The rate limits are generous for this use case: 100 requests per minute and 10,000 requests per day per API key. For a 25-design catalog launch, you'll finish the entire batch in well under a minute.

Takeaway: Map out your Sets before you write automation code. One Set per product category or style collection keeps your workflow organized and makes it easy to update template curation without touching your code.

Managing Credits and API Keys for Team or Multi-Shop Workflows

If you're building this workflow for multiple shops or as part of a client-facing tool, there are a few practical things to know about how Mockupanda handles billing and access.

API Credits Never Expire

Mockupanda's API uses a credit wallet system rather than monthly caps. One credit equals one mockup render, which costs $0.01. You top up the wallet whenever you need, with a minimum of $1.00 and a maximum of $1,000.00 per transaction. Credits never expire, which means you can load up the wallet at the start of a big catalog launch and use those credits over weeks or months without losing them.

You can check your current credit balance programmatically via GET /billing/wallet. This is useful if you want to build a guardrail into your automation that checks remaining credits before kicking off a large batch render, so you don't hit an empty wallet mid-run.

API Key Management

API keys are managed under Dashboard, then API Keys. If you're building a multi-tenant tool or working with a team, you can generate separate keys for different environments or users. There are no restrictions on the number of keys, and each key has its own rate limit allocation of 100 requests per minute and 10,000 per day.

For production workflows, it's worth using separate keys for development and production environments so you can monitor usage cleanly and rotate keys without disrupting live operations.

Takeaway: Before launching a large render job, call GET /billing/wallet to confirm you have enough credits. Load up the wallet ahead of time for predictable, uninterrupted batch runs.

Getting Started Today

If you've been managing template IDs manually in your API calls or building mockups one at a time in a design editor, Sets are the feature that makes the whole workflow snap into place.

The process is simple: create a Set in the dashboard with your curated templates, grab the set_id, and pass it in your POST /mockups/generate calls instead of a raw array of IDs. Every render comes back in the exact order you defined, pixel-perfect, at one cent per mockup.

For developers building POD integrations, the Sets API is the cleanest path to a maintainable, scalable mockup pipeline. For sellers who are just starting to explore automation, it's the feature that makes the API approachable because there's almost no complexity to manage on the request side once your Set is set up.

Head over to Mockupanda, create your first Set, and run a test render. The whole setup takes about ten minutes, and the time it saves on every future catalog launch will compound quickly.