> For the complete documentation index, see [llms.txt](https://docs.dos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dos.ai/dosclaw/plugins-and-connectors/ecommerce/woocommerce.md).

# WooCommerce

Connect self-hosted WordPress WooCommerce stores to DOSClaw AI agents. Provide 24/7 store support, inventory lookups, coupon code verification, and order tracking directly via WooCommerce REST API.

## Capabilities & MCP Tools

| MCP Tool             | Operation | Description                                                                            |
| -------------------- | --------- | -------------------------------------------------------------------------------------- |
| `search_products`    | Read      | Query store products by name, category slug, SKU, or attribute (color, size).          |
| `get_product_detail` | Read      | Retrieve product prices, description, stock status, gallery images, and variation IDs. |
| `check_order_status` | Read      | Look up WooCommerce order status, line items, customer notes, and payment status.      |
| `verify_coupon`      | Read      | Validate promotion coupons, expiration dates, and discount calculations.               |

***

## Prerequisites

1. A self-hosted WordPress site with the **WooCommerce** plugin installed and active.
2. An HTTPS domain with a valid SSL certificate (required by WooCommerce REST API).
3. Administrator access to generate WooCommerce REST API keys.

***

## Setup Guide

### Step 1: Generate WooCommerce REST API Keys

1. Log in to your WordPress Admin Dashboard.
2. Go to **WooCommerce** $\rightarrow$ **Settings** $\rightarrow$ **Advanced** $\rightarrow$ **REST API**.
3. Click **Add key**.
4. Set:
   * **Description**: `DOSClaw AI Agent`
   * **User**: Select an admin user account.
   * **Permissions**: `Read` (or `Read/Write` if using order creation tools).
5. Click **Generate API key**.
6. Copy the **Consumer Key** (`ck_...`) and **Consumer Secret** (`cs_...`). Keep this tab open—WooCommerce only displays the secret once.

### Step 2: Connect in DOS.AI Dashboard

1. In the **DOS.AI Dashboard**, open **Integrations** $\rightarrow$ **WooCommerce**.
2. Click **Connect Store**.
3. Enter:
   * **Store URL**: Your website's root URL (e.g. `https://my-store.com`).
   * **Consumer Key**: `ck_...`
   * **Consumer Secret**: `cs_...`
4. Click **Verify & Connect**. DOSClaw makes a lightweight test call to `GET /wp-json/wc/v3/system_status`.

### Step 3: Bind to Your Agent

1. Open your agent $\rightarrow$ **Integrations** $\rightarrow$ enable **WooCommerce**.
2. Save changes.

***

## Multi-Platform Commerce Aggregation

If your business sells on both WooCommerce (website) and an offline POS (like KiotViet):

* DOSClaw supports **Multi-Platform Commerce**: Your agent can query both stores at once.
* Products are qualified with platform prefixes (e.g. `woocommerce:11`, `kiotviet:DH000002`).
* The agent automatically routes customer questions to the appropriate store.

***

## Troubleshooting

| Issue                         | Cause                                       | Solution                                                                                                                                              |
| ----------------------------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| 401 Unauthorized error        | WordPress permalinks set to Plain           | WooCommerce REST API requires "Pretty Permalinks". Go to WP Admin $\rightarrow$ Settings $\rightarrow$ Permalinks $\rightarrow$ select **Post name**. |
| SSL / HTTPS error             | Self-signed or expired SSL                  | WooCommerce API requires a valid HTTPS certificate.                                                                                                   |
| Cloudflare / WAF blocking API | Cloudflare Bot Fight Mode blocking requests | In Cloudflare WAF, add a custom firewall rule to allow requests with User-Agent `DOSClaw/1.0`.                                                        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.dos.ai/dosclaw/plugins-and-connectors/ecommerce/woocommerce.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
