buy-button-js icon indicating copy to clipboard operation
buy-button-js copied to clipboard

Error: CheckoutCreate access denied - Generated storefront_access_token with all unauthenticated permissions

Open bicced opened this issue 6 months ago • 0 comments

Hello,

I'm encountering an issue when attempting to add items to the cart through the UI using the Storefront API. Here's the error message I'm receiving:

Error: [{"message":"CheckoutCreate access denied","path":["checkoutCreate"],"locations":[],"extensions":{"code":"ACCESS_DENIED","documentation":"https://shopify.dev/api/usage/access-scopes"}}]

Details:

Context: The "Add to Cart" functionality works perfectly when I install the Buy Button Channel app, and copy over the provided storefrontAccessToken it provides. However, when I try to use a generated storefront_access_token with all unauthenticated permissions enabled, I receive the above error.

Expected Behavior: I expect to be able to add items to the cart using the Storefront API with the generated storefront_access_token.

Actual Behavior: The operation fails with an ACCESS_DENIED error when using the generated token.

Steps to Reproduce:

  1. Generate a storefront_access_token using Admin Rest API

  2. Implement buy-button-js to app

  3. When adding to cart, nothing shows up and we can see ACCESS_DENIED "CheckoutCreate access denied" error in logs. Same thing happens when going directly to checkout without cart - a popup opens with blank contents and produces the same error above.

Question: Is there a configuration or permission setting that I'm missing? How can I resolve this issue and successfully add items to the cart using the generated storefront_access_token?

Thank you for your assistance!

bicced avatar Aug 13 '24 04:08 bicced