Add a picture to a product
POST/v1/materials/:type/:id/pictures
Stores a picture of the product. Send a form (multipart/form-data) with a JPEG, PNG or WebP of at most 5 MB in file. The planner, builder and configurator show it, so it is a public file. Send it in the size it is shown in, 1920 pixels are plenty: it is stored as it is. Customers see it at once, also with offers they have already.
A product holds a picture once. When it has the very same file already, the call answers 409 picture_already_on_material and names it in pictureId. Only a picture stored through the API is recognized. Requires the write:materials scope.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 413
- 415
- 429
- 500
The new picture.
validation_error: the body is no form, the file is missing or empty, or a field is not valid. message names the problem.
missing_api_key or invalid_api_key: no API key was sent, or it is wrong, expired or revoked.
insufficient_scope: the API key does not have the scope this endpoint needs. required names it.
not_found: there is no such product of this type in your catalog.
picture_already_on_material: the product has this very picture already, as pictureId.
file_too_large: the picture has more than 5 MB.
file_type_not_allowed: the file is no JPEG, PNG or WebP.
rate_limited: the API key has stored 1000 files within the hour. Try again after the seconds in the Retry-After header.
Response Headers
db_error: the database refused or failed the request. storage_error: the file could not be stored. message has the details.