GraphQL Admin API mutation orderEditBegin access denied using unstable version

Highlighted
New Member
1 0 0

I've recently developed an app using express and node and through that I'm calling an endpoint to execute mutation orderEditBegin. But when I call the end-point I gets following error :

{"data":{"orderEditBegin":null},"errors":[{"message":"OrderEditBegin access denied","locations":[{"line":2,"column":13}],"path":["orderEditBegin"]}],"extensions":{"cost":{"requestedQueryCost":17,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":1000,"currentlyAvailable":990,"restoreRate":50}}}}

Following is the endpoint of express app:

 

app.get("/orderedit/begin", (req, res) => {
    fetch(session_obj.shopRequestUrl, {
      method: "POST",
      headers: session_obj.shopRequestHeaders,
      body: JSON.stringify({
        query:`mutation orderEditBegin{
            orderEditBegin(id : "gid://shopify/Order/2191412461706") {
              calculatedOrder {
                id
                lineItems(first: 5) {
                  edges {
                    node {
                      id
                    }
                  }
                }
              }
              userErrors {
                field
                message
              }
            }
          }`
      })
    })
      .then(result => {
        return result.json();
      })
      .then(data => {
        console.log("data returned:\n", data);
        res.send(data);
      });
  });
 
Access token and everything is correct and I can execute normal queries, for example to get products. 

 

0 Likes
Shopify Staff
Shopify Staff
1041 140 167

Hey @Champs 

 

Does the app have write_order_edits access scope?

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes