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.
Argument | Values | Required? | Description |
---|---|---|---|
productId | String | Required | The ID of the product to update |
updatedProduct | Object | Required | An object with the attributes array |
Fields supported by objects in the attributes
array
Field | Values | Required? | Definition |
---|---|---|---|
name | String | Required | 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. |
value | Depends on the type of attribute | Optional | The new value to assign to the product attribute |
Fields
The UpdateProduct
mutation returns the following fields.
Field | Values | Required | Description |
---|---|---|---|
modifiedCount | Integer | Required | The number of products that have been updated |