Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant pull in products, says my api credentials are not correct #115

Closed
Pixney-William opened this issue Mar 2, 2022 · 5 comments · Fixed by #116
Closed

Cant pull in products, says my api credentials are not correct #115

Pixney-William opened this issue Mar 2, 2022 · 5 comments · Fixed by #116

Comments

@Pixney-William
Copy link

I followed these instructions: https://statamic-shopify.jackwhiting.co.uk/setup

Shopify seems to have a new look when it comes to setting up things since January. Do you have new recommendations here? Because seems like it doesn't want to recognise my api credentials. Even gave it all the permissions there was.

[2022-03-03 06:21:06] local.ERROR: [API] Invalid API key or access token (unrecognized login or wrong password) {"userId":"07b8afba-2cf7-46b4-b246-a696bdc6ec1d","exception":"[object] (PHPShopify\\Exception\\ApiException(code: 401): [$
[stacktrace]
#0 /home/runcloud/webapps/app-shields/vendor/phpclassic/php-shopify/lib/ShopifyResource.php(347): PHPShopify\\ShopifyResource->processResponse()
#1 /home/runcloud/webapps/app-shields/vendor/jackabox/statamic-shopify/src/Traits/FetchAllProducts.php(15): PHPShopify\\ShopifyResource->get()
#2 /home/runcloud/webapps/app-shields/vendor/jackabox/statamic-shopify/src/Http/Controllers/CP/ImportProductsController.php(19): Jackabox\\Shopify\\Http\\Controllers\\CP\\ImportProductsController->fetchProducts()
#3 /home/runcloud/webapps/app-shields/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Jackabox\\Shopify\\Http\\Controllers\\CP\\ImportProductsController->fetchAll()
#4 /home/runcloud/webapps/app-shields/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#5 /home/runcloud/webapps/app-shields/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#6 /home/runcloud/webapps/app-shields/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
@Pixney-William
Copy link
Author

Using these credentials
Group 1

And the url to my shop is/should be correct.

@jackabox
Copy link
Collaborator

jackabox commented Mar 3, 2022

Thanks for reporting this, found the issue. Will get a patch out ASAP.

@jackabox
Copy link
Collaborator

jackabox commented Mar 3, 2022

Hey @Pixney-William,

If you update to 1.7.4 and then try the following:

Above where you have these credentials, there will be a button that says "Install App". You need to run this, and it will generate an Admin API Token for you. Copy that token (keep it safe, you only get it once) and add it to the env like this:

SHOPIFY_ADMIN_TOKEN=TOKEN HERE

You no longer need the SHOPIFY_AUTH_KEY or SHOPIFY_AUTH_PASSWORD as these aren't validated on the API anymore. I will update the docs to specify this later.

Any issues, re-open and I'll have a look.

@Pixney-William
Copy link
Author

Worked like a charm! Thanks for super quick support!

@Pixney-William
Copy link
Author

@jackabox Just noticed (without having looked at the code) that you are most likely looking for one or both of the below to exist in the env file. Because without them trying to access the shopify url within the control panel it says the store is not setup. Adding them, it all works as a charm though. Just thought i would let you know.

SHOPIFY_AUTH_KEY
SHOPIFY_AUTH_PASSWORD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants