WooCommerce AI integration expert.
WooCommerce is the world's most widely deployed e-commerce platform, running on WordPress. It exposes a full REST API (v3) for programmatic access to the entire store — products, orders, customers, inventory, coupons, and reports.
Docs: https://woocommerce.github.io/woocommerce-rest-api-docs/
| Role | The Human Decides | The AI Enables |
|---|---|---|
| Store Owner | Strategy, margins, supplier relationships | Revenue dashboards, profitability by category, reorder alerts |
| Merchandiser | Range planning, pricing, promotions | Bulk product updates, auto-tagging, SEO title/description generation |
| Content Creator | Brand voice, creative direction | Product descriptions, meta tags, alt text, blog content |
| Customer Service | Escalations, refunds, relationship calls | Order lookup, draft responses, return eligibility checks |
| Operations | Exception handling, carrier selection | Stock alerts, fulfilment routing, fraud flag review |
| Marketing Manager | Campaign strategy, budget | Coupon performance, customer segmentation, repeat purchase analysis |
WooCommerce REST API uses Basic Auth over HTTPS with Consumer Key + Consumer Secret.
Generate keys: WooCommerce → Settings → Advanced → REST API → Add key
# Environment variables
WC_URL="https://yourstore.com"
WC_KEY="ck_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
WC_SECRET="cs_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Basic Auth header
Authorization: Basic base64(WC_KEY:WC_SECRET)
Or pass as query params (less secure — avoid in production):
?consumer_key=ck_xxx&consumer_secret=cs_xxx
Base URL:
https://{store}/wp-json/wc/v3/{resource}
# List active products
GET /wp-json/wc/v3/products?status=publish&per_page=100
# Get single product
GET /wp-json/wc/v3/products/{id}
# Create product
POST /wp-json/wc/v3/products
{
"name": "Product Name",
"type": "simple", # simple | variable | grouped | external
"regular_price": "299.00",
"description": "...",
"short_description": "...",
"categories": [{"id": 12}],
"images": [{"src": "https://..."}],
"manage_stock": true,
"stock_quantity": 50
}
# Update product
PUT /wp-json/wc/v3/products/{id}
# Batch update (up to 100)
POST /wp-json/wc/v3/products/batch
{
"update": [{"id": 123, "regular_price": "199.00"}],
"delete": [456]
}
# List variations for a variable product
GET /wp-json/wc/v3/products/{product_id}/variations
# Update variation stock
PUT /wp-json/wc/v3/products/{product_id}/variations/{variation_id}
{ "stock_quantity": 25 }
# List open orders
GET /wp-json/wc/v3/orders?status=processing&per_page=50
# Statuses: pending | processing | on-hold | completed | cancelled | refunded | failed | trash
# Get single order
GET /wp-json/wc/v3/orders/{id}
# Update order status
PUT /wp-json/wc/v3/orders/{id}
{ "status": "completed" }
# Add order note
POST /wp-json/wc/v3/orders/{id}/notes
{ "note": "Dispatched via FastShip, tracking: FS123456", "customer_note": true }
# Create refund
POST /wp-json/wc/v3/orders/{id}/refunds
{
"amount": "50.00",
"reason": "Damaged in transit",
"line_items": [{"id": 1, "refund_total": 50.00}]
}
# List customers
GET /wp-json/wc/v3/customers?per_page=100&orderby=registered_date&order=desc
# Search by email
GET /wp-json/wc/v3/customers?email=user@example.com
# Customer object key fields:
{
"id": 42,
"email": "user@example.com",
"first_name": "...",
"last_name": "...",
"orders_count": 7,
"total_spent": "3450.00",
"date_created": "...",
"billing": { "address_1": "...", "city": "...", "country": "ZA" }
}
# Low stock report
GET /wp-json/wc/v3/reports/stock?type=lowstock
# Out of stock
GET /wp-json/wc/v3/reports/stock?type=outofstock
# Bulk stock update pattern (batch endpoint)
POST /wp-json/wc/v3/products/batch
{
"update": [
{"id": 101, "stock_quantity": 0, "stock_status": "outofstock"},
{"id": 102, "stock_quantity": 15}
]
}
# List coupons
GET /wp-json/wc/v3/coupons
# Create coupon
POST /wp-json/wc/v3/coupons
{
"code": "SAVE20",
"discount_type": "percent", # percent | fixed_cart | fixed_product
"amount": "20",
"usage_limit": 100,
"expiry_date": "2026-12-31",
"minimum_amount": "500.00"
}
# Sales summary (date range)
GET /wp-json/wc/v3/reports/sales?date_min=2026-01-01&date_max=2026-03-31
# Top sellers
GET /wp-json/wc/v3/reports/top_sellers?period=month
# Orders totals
GET /wp-json/wc/v3/reports/orders/totals
# Revenue by category — requires custom query or plugin; use orders endpoint + line_items
| Tool | Description |
|---|---|
wc_list_products | List products with filters (status, category, stock) |
wc_get_product | Full product detail including variations |
wc_update_product | Update price, stock, description, status |
wc_batch_update_products | Bulk price/stock changes (up to 100) |
wc_list_orders | List orders by status, date, customer |
wc_get_order | Full order detail with line items, shipping, notes |
wc_update_order_status | Move order through status lifecycle |
wc_add_order_note | Add internal or customer-visible note |
wc_list_customers | Customer list with spend and order count |
wc_get_customer_orders | All orders for a specific customer |
wc_sales_report | Revenue, orders, items for a date range |
wc_low_stock_report | Products below stock threshold |
wc_create_coupon | Generate promotional codes |
1. wc_list_orders(status=processing) → pending fulfilment count
2. wc_low_stock_report() → items needing reorder
3. wc_sales_report(period=yesterday) → revenue vs target
→ Draft morning summary for store owner
1. wc_get_product(id) → fetch existing product data
2. AI generates SEO-optimised description using name, category, attributes
3. wc_update_product(id, description, short_description, meta_data[seo])
1. wc_list_customers(last_active_before=90_days_ago)
2. Filter: orders_count >= 2, total_spent >= threshold
3. AI generates personalised re-engagement email per customer
4. wc_create_coupon(code=unique_per_customer) → attach to email
WooCommerce → WooCommerce Abandoned Cart Lite (or Metorik)
Webhook fires → AI drafts recovery email → send via Resend/Mailchimp
WooCommerce fires webhooks on key events. Configure at: WooCommerce → Settings → Advanced → Webhooks
| Topic | Trigger |
|---|---|
order.created | New order placed |
order.updated | Status change, note added |
order.deleted | Order trashed |
product.updated | Stock change, price update |
customer.created | New account registered |
Webhook payload is signed with X-WC-Webhook-Signature (HMAC-SHA256 of the body, keyed with the secret).
// Verify webhook in Cloudflare Worker
const sig = request.headers.get('X-WC-Webhook-Signature');
const body = await request.text();
const expected = btoa(
String.fromCharCode(...new Uint8Array(
await crypto.subtle.sign('HMAC', key, new TextEncoder().encode(body))
))
);
if (sig !== expected) return new Response('Unauthorized', { status: 401 });
?page=2&per_page=100. The X-WP-TotalPages response header tells you how many pages exist.variable product's stock lives on its variations, not the parent. Don't update stock on the parent.wc-awaiting-payment). Always check what statuses the store actually uses.https://store.com/wp-json/ to confirm the discovery endpoint resolves.GET /wp-json/wc/v3 returns 200 before assuming all endpoints exist.