Skip to main content
Two calls put images on a product: upload each image with POST /dev/v1/media, then send the returned ids in image_ids when you create or update the product. Both calls need an API key or OAuth token with the products.write scope. See Authentication.
Using an AI agent? The Shoppex MCP server has the same calls as tools: media_upload, then products_create or products_update with image_ids. See Shoppex in Claude.

Upload an image

POST /dev/v1/media stores one image and returns its id. Send exactly one of url or data as JSON: Rules:
  • Accepted types: PNG, JPEG, GIF and WebP. Shoppex reads the type from the image bytes, not from a header or the file name. SVG and video are refused.
  • Limit: 30 uploads per shop in any rolling 60-second window. A request over the limit gets 429.
  • Send an Idempotency-Key header (up to 128 characters) so a retry never stores the image twice. A retry with the same key and body returns the first answer.
Response (201 Created):

Upload errors

All errors use the standard error format.

Attach images to a product

Send image_ids on POST /dev/v1/products or PATCH /dev/v1/products/{id}:
  • At most 10 images per product.
  • The order of the array is the gallery order. The first image is the product’s main image.
  • The array replaces the whole gallery. [] removes every image. Leave image_ids out to keep the gallery as it is.
  • Every id must be an image uploaded to this shop, and each id may appear only once. Otherwise the request fails with 422 and error.details[].field is image_ids.
The product answer lists the gallery in images, in display order:

Full example

Upload two images, then create a product with both. The cover image becomes the main image.
To change the order of an existing product’s gallery, send the full list again in the new order:

With the SDK

@shoppexio/sdk has no dedicated media method yet. Call the endpoint with the client’s generic post, then use products.create or products.update:
To read a local file, send it as base64 in data (up to 1 MB):

Reference

The API reference tab lists every field of these endpoints under Products: POST /dev/v1/media, POST /dev/v1/products and PATCH /dev/v1/products/{id}.