v1

latestSwagger 2.02026-07-13137761.0 MB
Product media file

Create a new product media file

This endpoint allows you to create a new media file and associate it to an attribute value of a given product or product model.

post/api/rest/v1/media-files

Headers

Content-typestring required

Equal to 'multipart/form-data', no other value allowed

Request body

productstring

The product to which the media file will be associated. It is a JSON string that follows this format '{"identifier":"product_identifier", "attribute":"attribute_code", "scope":"channel_code","locale":"locale_code"}'. You have to either use this field or the product_model field, but not both at the same time.

product_modelstring

The product model to which the media file will be associated. It is a JSON string that follows this format '{"code":"product_model_code", "attribute":"attribute_code", "scope":"channel_code","locale":"locale_code"}'. You have to either use this field or the product field, but not both at the same time.

filestring binary required

The binaries of the file

Response

Created