Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

checkoutCreate graphQL is getting access denied error

checkoutCreate graphQL is getting access denied error

Lekha1
Tourist
5 1 1

When I try this graphQL mutation
mutation MyMutation {
checkoutCreate(input: {lineItems: {quantity: 1, variantId: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC80MjgwMzkwMzg4OTYzOQ=="}, email: "ajay+2@gmail.com"}) {
checkout {
createdAt
id
email
lineItems(first: 10) {
edges {
node {
id
}
}
}
}
}
}

I am getting the error as
{
"data": {
"checkoutCreate": null
},
"errors": [
{
"message": "Access denied for checkoutCreate field. Required access: `unauthenticated_write_checkouts` access scope.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"checkoutCreate"
],
"extensions": {
"code": "ACCESS_DENIED",
"documentation": "https://shopify.dev/api/usage/access-scopes",
"requiredAccess": "`unauthenticated_write_checkouts` access scope."
}
}
]
}

Already enabled the storefront API access scopes - unauthenticated_write_checkouts, unauthenticated_read_checkouts. Then why this error is getting.

Replies 2 (2)

neonflux
Visitor
1 0 0

I am also getting this error, any suggestions? 

oscprofessional
Shopify Partner
16343 2438 3177

Hello @Lekha1 
I have checked in my store account it`s not working.

oscprofessional_0-1677062666312.png

 

checkoutCreate  might be deprecated
https://shopify.dev/docs/api/storefront/2023-01/mutations/checkoutcreate 

You can also refer the above link.

Check it the alternative solution. Or share  your store access so that I can check and let you know the exact solution.

 

@neonflux,

Please share your store issue. I will check and give you the suggestion.

 

Thanks....

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...