Skip to main content

WooCommerce

Audience: Sales, management, support, engineering · Where in app: Settings → Integrations → WooCommerce · Plan availability: Pro (verify)

WooCommerce is the WordPress-based e-commerce option, serving the same purpose as Shopify: sync the store's product catalog into Knock Knock's RAG store so the AI agent can search and recommend products mid-conversation. It connects with a WooCommerce REST API key + secret rather than OAuth, and keeps the catalog fresh with REST webhooks.

What it does

  • One-time + ongoing sync of WooCommerce products → rag_products (ms-ai).
  • Webhook-driven updates for created/updated/deleted/restored products.
  • Powers the same AI product-recommendation experience as Shopify.
  • Order lookup for the AI agent — status, payment, and shipment tracking (see below).

How it works

Auth model: API key + secret. The admin pastes the WooCommerce REST API consumer key + consumer secret (from WP Admin → WooCommerce → Settings → Advanced → REST API) into Settings → Integrations → WooCommerce. Stored on the ms-ai integrations row (platform: "woocommerce", credentials: store_url, consumer_key, consumer_secret). The client (@woocommerce/woocommerce-rest-api, REST API v3) uses query-string auth.

Direction: inbound (read-only product sync).

What gets synced (per product → rag_products)

id, name, status, short_description, description, permalink, thumbnail, sku, price, price_html, regular_price, sale_price, stock_status, on_sale, date_on_sale_from/to, weight, dimensions, shipping_required, purchase_note, categories, tags, brands, attributes, and date_modified_gmt (change detection). Computed: product_price, price_type (ZERO / NUMERIC).

Differences from Shopify: WooCommerce category nesting is flattened to tags, and out-of-stock products can optionally be excluded. Products are embedded with the same model (text-embedding-3-small) into the shared rag_products table, scoped by (company, integration/platform).

Webhooks

Registered WooCommerce REST webhooks (all named with a KnockKnock: prefix for safe identification):

TopicEndpoint suffix
product.created/integrations/woocommerce/products/webhook/{integrationId}/created
product.updated/integrations/woocommerce/products/webhook/{integrationId}/updated
product.deleted/integrations/woocommerce/products/webhook/{integrationId}/deleted
product.restored/integrations/woocommerce/products/webhook/{integrationId}/restored

WooCommerce requires a publicly accessible webhook URL. On connect, the integration verifies read/write permissions by creating and deleting a throwaway test webhook. On removal, only webhooks whose delivery URL carries this integration's UUID marker are deleted (avoids touching another company's hooks).

AI agent usage

Identical to Shopify — the fetch_products_catalog tool runs a vector search over the same rag_products table scoped by (company_id, platform), and a successful lookup emits the product_search event.

Order lookup

Order lookup (GET orders/{order_number} via the same REST client, woocommerce.service.ts) returns billing/shipping, line items, and now also:

  • payment_method (payment_method_title), payment_status (paid/pending from date_paid), payment_date.
  • tracking — shipment tracking extracted from order meta_data written by tracking plugins (extractShipmentTracking), first match wins:
PluginMeta key
WooCommerce Shipment Tracking (official) / AST by Zorem / TrackShip_wc_shipment_tracking_items (shared key)
AfterShip_aftership_tracking_items (newer) or flat _aftership_tracking_number/_provider_name
YITH Order & Shipment Trackingywot_tracking_code / ywot_carrier_* / ywot_tracking_url
WooCommerce Shipping (Jetpack)wc_connect_labels (may be a JSON string; refunded labels skipped)

Configuration & options

ActionRoute
Create integrationPOST /integrations/woocommerce
Integration statusGET /integrations/:id (returns authentication, status, reason, webhooks, read/write permissions)
Remove (cleans up webhooks)DELETE /integrations/:id

Sync status (integrations.sync_status): pendingin_progresscompleted, with retry / failed.

Behaviors & edge cases

  • REST API not returning products: ensure WP REST API permalinks are enabled and the key has read scope on products.
  • Webhook not firing: WooCommerce sometimes silently fails webhooks under load — check WP error logs.
  • Data quality varies: third-party plugins inject inconsistent fields; "variations" product types may need explicit handling.
  • Large catalogs sync slowly over REST (a bulk endpoint is preferred where available).
  • Out-of-stock: can be excluded from sync (configurable).
  • Disconnect: removes the integration's products and de-registers its WooCommerce webhooks.

Plan & limits

  • Marked Pro in the knowledge base (verify exact tier gating).
  • Product count per company depends on plan; re-embedding consumes AI credits.

Technical implementation

  • Owning service: ms-aisrc/integrations/rag/woocommerce/woocommerce.service.ts, woocommerce.controller.ts. Shared product store/search in src/integrations/rag/rag-product/.
  • Status helpers: getWooCommerceStatus(), getWooReadWritePermissions(); cleanup removeWebhooks().
  • Env: WEBHOOK_API_KEY (webhook security key for backend communication).
  • See Knowledge Base & RAG.

What Nox can tell you

  • Connection status, product count, last sync.
  • The same product-search analytics as Shopify.