Update a product in the product catalog

To update a product in the product catalog, use the UpdateProduct mutation. You can change all values except for Product ID.

mutation {
  updateProduct(
    productId: "UYTX202052"
    updatedProduct: {
      attributes: [
        {
          name: "brandDescription"
          value: "The producer you can trust. Premium value at a fair price."
        }
        { name: "inventoryQuantity", value: 309 }
        { name: "dateAdded", value: "2025-03-20T00:00:00.000Z" }
        {
          name: "productUrls"
          value: [
            "https://www.example.com/castle-high"
            "https://www.example.com/catalog/TS-BLM-B601"
          ]
        }
        { name: "availability", value: "In stock" }
      ]
    }
  ) {
    modifiedCount
  }
}
{
  "data": {
    "updateProduct": {
      "modifiedCount": 1
    }
  }
}

Arguments

The UpdateProduct object requires the following arguments.

ArgumentValuesRequired?Description
productIdStringRequiredThe ID of the product to update
updatedProductObjectRequiredAn object with the attributes array

Fields supported by objects in the attributes array

FieldValuesRequired?Definition
nameStringRequired The name of the product attribute to update.

Keep in mind that you must use internal names for the predefined product attributes. For custom attributes, the internal name coincides with the display name.

💡To fetch the names of supported attributes and their format, use the dataSets query.
valueDepends on the type of attributeOptionalThe new value to assign to the product attribute

Fields

The UpdateProduct mutation returns the following fields.

FieldValuesRequiredDescription
modifiedCountIntegerRequiredThe number of products that have been updated