API: Images
What It Does
Gives each product 1 principal picture from your own system, in 2 steps:
- Upload web-sized pictures. Each gets an
image_id. - Set an uploaded picture as a product’s principal picture.
The principal picture shows on the product in tieback and on its passport.
Who It’s For
Developers bringing product photos into tieback from a store or a product information system.
Before You Start
- Use a key with Import products (see API: Credentials). Send
Authorization: Bearer <token>. - A key works in its own workspace only. It cannot remove pictures people added or change anything else about a product.
- Get product ids from API: Products (
POST /v1/products/lookupfinds them by SKU, GTIN or your own id). - Send web-sized pictures. A store’s own image service can give you one: for example, add
width=1600to a Shopify image address.
POST /v1/images
Send multipart/form-data with 1 to 10 files, each in a field named files.
- Types: PNG, JPEG or WebP. The type is read from the file itself, never from its name.
- Size: up to 2 MB a file, and up to 2048 pixels on the long side. The whole request is up to 21 MB.
status:stored, ornot_storedif that file could not be saved (send it again).filename: the name as kept. Folders, spaces and control characters are removed.expires_at: set the picture on a product before then. An upload that is never set is removed after 24 hours.- Refused files: if any file is refused, nothing is uploaded and the reply lists each file with its
reason:empty;too_large(over 2 MB);too_many_pixels(over 2048 pixels on the long side);not_png_jpeg_or_webp;unreadable(the picture’s size could not be read).
- Limit: a workspace can hold up to 500 uploads that are not yet set (
409beyond that).
POST /v1/products/images
Sets uploaded pictures as products’ principal pictures: up to 100 items a call, 1 per product.
Replacing a picture: setting a new picture replaces the one the API set before. Pictures people add in tieback always win: when someone adds a picture to a product, the API’s picture on it is retired at once. 1 upload can be set on several products.
Errors
Errors are application/problem+json with title, status, detail and request_id (also in the X-Request-Id header; quote it to support). A request body over 21 MB (uploads) or 64 KB (set) gets 413. 503 means try again shortly; an upload that was stored before the error stays until it expires.