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.
Create a key for Stokis
- Type a Description that tells you later whose key it is, for example Stokis.
- Choose a User with the Administrator or Shop manager role. The key reads what that user may read.
- Choose the Permissions: Read if Stokis should only read, Read/Write if Stokis should also add received purchase orders to your stock.
- Press Generate API key.
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.
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
- In Stokis open Integrations and choose WooCommerce.
- Type the shop's home address into Store URL. A pasted /wp-admin or /wp-json link is fine; Stokis trims it.
- Paste the Consumer key and the Consumer secret.
- Press Test connection. Stokis checks the key against your shop before anything is saved.
- Press Connect. The first sync starts on its own and a dialog shows each step.
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 reads | Stokis uses it for |
|---|---|
| Products and variations: name, SKU, barcode, status, categories and brands | The product list. Each variation is its own product; the variable product above it is not a stock row |
| Manage stock and the stock quantity | Stock levels, stock cover and reorder points |
| Cost of goods sold, where the shop fills it in | Product cost |
| Orders: number, status, date, currency, total and the line items | Sales history and the demand forecast |
| Nothing about your customers | Billing 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 see | Cause | Fix |
|---|---|---|
| The consumer key or consumer secret is wrong, or the key was revoked | One of the two values was copied in part, the two were swapped, or the key no longer exists | Paste both again. If the secret is lost, revoke the key and create a new one |
| The key's user can't read products | The key belongs to a user without the Administrator or Shop manager role | Create the key for a Shop manager or Administrator, with Read permission |
| Your shop answered with a page instead of data | A maintenance or coming-soon plugin, or a login page, is in front of the REST API | Switch that page off, or let the REST API through, then test again |
| WordPress's REST API didn't answer | The address is not the shop's, or a security plugin has switched the REST API off | Check the address and allow the REST API in the security plugin |
| WordPress answered, but WooCommerce's API isn't there | WooCommerce is not installed or not active on that site | Activate WooCommerce, then test again |
| Your shop refused the request before WordPress answered | A firewall or security plugin blocks Stokis | Allow Stokis through the firewall, then test again |
| The API key is read-only, so Stokis can't update stock | Push stock back to store is on in Stokis while the key has Read permission only | Create 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.
Read is enough for products, stock and orders. Choose Read/Write only if Stokis should add received purchase orders to your stock.
No. Stokis asks for an order's number, status, date, currency, total and line items. Billing and shipping details are not requested.
Each variation is its own product in Stokis, because each one is ordered from the supplier separately. The variable product above them is not a stock row.
No, WooCommerce shows it once. Revoke the key and create a new one, then paste the new pair into Stokis.
Yes. Stokis finds the REST API at either address WordPress uses for it.