Add pictures to a product
Adds pictures to a product's gallery without resending the rest — what a catalogue sync, or a workshop's own tooling, calls to keep product photos current. Admin keys only: the key's owner must be allowed to manage products, and a seller key gets 403.
The body is multipart/form-data. Send each picture as a file part (PNG, JPG or WEBP, 50 MB at most) or as a url field, which we download and store. A link to someone else's server is never saved as it is, because the catalogue goes blank the day that server stops answering. Up to 10 pictures per request: repeat the part to send several, in the order they should appear.
New pictures join the end of the gallery, which holds 20. as_cover=true makes the first one the product's cover, and the old cover moves into the gallery rather than being lost; a product with no cover gets the first picture as its cover anyway.
If any picture is refused — a link that is not a reachable image, a file that is not one — the answer is 422, naming it in message with the cause in reason, and nothing is added. A gallery with no room left answers 409.
Request
- Base URL: https://0.0.0.0:3000/api/v1
- URL: https://0.0.0.0:3000/api/v1/products/{id}/images
- Auth: API key in header x-api-key
Path parameters
The product's id, as in GET /catalog.
Headers
Optional. Reuse the same value on every retry of the same upload, so a retry after a timeout does not add the pictures twice; see Idempotency.
Response
The product's cover and full gallery after the upload. meta.added lists the stored URLs of the new pictures.
Changes
No recorded changes to this operation across all 1 revision of this API.