Clarification on rules for creating Storefront Access Tokens

dylanpierce
Shopify Partner
84 0 20

I have been trying to create a Storefront Access Token for my public app. I have tried the following:

 

1. During regular Admin OAuth asking for the unauthenticated endpoints as part of the scope:

 

    [
"unauthenticated_read_collection_listings", "unauthenticated_read_product_listings", "unauthenticated_write_checkouts", "unauthenticated_write_customers", "unauthenticated_read_content"
].join(', ')

2. After the Admin OAuth `access_token` has been created, I attempt to create a Storefront Access Token described in the REST API:

 

  const storefrontAccessTokenResponse = await axios.post(`https://${shop}/admin/storefront_access_token.json`, {
    headers: {
      "X-Shopify-Access-Token": accessToken
    }, body: {
      storefront_access_token: {
        title: "Storefront Access Token for Example Shop"
      }
    }
  })

However, I'm consistently getting a `406` error or a `401` error whenever I tweak these parameters and try again. Is there some additional rules to generating a Storefront Access Token that are not documented?

Founder of Verdict - Anti-Fraud Apps for Shopify
  • Blockade - Easily block countries, IP addresses, VPNs
  • Real ID - Verify your customer's real IDs easily & securely
0 Likes
captainzero
Shopify Partner
41 0 9

I have seen your threats about storefront access token and i am interested to know about why it's used and what are the use cases?

 

Thanks in advance

0 Likes
Big_Van_Studio1
Shopify Partner
12 0 0

Hello:

I am currently facing the same issue. How did you solve it?

Thanks in advance for your reply!

Best

The Big Van Studio Ltd Web programmer and Designer. E-commerce specialist. -- If you need help with your store and need a Programmer/Designer, please, contact me without compromise. I'll be more than pleased to help.
0 Likes
dylanpierce
Shopify Partner
84 0 20

Hi @Big_Van_Studio1 

I'm sorry it's been 2 years since I last dealt with the problem. I ended up abandoning that project shortly thereafter. I can't remember the exact steps I took, but it might have been that I turned the app into a sales channel.

But the policies & rules might have changed since then. Sorry wish I could help further.

Founder of Verdict - Anti-Fraud Apps for Shopify
  • Blockade - Easily block countries, IP addresses, VPNs
  • Real ID - Verify your customer's real IDs easily & securely
0 Likes
Big_Van_Studio1
Shopify Partner
12 0 0
Hi Dylan:

Many thanks for your reply. It seems that it is necessary to turn the app
into a sales channel as you said. This is not a solution for me. I will
have to find a different approach.

Thanks again for taking the time to reply to me and for doing it so fast!

Best wishes
The Big Van Studio Ltd Web programmer and Designer. E-commerce specialist. -- If you need help with your store and need a Programmer/Designer, please, contact me without compromise. I'll be more than pleased to help.
0 Likes
dylanpierce
Shopify Partner
84 0 20

Hi @Big_Van_Studio1  sorry to lead you astray!

Wish I could help further, but I really just can't remember what the issue was. Sorry I didn't post it here when I was first doing the project. I hope you find the solution though.

Founder of Verdict - Anti-Fraud Apps for Shopify
  • Blockade - Easily block countries, IP addresses, VPNs
  • Real ID - Verify your customer's real IDs easily & securely
0 Likes