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.
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-Keyheader (up to 128 characters) so a retry never stores the image twice. A retry with the same key and body returns the first answer.
201 Created):
Upload errors
All errors use the standard error format.
Attach images to a product
Sendimage_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. Leaveimage_idsout 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
422anderror.details[].fieldisimage_ids.
images, in display order:
Full example
Upload two images, then create a product with both. The cover image becomes the main image.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:
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}.