PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 1, 2022

[FIXED] How to get/generate access token of storefront API

 July 01, 2022     laravel-8, shopify, shopify-api     No comments   

Issue

I am using https://github.com/osiset/laravel-shopify package to manage Shopify API with laravel 8 and facing the following error:

HTTP/1.1 403 Forbidden { "errors": "App must be extendable to create a storefront access token." }

Trying the following:

$shop = Auth::user();
$orders = $shop->api()->rest('POST', '/admin/api/2021-01/storefront_access_tokens.json', ['storefront_access_token' => ['title' => 'mobile']]);
dd($orders);

Solution

I want to answer my own question as eventually i was able to found the soluion: To achive this you must have the following requirements:

  1. A public shopify app
  2. Enabled sales channel (You can find it in Apps->your app->app setup)
  3. Api scopes with following values:

read_products,write_products,unauthenticated_read_content,unauthenticated_read_customer_tags,unauthenticated_read_product_tags,unauthenticated_read_product_listings,unauthenticated_write_checkouts,unauthenticated_read_checkouts,unauthenticated_write_customers,unauthenticated_read_customers

and the you need to logout(if already logged in) and then re-authenticate with shopify and then You will be able to make it work.



Answered By - MR_AMDEV
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing