How to enable the scopes for Shopify APIs?
Issue
When attempting to create a new Shopify data source in Bold BI, you may encounter the error message “403 - Forbidden - {“errors”:”[API] This action requires merchant approval for read_customers scope."}” This error indicates that the required Shopify scopes are not added in the Shopify App.
An error occurred while fetching the schema from the source. Failed API - https://care-express-prod.myshopify.com/admin/api/2020-04/customers.json - Status Code 403 - Forbidden - {"errors":"[API] This action requires merchant approval for read_customers scope."}
To resolve this issue, follow the steps outlined below.
Solution
To resolve this issue, We need to enable the required scopes in Shopify. Enabling scopes for Shopify APIs is essential for developers who need to specify the level of access that their apps require from a Shopify store. Scopes determine which parts of a store’s data the app can access and what actions it can perform. Here’s how to enable scopes for Shopify APIs:
-
Log in to Your Shopify Account:
Begin by signing in to your Shopify admin account. -
Navigate to App Settings:
Once logged in, access the settings by clicking on ‘Settings’ in the bottom left corner of the Shopify admin dashboard. Then, select ‘Apps and sales channels’ followed by ‘Develop apps’.
- Create or Edit an App:
If you’re starting a new project, click on ‘Create new app’. To modify an existing app, locate it in the list and click on it to edit.
- Access the Configuration Tab:
Within the app’s settings, navigate to the ‘Configuration’ tab where you can manage the app’s settings and scopes.
- Configure API Scopes:
In the configuration section, you’ll find options to ‘Configure the Admin API’ or ‘Storefront API integrations’. Click on the relevant option to set up the scopes. Here, you can select the specific areas of the store that your app needs to access.
Note
- Admin API Scopes: These scopes are used to define permissions for the Admin API, which allows apps to access and manipulate a store’s data directly through the Shopify admin.
- Storefront API Scopes: These scopes apply to the Storefront API, which is used to build custom storefronts that interact with a shop’s data in a client-side context.
By following these steps, you can successfully configure the scopes for your Shopify app, ensuring it has the appropriate access to store data and functionalities.