After you connect a WooCommerce store to StoreClaw, AI can read orders, products, inventory, customers, and related data to support analysis, operational decisions, and scheduled tasks. This guide is intended for self-hosted WooCommerce stores.
Why Connect WooCommerce
After the connection is completed, StoreClaw can perform work such as:
- Order analysis: Read order lists, order statuses, and date-range data to generate sales trend analysis.
- Product and inventory management: Read products, SKUs, and stock quantities to identify low-stock and restocking risks.
- Customer insights: Read customer lists and purchase history to support segmentation and repeat-purchase analysis.
- Automation tasks: Use WooCommerce data in scheduled tasks so daily reports, weekly reports, and alerts are based on real business data.
Before You Start
StoreClaw's WooCommerce Connector currently supports only standard self-hosted environments, meaning WordPress and WooCommerce are installed on your own server or on third-party hosting that you control.
| Deployment type | Supported | Notes |
|---|---|---|
| Self-hosted server (VPS / dedicated server) | Supported | Fully supported. Just follow this guide. |
| Managed hosting (WP Engine / Kinsta / SiteGround, etc.) | Supported | Still self-hosted in practice, with the same setup path. |
| Shared hosting (Bluehost / HostGator, etc.) | Supported | Works as long as you have wp-admin access. |
| WordPress.com Business plan | Not supported | External REST API authentication is not compatible. |
| WordPress.com eCommerce plan | Not supported | Different from a standard self-hosted WooCommerce environment. |
If your admin entry point is wordpress.com/home, or your site uses a custom domain but the admin still runs inside the wordpress.com platform, it is usually outside the currently supported scope.
Prerequisites
Make sure your WooCommerce environment meets the following requirements:
- WooCommerce version
6.0+ - The store is publicly reachable over the internet
- WordPress permalinks are enabled and are not using the "Plain" mode
- Your server does not block external access to
/wp-json/ - The store is not protected by an extra HTTP Basic Auth layer
Tip: Local development environments such as localhost or private IP addresses cannot connect directly to StoreClaw. Use a deployed environment with a public domain.
WooCommerce Connection Information You Need
To connect WooCommerce in StoreClaw, prepare the following three values:
| Field | Example format | Description |
|---|---|---|
Store URL | https://your-store.com | The root domain of your WooCommerce store. HTTPS is recommended. |
Consumer Key | ck_xxxxxxxxxx... | A REST API key that starts with ck_ |
Consumer Secret | cs_xxxxxxxxxx... | A REST API secret that starts with cs_ |
Get WooCommerce REST API Keys
StoreClaw uses WooCommerce's built-in REST API for authorization, so no additional plugin is required.
Step 1: Open the REST API Management Page
- Sign in to WordPress Admin:
https://your-store.com/wp-admin - In the left menu, go to WooCommerce -> Settings
- Open the Advanced tab at the top
- Open the REST API submenu
You can also open the page directly with this path:
https://your-store.com/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=keys

Step 2: Create a New API Key
- Click Add key
- In Description, it is recommended to enter
StoreClaw - In User, choose a WordPress user with admin-level access
In Permissions, choose the access level you need:
- If you only want StoreClaw to read data for analysis, choose
Read - If you want StoreClaw to perform store-side operations, choose
Read/Write
- If you only want StoreClaw to read data for analysis, choose
- Click Generate API key
Important: The Consumer Secret is shown only once on the generation page. Copy and save it immediately. If you close the page without saving it, you will need to delete the old key and generate a new one.

Step 3: Confirm the Key Format
Generated keys usually follow this format:
Consumer Keyalways starts withck_Consumer Secretalways starts withcs_- Both values are long random strings, so make sure you do not copy extra spaces at the beginning or end
Example:
Consumer Key: ck_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8
Consumer Secret: cs_z9y8x7w6v5u4t3s2r1q0p9o8n7m6l5k4j3i2
Complete the Setup in StoreClaw
- In the left navigation of StoreClaw, click Connectors
- Find WooCommerce in the connector list
- Click the + button on the right
Fill in the following fields:
- Store URL:
https://your-store.com - Consumer Key: Paste the key that starts with
ck_ - Consumer Secret: Paste the secret that starts with
cs_
- Store URL:
- Click Connect WooCommerce
- After the connection succeeds, the card status changes to Connected
Store URL Format Rules
Store URL must be the root domain of the store. Use the examples below as a reference:
| Example | Correct | Notes |
|---|---|---|
https://your-store.com | Correct | Recommended format |
https://your-store.com/ | Correct | A trailing slash is handled automatically |
http://your-store.com | Works but not recommended | HTTPS is recommended |
https://your-store.com/shop | Incorrect | Do not include subpaths |
https://your-store.com/wp-admin | Incorrect | Do not enter the admin URL |
What Becomes Available After Connection
After the connection succeeds, StoreClaw can use WooCommerce capabilities such as:
| Module | Available capability |
|---|---|
| Order Sync | Read order lists, order details, and order statuses, with filtering by date or status |
| Product Management | Read products, variants, SKUs, prices, descriptions, and categories |
| Inventory Management | Check stock levels, identify low-stock products, and update inventory when needed |
| Customer Insights | Read customer lists, purchase history, and basic segmentation data |
Example Prompts
Analyze my WooCommerce order trends for the last 30 days.Check low-stock products and list the SKUs that should be restocked first.Calculate the repeat customer rate and group customers by spending level.
Connection Failed? Common Troubleshooting
Q1: Connection failed or 401 Unauthorized
Check the following first:
- Make sure
Consumer KeyandConsumer Secretwere copied completely, with no extra spaces - Make sure the selected WordPress user has the
AdministratororShop Managerrole - Make sure the key status is
Activeon the WooCommerce REST API page
Q2: Store URL is not reachable or 404
Check the following in order:
- Make sure
Store URLis the root domain and not/wp-adminor another subpath - Open
https://your-store.com/wp-json/wc/v3/system_status - If it returns JSON, the REST API is working normally
- If it returns
404, check your permalink configuration and click Save Changes once under Settings -> Permalinks
Q3: 403 Forbidden or REST API Disabled
Common causes include:
- Security plugins such as Wordfence or iThemes Security blocking REST API access
.htaccessor Nginx rules blocking/wp-json/- Firewall, CDN, or server policies blocking external requests
Q4: The Store Uses HTTP Basic Auth
Some test environments add an extra Basic Auth layer in front of WooCommerce. StoreClaw currently does not support combining WooCommerce REST API authentication with an additional Basic Auth layer, so use a production environment without this protection enabled.
Q5: Can I connect multiple WooCommerce stores?
Yes. On the Connectors page, you can add WooCommerce multiple times and provide a separate Store URL, Consumer Key, and Consumer Secret for each store.
Security Recommendations
To reduce key-related risk, follow these practices:
- Create a dedicated API key pair for StoreClaw only and do not share it with other systems
- If you only need data access, prefer the
Readpermission - If you suspect the key is compromised, revoke it in WooCommerce immediately and generate a new one
- Review WooCommerce REST API logs regularly for unusual requests
FAQ
Q: Will StoreClaw modify my WooCommerce store data?
A: That depends on the permissions you grant. If the API key uses Read, StoreClaw can only read data. If it uses Read/Write, write actions are possible only when you explicitly ask StoreClaw to perform them.
Q: Why can't I connect even though WooCommerce is installed?
A: A common reason is that the environment is not a standard self-hosted WooCommerce setup, but a WordPress.com Business or WordPress.com eCommerce plan. Those environments use an authentication model that is not compatible with the standard WooCommerce REST API.
Q: Can one StoreClaw account connect multiple WooCommerce stores?
A: Yes. You can add multiple WooCommerce connections in the Connectors page, with a separate Store URL, Consumer Key, and Consumer Secret for each store.
Q: Do I have to use Read/Write when connecting WooCommerce?
A: No. If you only need to read orders, products, inventory, and customer data for analysis, Read is enough. Use Read/Write only if you truly need write operations.
Q: How do I disconnect the connection?
A: In the Connectors page in StoreClaw, click the connected WooCommerce card and choose disconnect. If you want to fully disable access, it is also recommended to revoke the corresponding API key in WooCommerce.
将 WooCommerce 商店接入 StoreClaw 后,AI 可以直接读取订单、商品、库存、客户等数据,用于分析、运营决策支持与定时任务。本文适用于 自托管(Self-Hosted)WooCommerce 商店。
为什么需要连接 WooCommerce
连接成功后,StoreClaw 可以在授权范围内执行以下工作:
- 订单分析: 读取订单列表、订单状态与时间区间数据,生成销售趋势分析。
- 商品与库存管理: 查询商品、SKU、库存数量,识别低库存和补货风险。
- 客户洞察: 读取客户列表与消费历史,辅助做客户分层和复购分析。
- 自动化任务: 将 WooCommerce 数据接入定时任务,让日报、周报和预警基于真实业务数据运行。
接入前请先确认
StoreClaw WooCommerce Connector 仅支持标准自托管环境,即您在自己的服务器或第三方主机商上独立安装 WordPress + WooCommerce 的部署方式。
| 部署方式 | 是否支持 | 说明 |
|---|---|---|
| 自托管服务器(VPS / 独立服务器) | 支持 | 完整支持,按本文操作即可 |
| 托管主机商(WP Engine / Kinsta / SiteGround 等) | 支持 | 本质仍为自托管,操作路径相同 |
| Bluehost / HostGator 等共享主机 | 支持 | 只要拥有 wp-admin 权限即可 |
| WordPress.com Business 计划 | 不支持 | 外部 REST API 认证机制不兼容 |
| WordPress.com eCommerce 计划 | 不支持 | 与标准 WooCommerce 自托管环境不同 |
如果您登录后台的入口是 wordpress.com/home,或商店虽然绑定了自定义域名,但后台仍在 wordpress.com 体系中,通常不属于当前支持范围。
接入前提条件
请确保您的 WooCommerce 环境满足以下要求:
- WooCommerce 版本为
6.0+ - 商店可以通过公网访问
- WordPress 已启用固定链接,且不是“朴素”模式
- 服务器未屏蔽外部对
/wp-json/的访问 - 商店未额外开启 HTTP Basic Auth 二次密码保护
提示: 本地开发环境(如 localhost、内网 IP)无法直接连接到 StoreClaw。请使用有公网域名的正式部署环境。
获取 WooCommerce 连接信息
在 StoreClaw 中连接 WooCommerce 时,您需要准备以下三项信息:
| 字段 | 示例格式 | 说明 |
|---|---|---|
Store URL | https://your-store.com | WooCommerce 商店根域名,建议使用 HTTPS |
Consumer Key | ck_xxxxxxxxxx... | 以 ck_ 开头的 REST API Key |
Consumer Secret | cs_xxxxxxxxxx... | 以 cs_ 开头的 REST API Secret |
获取 WooCommerce REST API Key
StoreClaw 使用 WooCommerce 内置 REST API 完成授权,无需额外安装插件。
步骤一:进入 REST API 管理页面
- 登录 WordPress 后台:
https://your-store.com/wp-admin - 在左侧菜单进入 WooCommerce → 设置
- 打开顶部的 高级(Advanced) 选项卡
- 进入子菜单 REST API
您也可以直接访问以下路径:
https://your-store.com/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=keys

步骤二:创建新的 API Key
- 点击右上角 Add key(添加密钥)
- 在 Description(描述) 中建议填写
StoreClaw - 在 User(用户) 中选择一个具有管理员权限的 WordPress 用户
在 Permissions(权限) 中选择所需权限:
- 如果希望 StoreClaw 只读分析数据,选择
Read - 如果希望 StoreClaw 可执行店内操作,选择
Read/Write
- 如果希望 StoreClaw 只读分析数据,选择
- 点击 Generate API key(生成 API key)
重要: Consumer Secret 只会在生成页展示一次。请立即复制并保存。如果未保存,只能删除旧密钥后重新生成。

步骤三:确认密钥格式
生成后的密钥通常符合以下格式:
Consumer Key固定以ck_开头Consumer Secret固定以cs_开头- 两串密钥都是较长的随机字符串,复制时请确保首尾没有空格
示例
Consumer Key: ck_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8
Consumer Secret: cs_z9y8x7w6v5u4t3s2r1q0p9o8n7m6l5k4j3i2
在 StoreClaw 中完成接入
- 在 StoreClaw 左侧导航栏点击 连接器
- 在连接器列表中找到 WooCommerce
- 点击右侧的 + 按钮
填写以下字段:
- 店铺网址:
https://your-store.com - Consumer Key: 粘贴以
ck_开头的密钥 - Consumer Secret: 粘贴以
cs_开头的密钥
- 店铺网址:
- 点击 连接 WooCommerce
- 连接成功后,卡片状态将变为 已连接
Store URL 填写规范
Store URL 必须是商店根域名,请参考以下示例:
| 示例 | 是否正确 | 说明 |
|---|---|---|
https://your-store.com | 正确 | 推荐填写方式 |
https://your-store.com/ | 正确 | 末尾斜杠会自动处理 |
http://your-store.com | 可用但不推荐 | 建议升级为 HTTPS |
https://your-store.com/shop | 错误 | 不要带子路径 |
https://your-store.com/wp-admin | 错误 | 不要填写后台地址 |
接入后可用功能
成功连接后,StoreClaw 可在授权范围内调用以下能力:
| 工具模块 | 可用能力 |
|---|---|
| 订单同步 | 获取订单列表、订单详情、订单状态,按时间或状态筛选 |
| 商品管理 | 查询商品、变体、SKU、价格、描述与分类 |
| 库存管理 | 查看库存、识别低库存商品,必要时更新库存 |
| 客户洞察 | 获取客户列表、消费历史与客户分层信息 |
示例指令
帮我分析最近 30 天 WooCommerce 店铺的订单趋势检查低库存商品,列出需要优先补货的 SKU统计复购客户占比,并按消费金额做简单分层
连接失败?常见问题排查
Q1:提示 Connection failed 或 401 Unauthorized
请重点检查以下几项:
Consumer Key和Consumer Secret是否完整复制,首尾无空格- 生成密钥时选择的用户是否具有
Administrator或Shop Manager权限 - WooCommerce
REST API页面中的密钥状态是否为Active
Q2:提示 Store URL is not reachable 或 404
可以按下面顺序检查:
- 确认
Store URL填写的是根域名,而不是/wp-admin或其他子路径 - 访问
https://your-store.com/wp-json/wc/v3/system_status - 如果返回 JSON,说明 REST API 正常
- 如果返回
404,请检查固定链接配置,并在 设置 → 固定链接 中点击一次 保存更改
Q3:出现 403 Forbidden 或 REST API 被禁用
常见原因包括:
- 安全插件(如 Wordfence、iThemes Security)限制了 REST API
.htaccess或 Nginx 配置屏蔽了/wp-json/- 防火墙、CDN 或服务器策略阻止了外部请求
Q4:商店启用了 HTTP Basic Auth
部分测试环境会在 WooCommerce 前增加一层基础认证。当前 StoreClaw 不支持在 WooCommerce REST API 之外再叠加 Basic Auth,因此请使用未开启该保护的正式环境接入。
Q5:可以连接多个 WooCommerce 商店吗?
可以。您可以在 Connectors 页面多次点击 WooCommerce 的 + 按钮,为每个商店分别填写独立的 Store URL、Consumer Key 和 Consumer Secret。
安全建议
为降低密钥风险,建议遵循以下做法:
- 仅为 StoreClaw 单独创建一对 API Key,不与其他系统共用
- 如仅需读取数据,优先使用
Read权限 - 如怀疑密钥泄露,立即在 WooCommerce 后台
Revoke旧密钥并重新生成 - 定期检查 WooCommerce REST API 日志,确认无异常请求
常见问题 (FAQ)
Q:StoreClaw 会修改我的 WooCommerce 店铺数据吗?
A: 取决于您授予的权限。如果密钥权限为 Read,StoreClaw 只能读取数据;如果权限为 Read/Write,且您主动要求执行操作,才会产生写入行为。
Q:为什么我明明装了 WooCommerce,却还是无法连接?
A: 很多情况是因为当前环境并不是标准自托管 WooCommerce,而是 WordPress.com Business / eCommerce 计划。这类环境的认证机制与标准 WooCommerce REST API 不兼容。
Q:一个 StoreClaw 账号可以连接多个 WooCommerce 商店吗?
A: 可以。您可以在 Connectors 页面多次添加 WooCommerce 连接,为每个商店分别填写独立的 Store URL、Consumer Key 和 Consumer Secret。
Q:连接 WooCommerce 时一定要使用 Read/Write 权限吗?
A: 不一定。如果您只需要读取订单、商品、库存和客户数据做分析,使用 Read 权限即可。只有在确实需要执行写入类操作时,才建议使用 Read/Write。
Q:如何断开连接?
A: 在 StoreClaw 的 Connectors 页面点击已连接的 WooCommerce 卡片,选择断开连接即可。如需彻底停用,建议同时在 WooCommerce 后台撤销对应 API Key。