Skip to content

Media

View as Markdown

A Media is a file you upload once and then attach to catalog resources. Each media exposes a contentUrl to fetch the file, its mimeType, a derived type (image, video or file), a hash, and - for images - its dimensions.

You create a media by uploading a file, then reference the returned media IRI from a Product or Variant through their medias list.

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
idstring-The resource's unique identifier (UUID).
contentUrlstring | null-The URL to fetch the uploaded file.
mimeTypestring | null-MIME type of the file
type"image" | "video" | "file"-Media type based on MIME type (image, video, or file)
hashstring | null-SHA256 hash of the file
dimensionsEmbeddedImageDimensionResource | null-
Show dimensions fields
PropertyTypeRequiredDescription
widthintegerrequiredImage width in pixels
heightintegerrequiredImage height in pixels
createdAtstring | null-
updatedAtstring | null-
  • Add a product image. Upload the file, then add the returned media IRI to a Variant’s medias (or a product’s).
  • Serve the file. Use the contentUrl from the media to display it.
  • Clean up. Delete a media that is no longer referenced.

All requests require an OAuth 2.0 bearer token and the organization scope header:

Authorization: Bearer <token>
X-Flowkiwi-Organization-Id: <organization-id>

Media are created with a multipart/form-data upload, not a JSON body. Send the binary in a file field (max 5 MB for general files, 100 MB for videos). The mimeType, type, hash and image dimensions are derived from the uploaded file - you don’t set them.