Development discussions around Shopify APIs
To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more
I'm receiving this error when trying to run the following GraphQL mutation:
{
"query":"mutation draftOrderCalculate($input: DraftOrderInput!) { draftOrderCalculate(input: $input) { userErrors { field message } calculatedDraftOrder { totalTax } } }",
"variables":{
"input":{
"lineItems":[
{
"variantId":"gid://shopify/ProductVariant/40512334692549",
"quantity":1,
"appliedDiscount":null
}
],
"shippingAddress":{
"firstName":"Eduard",
"lastName":"...",
"address1":"...",
"address2":"...",
"phone":"123",
"city":"Miami",
"countryCode":"US",
"provinceCode":"FL",
"zip":"123"
},
"billingAddress":{
"firstName":"Eduard",
"lastName":"...",
"address1":"...",
"address2":"...",
"phone":"123",
"city":"Miami",
"countryCode":"US",
"provinceCode":"FL",
"zip":"123"
},
"email":"eduard@example.com"
}
}
}
Error:
{
"data": {
"draftOrderCalculate": null
},
"errors": [
{
"locations": [
{
"column": 58,
"line": 1
}
],
"message": "DraftOrderCalculate access denied",
"path": [
"draftOrderCalculate"
]
}
],
"extensions": {
"cost": {
"actualQueryCost": 10,
"requestedQueryCost": 10,
"throttleStatus": {
"currentlyAvailable": 990,
"maximumAvailable": 1000.0,
"restoreRate": 50.0
}
}
}
}
My private app the write_draft_orders scope (screenshot).
All app permissions: read_products,write_products,read_orders,write_orders,write_order_edits,read_collection_listings,read_shipping,write_shipping,read_draft_orders,write_draft_orders
This doesn't make any sense.
{ draftOrders(first: 10) { edges { node { id } } } }
Returns: Access denied for draftOrders field.
I deleted the custom app and re-installed it, verified that the oAuth URL generated included the correct scopes for draft orders, and the app summary clearly says that I will be granting the app permission to edit draft orders. But I get the access denied error.
I installed the Shopify GraphiQL app and granted it permission to edit draft orders, and it works.
My app can access orders through, but not draft orders.
{ orders(first: 10) { edges { node { id } } } }
Ok - I did make a mistake, I didn't update the API token when I uninstalled the app and re-installed it.
Deleting the app, and re-installing from scratch was required for some reason though.
User | RANK |
---|---|
5 | |
5 | |
4 | |
4 | |
4 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022