Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get/generate access token of storefront API

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);
like image 720
MR_AMDEV Avatar asked Oct 12 '25 15:10

MR_AMDEV


1 Answers

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.

like image 98
MR_AMDEV Avatar answered Oct 16 '25 12:10

MR_AMDEV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!