Skip to content

Upload Products Category Image

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

Upload Products Category Image

Upload or replace the image of a product category (a folder in the Products Manager). The file is sent as multipart/form-data in the photo field. Your token needs the backoffice:category:write scope.

Endpoint

POST https://api.selldone.com/shops/{shop_id}/categories/{category_id}/edit/upload

SDK URL builder: window.API.POST_UPLOAD_CATEGORY_IMAGE(shop_id, category_id).

Path parameters

Parameter Type Description
shop_id string Target shop ID.
category_id string Target category ID.

Body (multipart/form-data)

Field Type Description
photo file Required. The image to upload.

File constraints

Constraint Value
Max size 2048 KB (about 2 MB)
MIME types jpg, jpeg, png, gif, webp, svg

Tip: when sending multipart/form-data, do not set the Content-Type header manually; let your HTTP client set the boundary automatically.

Access requirements

A valid bearer token with write access to the shop's catalog/categories. Header: Authorization: Bearer YOUR_ACCESS_TOKEN

Example request (cURL)

TOKEN="YOUR_ACCESS_TOKEN"
SHOP_ID="12345"
CATEGORY_ID="999"

curl -X POST "https://api.selldone.com/shops/${SHOP_ID}/categories/${CATEGORY_ID}/edit/upload" \
  -H "Authorization: Bearer ${TOKEN}" \
  -F "photo=@/absolute/path/to/category-image.webp"

Example request (JavaScript, Axios)

import axios from "axios";

/**
 * Upload or replace a category image.
 * @param {Object} params
 * @param {string} params.token      - Bearer token
 * @param {string} params.shopId     - Shop ID
 * @param {string} params.categoryId - Category ID
 * @param {File|Blob} params.file    - Image file
 */
async function uploadCategoryImage({ token, shopId, categoryId, file }) {
  const url = `https://api.selldone.com/shops/${shopId}/categories/${categoryId}/edit/upload`;
  const fd = new FormData();
  fd.append("photo", file); // File | Blob

  const res = await axios.post(url, fd, {
    headers: { Authorization: `Bearer ${token}` },
  });
  return res.data;
}

Notes and best practices

  • Keep images optimized (for example WebP or compressed JPEG) to improve load speed.
  • Use descriptive file names (for example cat-home-decor.webp) for easier asset management.
  • If you receive 413 Payload Too Large, compress the image below 2 MB.
  • If you receive 415 or 422, make sure you used multipart/form-data and an allowed MIME type.

Related

Clone this wiki locally