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
16115 2409 3121

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....

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free