Cannot create PrivateMetafield on a Image

Running following query:

mutation privateMetafieldUpsert($input: PrivateMetafieldInput!) {
    privateMetafieldUpsert(input: $input) {
        privateMetafield {
            value
            valueType
        }
        userErrors {
            field
            message
        }
    }
}

Input:

{"input": {
    "key": "image_id",
    "namespace": "PIM",
    "valueInput": {
        "value": "1",
        "valueType": "STRING"
    },
    "owner": "gid://shopify/ProductImage/29926779322573"
}

Response

{
    "data": {
        "privateMetafieldUpsert": {
            "privateMetafield": null,
            "userErrors": [
                {
                    "field": [
                        "input"
                    ],
                    "message": "the owner record does not exist"
                }
            ]
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 10,
            "actualQueryCost": 10,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 990,
                "restoreRate": 50.0
            }
        }
    }
}

Owner ID exists, because it’s taken from Product.image[0].id

1 Like

Based on what I’ve found privateMetafields can be added only on Shop, Product and Variant.