Promotional
Eye-catching template for product promotions, flash sales, and e-commerce campaigns.
Dimensions: 1200x630
Template ID: promotional
Properties
| Property | Type | Required | Max Length | Validation |
|---|---|---|---|---|
productNameProduct name | string | Yes | 60 | maxLength(60) |
discountDiscount badge | string | Yes | 20 | maxLength(20) |
originalPriceOriginal price | string | Yes | 20 | maxLength(20) |
salePriceSale price | string | Yes | 20 | maxLength(20) |
imageUrlProduct image URL | string (URL) | Yes | - | url (HTTPS only) |
primaryColorPrimary color | string (hex) | Yes | - | color (hex) |
accentColorAccent color | string (hex) | Yes | - | color (hex) |
Example
{
"template": "promotional",
"productName": "Premium Wireless Headphones",
"discount": "50% OFF",
"originalPrice": "$199.99",
"salePrice": "$99.99",
"imageUrl": "https://example.com/product.jpg",
"primaryColor": "#ff3366",
"accentColor": "#ffd23f"
}Code examples
const response = await fetch("https://assets.qbacode.com/api/v1/generate-asset", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"template": "promotional",
"productName": "Premium Wireless Headphones",
"discount": "50% OFF",
"originalPrice": "$199.99",
"salePrice": "$99.99",
"imageUrl": "https://example.com/product.jpg",
"primaryColor": "#ff3366",
"accentColor": "#ffd23f"
})
});
if (response.ok) {
const blob = await response.blob();
const imageUrl = URL.createObjectURL(blob);
document.getElementById("preview").src = imageUrl;
} else {
const error = await response.json();
console.error("Error:", error);
}