Skip to main content

How to connect WooCommerce to Stokis

Create a REST API key under WooCommerce → Settings → Advanced → REST API, then paste the consumer key and the consumer secret into Stokis. There is no plugin to install.

What you need before you start

Stokis reads WooCommerce through the REST API that every WooCommerce shop already has. You create a key for it in the shop's own settings.

  • A WordPress account in the shop with the Administrator or Shop manager role.
  • A shop address that opens over https in a browser. Stokis connects over https only.
  • A Stokis account with a workspace that has no shop connected yet. One workspace holds one shop.

Open the REST API settings

In WP Admin open WooCommerce → Settings, choose the Advanced tab, then REST API keys in the row of links under the tabs. Press Add key.

The WooCommerce settings page with the Advanced tab chosen and REST API keys selected in the row of links under it. An Add key button sits next to the REST API heading.
WooCommerce → Settings → Advanced → REST API keys, with the Add key button.

Create a key for Stokis

  1. Type a Description that tells you later whose key it is, for example Stokis.
  2. Choose a User with the Administrator or Shop manager role. The key reads what that user may read.
  3. Choose the Permissions: Read if Stokis should only read, Read/Write if Stokis should also add received purchase orders to your stock.
  4. Press Generate API key.
The WooCommerce Key details form with the description Stokis, the user admin and the permissions set to Read/Write, above a Generate API key button.
The key form, filled in. Read/Write is chosen here; Read is enough if Stokis should never change stock.

Copy the consumer key and the consumer secret

WooCommerce now shows the Consumer key and the Consumer secret, each with a Copy button. Copy both before you leave the page: the secret is shown this one time.

The WooCommerce Key details page after the key was made: a green notice that the API key was generated, a consumer key starting with ck_ and a consumer secret starting with cs_, each with a Copy button, and a Revoke key link.
The page WooCommerce shows once, with an example key and secret. The QR code that the real page shows under them is left out.

If you left the page without the secret, revoke the key and create a new one. WooCommerce cannot show a secret again.

Paste both values into Stokis

  1. In Stokis open Integrations and choose WooCommerce.
  2. Type the shop's home address into Store URL. A pasted /wp-admin or /wp-json link is fine; Stokis trims it.
  3. Paste the Consumer key and the Consumer secret.
  4. Press Test connection. Stokis checks the key against your shop before anything is saved.
  5. Press Connect. The first sync starts on its own and a dialog shows each step.
The Integrations page in Stokis with WooCommerce chosen: a Store URL field holding your-store.com and Consumer key and Consumer secret fields with hidden values.
The Integrations page in Stokis with WooCommerce chosen and example values. The key and secret are hidden as you paste them.

After the first sync Stokis reads the shop again on the schedule of your plan, and Sync now reads it on the spot.

Let Stokis add received orders to your stock

This step is optional. It needs a key with Read/Write permissions and the Push stock back to store switch on in the Integrations page of Stokis. Receiving a purchase order in Stokis then adds the received quantity to the product's stock in WooCommerce. With a Read key, or with the switch off, Stokis only reads.

A product or variation with Manage stock off has no stock level in WooCommerce. Stokis shows it as Not tracked, counts its sales, and does not hold a stock figure for it.

What Stokis reads from WooCommerce

Stokis asks WooCommerce for the fields below and no others.

Stokis readsStokis uses it for
Products and variations: name, SKU, barcode, status, categories and brandsThe product list. Each variation is its own product; the variable product above it is not a stock row
Manage stock and the stock quantityStock levels, stock cover and reorder points
Cost of goods sold, where the shop fills it inProduct cost
Orders: number, status, date, currency, total and the line itemsSales history and the demand forecast
Nothing about your customersBilling and shipping details are not requested, so no names, emails or addresses leave the shop

Orders that are pending payment, failed, cancelled, refunded or still a draft are not counted as sales. A product without a SKU is listed under its barcode, or under woo- and its WooCommerce number.

When WooCommerce does not connect

Stokis names what it found. Match the message you see.

What you seeCauseFix
The consumer key or consumer secret is wrong, or the key was revokedOne of the two values was copied in part, the two were swapped, or the key no longer existsPaste both again. If the secret is lost, revoke the key and create a new one
The key's user can't read productsThe key belongs to a user without the Administrator or Shop manager roleCreate the key for a Shop manager or Administrator, with Read permission
Your shop answered with a page instead of dataA maintenance or coming-soon plugin, or a login page, is in front of the REST APISwitch that page off, or let the REST API through, then test again
WordPress's REST API didn't answerThe address is not the shop's, or a security plugin has switched the REST API offCheck the address and allow the REST API in the security plugin
WordPress answered, but WooCommerce's API isn't thereWooCommerce is not installed or not active on that siteActivate WooCommerce, then test again
Your shop refused the request before WordPress answeredA firewall or security plugin blocks StokisAllow Stokis through the firewall, then test again
The API key is read-only, so Stokis can't update stockPush stock back to store is on in Stokis while the key has Read permission onlyCreate a Read/Write key and paste it into Stokis, or switch the push off

How to replace the key or disconnect

  • To stop Stokis reading the shop, open WooCommerce → Settings → Advanced → REST API keys and press Revoke on the key. It stops working at once.
  • To replace the key, create a new one and paste it into the Integrations page in Stokis, then revoke the old one.
  • To disconnect on the Stokis side, press Disconnect in the Integrations page. The automatic sync stops and the saved key is removed. Your products and sales history in Stokis stay, and you can connect again later.

Questions about connecting WooCommerce

No. Stokis uses the REST API that is part of WooCommerce, with a key you create in the shop's settings.

Guides for other platforms