WooCommerce Integration Guide

This guide explains integrating with WooCommerce REST API (WP REST + WooCommerce endpoints).

Credentials

  • WOOCOMMERCE_CONSUMER_KEY
  • WOOCOMMERCE_CONSUMER_SECRET
  • WOOCOMMERCE_STORE_URL (e.g., https://shop.example.com)

Example: fetch products

const res = await fetch(`${WOOCOMMERCE_STORE_URL}/wp-json/wc/v3/products?consumer_key=${KEY}&consumer_secret=${SECRET}`);
const products = await res.json();

Webhooks and verification

  • WooCommerce webhooks may be signed depending on the plugin; verify the request origin and payload.
  • Always respond with 200 quickly and process in background.

Mapping variants and attributes

  • WooCommerce products include variations which must be normalized to your internal Product/Variant model.

Rate limits & caching

  • Some self-hosted stores may be slow: use caching and retries. Avoid blocking chat responses on live store lookups; prefer cached results and background refresh.