Hello I am trying to create a metafield on my products by following this article link .
I am running the following graphql queries on Admin API to create a metafield.
mutation ($input: ProductInput!) {
productUpdate(input: $input) {
product {
metafields(first: 100) {
edges {
node {
namespace
key
value
}
}
}
}
}
}
{
"input" : {
"id": "gid://shopify/Product/8068524540191",
"metafields": [
{
"namespace": "instructions",
"key": "wash",
"value": "cold wash",
"type": "single_line_text_field"
}
]
}
}
but getting the error
{
"data": {
"productUpdate": null
},
"errors": [
{
"message": "Access denied for productUpdate field. Required access: `write_products` access scope. Also: The user must have a permission to update products.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"productUpdate"
],
"extensions": {
"code": "ACCESS_DENIED",
"documentation": "https://shopify.dev/api/usage/access-scopes",
"requiredAccess": "`write_products` access scope. Also: The user must have a permission to update products."
}
}
],
"extensions": {
"cost": {
"requestedQueryCost": 112,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 990,
"restoreRate": 50
}
}
}
}
I have provided the access scopes for admin API configuration
also when I am running this query
{
currentAppInstallation {
accessScopes {
handle
}
}
}
I am getting this response
{
"data": {
"currentAppInstallation": {
"accessScopes": [
{
"handle": "read_content"
},
{
"handle": "read_products"
},
{
"handle": "unauthenticated_read_product_listings"
},
{
"handle": "unauthenticated_read_product_tags"
},
{
"handle": "unauthenticated_write_checkouts"
},
{
"handle": "unauthenticated_write_customers"
},
{
"handle": "unauthenticated_read_customer_tags"
},
{
"handle": "unauthenticated_read_content"
},
{
"handle": "unauthenticated_read_checkouts"
},
{
"handle": "unauthenticated_read_customers"
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 2,
"actualQueryCost": 2,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 998,
"restoreRate": 50
}
}
}
}
Needed Help!!!
