Product media

Images and other files attached to a product. The file itself is stored in AchieveApex storage (uploaded with a signed URL); a product media record links it to the product and sets its display order.

Endpoints

The REST path of this resource is /products-media (with an s in products). /product-media does not exist and returns 404.

MethodPathDescription
GET/products-mediaList product media
GET/products-media/:idGet a product media item
POST/products-mediaUpload product media
PATCH/products-media/:idUpdate product media
DELETE/products-media/:idDelete product media

The API key is scoped to one organization: reads are filtered to it automatically.

The product media object

json

Fields

FieldTypeDescription
idintegerRead-only. Unique ID.
organization_idintegerOrganization of the product. On create it is always taken from the product.
product_idintegerProduct the file belongs to. Required.
positionintegerDisplay order (lowest first). The item with the lowest position is the product's main image. Default 0.
file_namestringOriginal file name.
file_typestringMIME type, for example image/jpeg.
file_sizeintegerFile size in bytes.
file_pathstringStorage key of the file (the s3PathWithoutBucket returned by the signing step).
s3_keystringStorage key of the file (same value as file_path). Used to delete the file.
s3_pathstringFull storage path, s3://bucket/key (the s3Path returned by the signing step).
created_atstring (date-time)Read-only. Creation time.
updated_atstring (date-time)Read-only. Last update time.
deleted_atstring (date-time) | nullRead-only. Set when the item is deleted.

Related

Report an issue with this documentation

Please log in to report issues with our documentation.