Enabling WooCommerce API Access
All WooCommerce sites have an API that allows other applications to access the data programmatically. The Ablestar WooCommerce Importer app uses this API to copy your store's data from WooCommerce into Shopify.
For the Ablestar WooCommerce Importer app to connect to your WooCommerce store, you'll need to enable the API on your WooCommerce site and generate a consumer key and secret (think of these as a username and password for the API). We'll cover how to do that in this article.
To enable the WooCommerce API to generate API credentials, you'll need:
- Login credentials to the admin section of your WooCommerce/WordPress site
- Permalinks enabled on your WordPress installation
Activating the API
These instructions apply to versions of WooCommerce released after July 15, 2015 (versions 2.4 and later). If you have an older installation of WooCommerce, scroll down to the next section for instructions.
You can activate the API from your WordPress site's admin:
- On the left-hand menu, click on WooCommerce.
- Click on Settings:
3. Click on the tab that’s named API and make sure the Enable the REST API checkbox is checked.
4. Click Save changes:
Don't see the API tab?
Different versions of WooCommerce have slightly different ways to enable the API. If you're using version 3.4 or greater (released May 2018), check out the documentation here: https://docs.woocommerce.com/document/woocommerce-rest-api/#section-2
Otherwise, if you have an older version of WooCommerce, scroll down to the next section to see how to activate the API.
Now that the API is enabled, we need to generate credentials for the API. The WooCommerce API has two credentials for every API user: Consumer Key and Consumer Secret. You can think of these as a username and password for the program that will call your API.
To generate credentials for the API:
- Below the tabs at the top of the page, click Keys/Apps.
- On the next page, click on Add Key
- Enter a description for the API credentials.
- If the program that is using the API will need to change things on the WooCommerce site, change the Permission dropdown to Read.
- Click Generate API Key.
On the last page, you’ll see your API credentials:
The Consumer Key will always start with ‘ck_,’ and the consumer secret will always begin with ‘cs_.’ Copy these values and store them in a safe place; once you leave the page, you won’t be able to see them again.
Activating the API - WooCommerce versions 2.3 and before
If you have an older version of WooCommerce, there's a slightly different method to enable the API since API credentials are tied to a specific user.
The API can be activated on the main WooCommerce settings page:
- Go back to your WordPress site’s administration page and click on WooCommerce.
- Click on Settings:
3. On the settings page, make sure the Enable the REST API checkbox is checked
4. Click Save Changes at the bottom of the page.
5. On the main menu on the left of the WordPress admin section, click on the Users tab:
6. Click on your username. You'll see a lot of settings you can change.
7. Scroll down to the bottom of the page and check Generate API Key
8. Once the box is checked, reload the page.
9. Scroll down to the bottom of the page again. You should see your API credentials where the checkbox used to be:
The Consumer Key will always start with 'ck_,' and the consumer secret will always begin with 'cs_.'