Concepts
Product variants
SKUs of a product (sizes, colors, bundles) that carry their own images for ad generation.
A product variant is a specific SKU of a product — a size, color, bundle, or other variation. Each variant has its own ordered list of images that the API uses during image ad generation.
Mental model
If your product is "Trail Runner Pro", variants are "Red / 10", "Black / 11", "Limited Edition Blue". When you generate an image ad and pass product_variant_id, the API uses that variant's images instead of the default product images. Useful when different SKUs need different hero shots.
ID prefix: pv_.
Fields
| Field | Type | Description |
|---|---|---|
id | string | pv_… |
product_id | string | Owning product (prod_…) |
name | string | Variant name (e.g., "Red / Large") |
sort_order | number | Display sort order |
image_ids | string[] | Ordered list of image IDs (img_…) for this variant |
created_at / updated_at | string | ISO timestamps |
Endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /v1/product-variants | Create a variant |
GET | /v1/product-variants | List variants |
GET | /v1/product-variants/:id | Get a variant |
PATCH | /v1/product-variants/:id | Update a variant |
DELETE | /v1/product-variants/:id | Delete a variant |
Common patterns
Create a variant with images
const response = await fetch("https://api.staticadslab.com/v1/product-variants", {
method: "POST",
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
product_id: "prod_YOUR_PRODUCT_ID",
name: "Red / Large",
image_ids: ["img_red_lg_hero", "img_red_lg_lifestyle"],
}),
});Use a variant when generating an image ad
await fetch("https://api.staticadslab.com/v1/image-ads", {
method: "POST",
headers: { "X-API-Key": "YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
design_template_id: "dt_...",
brand_id: "brand_...",
product_id: "prod_...",
audience_id: "aud_...",
product_variant_id: "pv_red_lg",
}),
});Pitfalls
- Variants have no
descriptionfield. Variant-specific copy comes from the product description and the audience. image_idsorder matters — the API treats earlier IDs as primary candidates for hero shots.- A variant must belong to a product in the same brand as the image ad request.
Related
Prompt for your agent
Read https://www.staticadslab.com/docs/resources/product-variants.mdx and create variants for product prod_YOUR_PRODUCT_ID. I have a CSV with columns name, image_urls — for each row, upload the images, then create the variant with those image IDs.