One common issue that can happen while setting up WooCommerce integration with MicroBiz is an error about not valid customer key or consumer secret:



This error can happen in case the Woo side server is not accepting authorization headers.

To check if this is the case or not here are some basic steps:

The request URL we'll test is wp-json/wc/v2/orders. On localhost the full URL may look something like this: https://local.wordpress.dev/wp-json/wc/v2/orders. Modify this to use your own site URL.

In Postman, you need to set the fields for request type, request URL, and the settings on the authorization tab. For Authorization, choose basic auth and enter your consumer key and consumer secret keys from WooCommerce into the username and password fields

Once done, hit send and you'll see the JSON response from the API if all worked well. You should see something like this:

Generated API Keys

Insomnia is almost identical to Postman; fill in the same fields and again use basic auth.

Insomnia


If, after doing the steps you get a 401 error and not the correct response, then Your API keys or signature is wrong. Ensure that:

  • The user you generated API keys for actually has access to those resources.
  • The username when authenticating is your consumer key.
  • The password when authenticating is your consumer secret.
  • Make a new set of keys to be sure.

If your server utilizes FastCGI, check that your authorization headers are properly read.