Upload product media

Attach a file to a product. Uploading is three steps: get a signed upload URL, upload the file to it, then create the media record.

Endpoint

POST
/products-media

Step 1: Get a signed upload URL

NameTypeRequiredDescription
typestringYesproduct-media.
filenamestringYesOriginal file name.
product_idintegerYesProduct that owns the file.
contentTypestringNoMIME type of the file.
json

Step 2: Upload the file

Step 3: Create the media record

Body parameters

NameTypeRequiredDescription
organization_idintegerYesYour organization ID (the API key's organization). The stored value is always the product's organization.
product_idintegerYesProduct to attach the file to.
file_namestringYesOriginal file name.
file_typestringYesMIME type.
file_pathstringYess3PathWithoutBucket from step 1.
s3_keystringYess3PathWithoutBucket from step 1 (same as file_path).
s3_pathstringYess3Path from step 1.
file_sizeintegerNoSize in bytes.
positionintegerNoDisplay order, lowest first. Default 0.

Request

Response

json

Errors

StatusCause
400 Bad Requestproduct_id is required, or schema validation failed.
403 Forbiddenorganization_id is missing or is not the API key's organization.
500The product does not exist (Could not fetch product details: …).

Report an issue with this documentation

Please log in to report issues with our documentation.