catalog.product.setMedia

Wholesale-replace a product's media list (order = array order; alt is per-usage).

Payload

fieldtyperequirednotes
productIdstring (/^prd_[a-zA-Z0-9]{1,32}$/)yes
mediaarray<object> (≤20)yes

JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "productId": {
      "type": "string",
      "pattern": "^prd_[a-zA-Z0-9]{1,32}$"
    },
    "media": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "mediaId": {
            "type": "string",
            "pattern": "^med_[a-zA-Z0-9]{1,32}$"
          },
          "alt": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "mediaId",
          "alt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "productId",
    "media"
  ],
  "additionalProperties": false
}
Generated from the live platform registries at build time — reference pages cannot go stale. Markdown variant: /reference/commands/catalog.product.setMedia.md