Hello,
I am trying to get the subscriptionContracts using the GraphQL and I am receiving the following response:
“message”: “Access denied for subscriptionContracts field.”,
I see that in the response I am redirected to the Access Scopes page ( https://shopify.dev/api/usage/access-scopes ) page, but I can not find anything related to subscriptionContract, subscriptionContracts or even something related to subscriptions.
I also checked the ADMIN API PERMISSIONS section, but did not find a permission setting for subscriptions.
I want to mention that other requests, for ex. getting orders and order details, are working.
My final goal is to get a list of all subscriptions using (REST or GRAPHQL). Is this possible at this moment ? Am I doing something wrong ?
My request is build like this:
Client:
new Client([
'base_uri' => 'https://' . $shopUrl . '/admin/api/2021-10/',
'timeout' => 0,
'allow_redirects' => false,
'verify' => false,
'headers' => [
'Authorization' => 'Basic ' . base64_encode($apiKey . ':' . $pass),
'Accept' => 'application/json',
'Content-Type' => 'application/graphql'
]
]);
Body:
{
subscriptionContracts(first: 10) {
edges {
node {
id
createdAt
orders (first: 10) {
edges {
node {
id
}
}
}
}
}
}
}
The response I receive:
{
"data": null,
"errors": [
{
"message": "Access denied for subscriptionContracts field.",
"locations": [
{
"line": 3,
"column": 3
}
],
"path": [
"subscriptionContracts"
],
"extensions": {
"code": "ACCESS_DENIED",
"documentation": "https://shopify.dev/api/usage/access-scopes"
}
}
],
"extensions": {
"cost": {
"requestedQueryCost": 12,
"actualQueryCost": 2,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 998,
"restoreRate": 50
}
}
}
}