WooCommerce API integration: order status and product search

WooCommerce API integration: order status and product search

Your website chatbot can answer customers’ questions about your products and help them get a status update about their order.
This guide will take you through the necessary steps towards making your chatbot even cooler!
 

How to find and create an API credentials for your WooCommerce Store

When connecting your WooCommerce store with Chatwith, you will need to manage API access credentials from your WooCommerce store dashboard. In this article you will learn how to generate and find this API credentials within your WooCommerce store dashboard and how to use it to connect your Chatwith chatbot to it.
 

Generate API access credentials from the WooCommerce admin

To generate your API credentials:
  1. Head to the 'Settings' section in your dashboard
  1. Click on 'Advanced' tab and then 'REST API' category
  1. Click 'Create an API key' button
  1. In the following screen use the default settings:
    1. Enter a description that’ll help you remember the key later
    2. Your user account
    3. Permissions: Read
  1. Click 'Generate API key' button. Keep the key and secret handy for the following steps.
 
notion image
 
💡
Make sure to save both “Consumer key” and “Consumer secret” - we will need them soon.
 

Add WooCommerce Actions to your chatbot in Chatwith

The next few steps are very simple and happen in the Chatwith dashboard.

Add WooCommerce as new Action

From the Chatwith dashboard, click on the 'Actions' button in the left sidebar.
In the window that appears, click 'Install' on the 'WooCommerce' skill card.
 
notion image
 
Enter the values explained below in the fields and click 'Save'.
 
  • Store URL: the public URL which your customers use to visit your store, eg. https://beanhaven.com. If you do not have a custom domain, it could be something like https://beanhaven.wpcomstaging.com.
  • Consumer Key: your WooCommerce API key acquired in the previous steps
  • Consumer Secret: your WooCommerce API secret acquired in the previous steps
 
notion image
 

Provide the chatbot with additional context about the WooCommerce store

By adding the new skill, your chatbot already knows the basics, which are added to its “system prompt”:
You are a helpful assistant for an online WooCommerce store. You can answer questions about products currently in stock and a summary of order if the user provides order number (from their confirmation email).
 
You can extend the system prompt by providing more information about your store (eg. the types of products sold) or the language you’d like the chatbot to use (formal, relaxed etc).
 
To adjust the system prompt, navigate to the 'Settings' section of the Chatwith dashboard and edit the 'System prompt' field to your liking! You can navigate to that section by clicking here.

Troubleshooting

My chatbot says it cannot access the WooCommerce API

Please make review the API connection: is the API key correct? is the WooCommerce store link right? If you double-checked everything, please reach out to our support team at support@chatwith.tools. We can check our logs and help find the problem.

The chatbot gives incorrect product links

The common source of this issue may be “overindexation”. If you train your chatbot on all pages of a WooCommerce store and also integrate the WooCommerce Action, the chatbot has two conflicting sources of information about your products. You may want to experiment by removing the product pages from your knowledge sources.