setProductAttributeValueImage
Requires permission products:product:update.
Sets or clears the picture of one product attribute value; product finders then show it for that value. Requires permission to update products.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation SetProductAttributeValueImage($input: SetProductAttributeValueImageInput!) {
setProductAttributeValueImage(input: $input) {
imageUrl
value
variantCount
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SetProductAttributeValueImage($input: SetProductAttributeValueImageInput!) {\n setProductAttributeValueImage(input: $input) {\n imageUrl\n value\n variantCount\n }\n}",
"variables": {
"input": {
"attributeKey": "string",
"value": "string"
}
}
}
EOF
Variables:
{
"input": {
"attributeKey": "string",
"value": "string"
}
}
Response:
{
"data": {
"setProductAttributeValueImage": {
"imageUrl": "string",
"value": "string",
"variantCount": 0
}
}
}
setProductAttributeValueImage(
input: SetProductAttributeValueImageInput!
): ProductAttributeValue!
Arguments
setProductAttributeValueImage.input ● SetProductAttributeValueImageInput! non-null input
The value and its new picture.
Type
ProductAttributeValue object
One value of a product attribute.