WooCommerce Credential are not Valid

Hi, i’m trying to connect to woocommerce but i have always the same error message :

Error: The WooCommerce credentials are not valid!
   at Object.woocommerceApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/WooCommerce/GenericFunctions.js:30:19)
   at processTicksAndRejections (internal/process/task_queues.js:97:5)

I checked several times, I entered the right credential (Consumer Key, Consumer secret), my Rest API is on write and read mode.

Do you have any idea where the problem is ?
Thank you :pray:t2:

Welcome to the community @simon_joseph!

Did you see this guide and did you create the credentials the same way?
https://docs.n8n.io/nodes/credentials/WooCommerce/

Thanks @jan,
yeah it’s what i did. Nothing has changed, it still doesn’t work

Hey @simon_joseph could you figure it out?

Ok so i just test with another website, and it work… I don’t know why it don’t work on the first site

@jan hi! Faced the same problem, my workflow seemed to work fine, credentials were assigned properly, then suddenly, my Woocommerce Credentials are not valid anymore.

any suggestion on how to troubleshoot this problem? thanks! looking forward for your response! :slightly_smiling_face:

Welcome to the community @gnik31!

Sadly not. Could however be that their tokens are only valid for a specific amount of time and then have to get regenerated. Did you try that?

Hello @jan apparently you’re right. We needed to regenerate the tokens. And it’s now working! Thank you so much!

1 Like

Hello guys,

I encountered this very issue yesterday and spent the whole day debugging it.

The reason why it isn’t working is most likely due to PHP-FastCGI which is altering the request to the WooCommerce REST-API. Outcome is Authorization Error 401.

Possible elegant solution:
RewriteCond %{HTTP:Authorization} ^(.)
RewriteRule ^(.
) - [E=HTTP_AUTHORIZATION:%1]

Add this to your .htaccess (WP main folder) below RewriteEngine On

Hope this helps.

1 Like

Hey @o3475!

Welcome to the community :slightly_smiling_face:

Thank you for sharing a solution!

1 Like

Hey everyone,

I just became mad about this problem I had myself, but I just found a solution that works perfectly !

Just open your .htaccess and add this below “RewriteEngine on” →
RewriteRule ^index.php$ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Worked perfectly for me ! Hope it can save some of you.

Solution found here (Solution #1) →

2 Likes

Welcome to the community @Eeroshi and thanks a lot for directly contributing!

1 Like