Ask Your Question
2

How can I set the scopes for my Shopify app developed with Laravel in order to obtain merchant approval for the write_price_rules scope required for a certain action?

asked 2022-01-27 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-04-19 08:00:00 +0000

lalupa gravatar image

To set scopes for your Shopify app developed with Laravel, you need to:

  1. Update the app's config/shopify-app.php file to include the required scope. For example, to include the write_price_rules scope, add the following line of code to the scopes array:

'write_price_rules',

  1. Then, you must update the app's config/shopify-auth.php file to include the scope within the options array. For example,
'options' => [
    'grant_options' => [
        'write_price_rules',
    ],
],
  1. Lastly, update your app's routes/web.php or routes/api.php file to include the specific route that requires the write_price_rules scope, and then add a middleware to check that the authenticated user has the required scope. For example,
Route::post('/create-price-rule', 'PriceRuleController@store')->middleware(['auth.shop', 'scopes:write_price_rules']);

Once you have made these updates, you should submit your app for merchant approval, and ensure that the write_price_rules scope is clearly explained and justified in your app's documentation and usage instructions.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-01-27 11:00:00 +0000

Seen: 11 times

Last updated: Apr 19 '22