With the WooCommerce connection, Stockhub fetches the orders from your webshop. Stockhub sends the stock and the track & trace back to WooCommerce. In this article you first create an API key in WooCommerce and then the connection in Stockhub.
What you need
- Access to the WordPress dashboard of your webshop with an administrator account.
- The address of your webshop, for example https://www.yourwebshop.com.
- Permalinks that are not set to Plain. The WooCommerce REST API only works with other permalinks. You set this in WordPress under Settings > Permalinks.
Creating an API key in WooCommerce
- Log in to the WordPress dashboard of your webshop.
- Go to WooCommerce > Settings > Advanced > REST API.
- Click Add key or Create an API key.
- Under Description, enter a recognisable name, for example Stockhub.
- Under User, choose a user with administrator rights.
- Under Permissions, choose Read/Write. Stockhub has to be able to change the stock and the status of orders.
- Click Generate API key.
- Copy the Consumer key and the Consumer secret. WooCommerce shows the Consumer secret only once.
More information is in the WooCommerce documentation: https://woocommerce.com/document/woocommerce-rest-api/
Creating the connection in Stockhub
- In the menu, go to Integrations > Sales channels.
- On the Sales channels tab, click New sales channel. The Add sales channel window opens.
- Choose Woocommerce.
- Fill in the fields:
- Description: a recognisable name for the connection, for example the name of your webshop.
- Shipping name: the name on the shipping label. If you leave it empty, Stockhub uses your company name.
- URL: the full address of your webshop with https://, for example https://www.yourwebshop.com. Do not add /wp-json.
- Consumer key and Consumer secret: the keys from WooCommerce.
- Click Test connection. If you see Connected, Stockhub can reach your webshop. If you see Connection failed, check the URL and the keys.
- Click Next.
- Choose which data Stockhub exchanges. Set each setting to Active or Inactive:
- Import orders: fetch orders from WooCommerce.
- Update existing product info and Import new products: you only see these if the fulfilment company has turned them on.
- Update stock to channel: send the stock from Stockhub to WooCommerce.
- Sync a virtual stock amount: Stockhub adds this amount to the stock it sends to WooCommerce.
- Send track & trace email: you only see this if the fulfilment company has turned it on.
- Click Save.
You then see the message Pending sales channel approval. The channel stays in draft status until the fulfilment company activates it. Only then do the synchronisations start.
How the WooCommerce connection works
- Stockhub fetches orders with the status Processing. If Import on-hold B2B orders is on, Stockhub also fetches orders with the status On hold when the meta field b2b-bestelling has the value ja or yes. This lets you ship B2B orders before they are paid.
- Stockhub recognises products by their SKU. Give every product and every variation in WooCommerce a SKU. Stockhub skips variations without a SKU.
- If Process orders (with tracking) is on, Stockhub sets a shipped order in WooCommerce to Completed. The track & trace is added to the order as a note for the customer.
- With Update stock to channel, Stockhub sends the stock of each product to WooCommerce. WooCommerce only uses it for products that have stock management (Manage stock) turned on.
Settings that belong to WooCommerce
Open the channel via Integrations > Sales channels. Besides the general settings, you find:
- On the Details tab: Webshop URL, Webshop consumer key and Webshop consumer secret. Enter new keys here if you have created a new key in WooCommerce. Under Metafield pickuppoint carrier, enter the metadata field in which your webshop stores the carrier when an order goes to a pickup point.
- On the Sync tab: Set customer note in the order remark, Automatically cancel orders and Cash register orders with the Meta field cash register orders and Import on-hold B2B orders.
- Under Custom product fields: for HS code, Country of origin and Barcode, enter the meta field of your products from which Stockhub takes that value.
- On the Shipping options tab: shipping options in the checkout of your webshop via the Stockhub plugin. You only see this tab if the fulfilment company has turned on shipping options.
See also Verkoopkanalen beheren for all settings, the orders of the channel and deleting a channel.
Comments
0 comments
Please sign in to leave a comment.