Getting access to users own store

Hello,

I’m working on a Laravel app that manages multiple users and their products with stock tracking. I want to integrate a feature that allows these users to sync their products with their own Shopify stores.

I’m a bit unclear on the correct process for setting this up. I’ve already created a Shopify app, obtained the API keys, and attempted to implement OAuth with a Shopify store. However, I’m encountering an error that suggests the current approach might be incorrect.

Could someone provide a detailed explanation of the proper workflow for integrating Shopify with a Laravel app in this context? I would greatly appreciate any guidance on how to proceed.

Thank you!

Hello…To integrate Shopify with your Laravel app, follow these steps

  1. Verify Configuration: Check that your Shopify app is correctly set up in the Partner Dashboard, including API keys and OAuth callback URL.

  2. Handle OAuth: Implement OAuth flow by redirecting users to Shopify for authorization, then exchange the authorization code for an access token.

  3. Access Shopify API: Use the access token to make authenticated API requests. Ensure you manage API rate limits and handle errors effectively.

  4. Sync Products: Fetch product data from Shopify, store it in your Laravel app, and push updates back to Shopify as needed.

  5. Test Thoroughly: Use Shopify’s Development Store to test the integration before going live.

If you encounter specific errors, share the details for more precise guidance and if my reply helpful click Like to let me know! Also if my response solve the problem? Mark it as an Accepted Solution.

I have created a partner account, created an app but I don’t see any option to get the API key from there. On the partners.shopify.com on the apps API details I can only see the client id and client secret. I had to go on a store admin page and create another app from there and after that I saw some API keys.

What’s the difference between these two apps, which app should I use?

$authUrl = "https://{$shop}.myshopify.com/admin/oauth/authorize?" . http_build_query([
                'client_id' => config('services.shopify.client_id'),
                'scope' => config('services.shopify.scopes'),
                'redirect_uri' => 'http://localhost:8000/auth/shopify/callback',
                'state' => $nonce
            ]);

The link gets created and when I access it I am getting the login popup and after choosing my account I get this error every time. I tried with both client_id and api_key as value for the client_id parameter but still the same.

Does this happen because the stores are on the same account? Should I create another partner account with another store?

I have created a partner account, created an app but I don’t see any option to get the API key from there. On the partners.shopify.com on the apps API details I can only see the client id and client secret. I had to go on a store admin page and create another app from there and after that I saw some API keys.

What’s the difference between these two apps, which app should I use?

$authUrl = "https://{$shop}.myshopify.com/admin/oauth/authorize?" . http_build_query([
                'client_id' => config('services.shopify.client_id'),
                'scope' => config('services.shopify.scopes'),
                'redirect_uri' => 'http://localhost:8000/auth/shopify/callback',
                'state' => $nonce
            ]);

The link gets created and when I access it I am getting the login popup and after choosing my account I get this error every time. I tried with both client_id and api_key as value for the client_id parameter but still the same.

Does this happen because the stores are on the same account? Should I create another partner account with another store?

The app you created in the Shopify Partner Dashboard is designed for broader use, like public or custom apps that require OAuth for multiple stores. The app you created in your store’s admin dashboard provides direct API keys for a single store, meant for internal use. Since you want to sync multiple users’ products, you should use the app from the Partner Dashboard with OAuth to connect to each store individually