Repository navigation
Add Images to Products Variants
This page shows how to upload images with the Selldone REST API: the product's main image, gallery images shared by
all variants, gallery images for a specific variant, and blog category icons. All uploads are multipart/form-data
requests with a single photo file field.
Base URL:
https://api.selldone.comAuth header:Authorization: Bearer YOUR_ACCESS_TOKEN
| Upload | Endpoint | Scope | SDK URL builder |
|---|---|---|---|
| Product main image | POST /shops/{shop_id}/products/{product_id}/edit/upload/icon |
backoffice:product:write |
POST_UPLOAD_PRODUCT_MAIN_IMAGE |
| Gallery image (all variants) | POST /shops/{shop_id}/products/{product_id}/edit/upload/cover |
backoffice:product:write |
POST_UPLOAD_PRODUCT_COVER |
| Gallery image (one variant) | POST /shops/{shop_id}/products/{product_id}/edit/upload/cover/{variant_id} |
backoffice:product:write |
POST_UPLOAD_PRODUCT_COVER |
| Blog category icon | POST /shops/{shop_id}/blog/categories/{category_id}/icon |
articles |
POST_UPLOAD_SHOP_BLOG_CATEGORY_ICON |
Tip: when sending
multipart/form-data, do not set theContent-Typeheader manually; let your HTTP client set the boundary automatically.
POST https://api.selldone.com/shops/{shop_id}/products/{product_id}/edit/upload/icon
Sets the main image of a product.
Body (multipart/form-data)
| Field | Type | Description |
|---|---|---|
photo |
file | Required. Image file. |
File constraints
| Constraint | Value |
|---|---|
| Max size |
3072 KB (about 3 MB) |
| MIME types |
jpg, jpeg, png, gif, webp, svg
|
Access requirements: an authenticated request with write access to the shop's products.
Example request (cURL)
TOKEN="YOUR_ACCESS_TOKEN"
SHOP_ID="12345"
PRODUCT_ID="67890"
curl -X POST "https://api.selldone.com/shops/${SHOP_ID}/products/${PRODUCT_ID}/edit/upload/icon" \
-H "Authorization: Bearer ${TOKEN}" \
-F "photo=@/absolute/path/to/image.webp"POST https://api.selldone.com/shops/{shop_id}/products/{product_id}/edit/upload/cover
Adds an image to the product gallery, visible for all variants of the product.
Body (multipart/form-data)
| Field | Type | Description |
|---|---|---|
photo |
file | Required. Image file. |
File constraints
| Constraint | Value |
|---|---|
| Max size |
3072 KB (about 3 MB) |
| MIME types |
jpg, jpeg, png, gif, webp, svg
|
Access requirements: an authenticated request with write access to the shop's products.
Example request (cURL)
TOKEN="YOUR_ACCESS_TOKEN"
SHOP_ID="12345"
PRODUCT_ID="67890"
curl -X POST "https://api.selldone.com/shops/${SHOP_ID}/products/${PRODUCT_ID}/edit/upload/cover" \
-H "Authorization: Bearer ${TOKEN}" \
-F "photo=@/absolute/path/to/gallery-1.jpg"POST https://api.selldone.com/shops/{shop_id}/products/{product_id}/edit/upload/cover/{variant_id}
Adds an image to the gallery of a specific variant. If the image should appear for all variants, use the
previous endpoint without {variant_id}.
Path parameter
| Parameter | Type | Description |
|---|---|---|
variant_id |
string | Target variant ID (required here). |
Body (multipart/form-data)
| Field | Type | Description |
|---|---|---|
photo |
file | Required. Image file. |
File constraints
| Constraint | Value |
|---|---|
| Max size |
3072 KB (about 3 MB) |
| MIME types |
jpg, jpeg, png, gif, webp, svg
|
Access requirements: an authenticated request with write access to the shop's products.
Example request (cURL)
TOKEN="YOUR_ACCESS_TOKEN"
SHOP_ID="12345"
PRODUCT_ID="67890"
VARIANT_ID="abcde12345"
curl -X POST "https://api.selldone.com/shops/${SHOP_ID}/products/${PRODUCT_ID}/edit/upload/cover/${VARIANT_ID}" \
-H "Authorization: Bearer ${TOKEN}" \
-F "photo=@/absolute/path/to/variant-image.png"POST https://api.selldone.com/shops/{shop_id}/blog/categories/{category_id}/icon
Sets the icon of a blog category. The file is sent in the photo field.
Access requirements: an authenticated request with write access to the shop's blog and content (articles scope).
Example request (cURL)
TOKEN="YOUR_ACCESS_TOKEN"
SHOP_ID="12345"
CATEGORY_ID="999"
curl -X POST "https://api.selldone.com/shops/${SHOP_ID}/blog/categories/${CATEGORY_ID}/icon" \
-H "Authorization: Bearer ${TOKEN}" \
-F "photo=@/absolute/path/to/category.svg"async function uploadProductImage({ shopId, productId, variantId = null, file }) {
const fd = new FormData();
fd.append("photo", file); // File or Blob
const url = variantId
? `https://api.selldone.com/shops/${shopId}/products/${productId}/edit/upload/cover/${variantId}`
: `https://api.selldone.com/shops/${shopId}/products/${productId}/edit/upload/cover`;
const { data } = await window.axios.post(url, fd); // Authorization header set globally
return data;
}Guides
Products
- Fetch Products List
- Edit Product
- Edit Product's Variant
- Add Images to Products/Variants
- Upload Products Category Image
Marketplace vendors
- Get Vendors List
- Vendor Products List
- Vendor Product Add
- Vendor Product Update
- Vendor Product Delete
Ecosystem
Links