Skip to content

Add Images to Products Variants

Mehrdad Pajuhaan edited this page Oct 23, 2026 · 2 revisions

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.com Auth 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 the Content-Type header manually; let your HTTP client set the boundary automatically.

Upload the product main image

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"

Upload a product gallery image (all variants)

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"

Upload a product gallery image (specific variant)

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"

Upload a blog category icon

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"

Upload from JavaScript

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;
}

Related

Clone this wiki locally