I am running a checkout UI extension to display the free product on checkout to be able to add to their cart, if the people enter the respective discount code. So, with that I am trying to get the free product associated with a Buy X, Get Y discount. My current permissions are “read_products”, “read_discounts” and “write_checkouts”. When I run the following query:
query GetBXGY($discountID: ID!){
codeDiscountNode(id: $discountID) {
id
codeDiscount {
__typename
... on DiscountCodeBxgy {
title
codes(first: 1) {
nodes {
code
}
}
customerGets {
items {
... on DiscountProducts {
products(first: 1) {
edges{
node {
id
title
handle
}
}
}
}
}
}
startsAt
endsAt
}
}
}
}
I am getting the response:
{
"errors": [
{
"message": "Access denied for products field.",
"locations": [
{
"line": 16,
"column": 15
}
],
"path": [
"codeDiscountNode",
"codeDiscount",
"customerGets",
"items",
"products"
],
"extensions": {
"code": "ACCESS_DENIED",
"documentation": "https://shopify.dev/api/usage/access-scopes"
}
}
],
"data": {
"codeDiscountNode": null
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 8,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1992,
"restoreRate": 100
}
}
}
}
Not sure why I would be getting that when, I assume, I have the necessary permissions. If I am missing something else, and I very much might be, please let me know. Any and all insights here are much appreciated.