Categories
Tutorials

Authenticating with WooCommerce: Here’s how you can do it

CoCart users can now authenticate the WooCommerce way again. Want to see how you can do it?

Before now, WooCommerce authentication method was left open so any 3rd party REST API could use there authentication method. This gave no limits for users to authenticate with CoCart.

However, due to the added restriction for just their REST API, (which could change in the future as WordPress will provide a more generic version) CoCart could no longer authenticate the WooCommerce way on either version of CoCart’s API.

But have no fear as today version 2.0.5 provides a small update to re-enable WooCommerce’s authentication method again for CoCart.

CoCart users can now authenticate the #WooCommerce way again. ?

On top of the update, I’m going to show you how to authenticate the WooCommerce way.

Please Note

The guide below is assuming you are making requests with HTTPS.

First if you haven’t already created any keys you will need to go the advanced section in your WooCommerce settings.

From there you need to press Add key button. Then select the user who will be using the key. Set the permissions to READ/WRITE so all of the CoCart API is accessible. Enter a description if you wish and then press Generate API key button.

You will then be presented with your consumer key and secret which you will need to copy before moving away from the page as warned to the user in the screenshot below.

Once you have your key created you can then make any authenticated request with CoCart like so.

Fetching the cart while authenticating

If you would like to understand more about authenticating with WooCommerce read the authentication section in their REST API documentation.

Happy coding!

%d bloggers like this: