Skip to content
UCP
Menu

WooCommerce · Technical Guide

WooCommerce + UCP: complete integration guide

WooCommerce powers approximately 30% of all online stores, making it the most important non-Shopify platform for UCP adoption. Unlike Shopify, WooCommerce doesn't have native UCP support built in. But its extensible REST API and active plugin ecosystem make integration achievable for most merchants without heavy custom development.

Updated : April 2026 · Primary query : WooCommerce UCP implementation

Option 1: UCP plugin (recommended for most merchants)

The simplest path for WooCommerce merchants is a dedicated UCP plugin. Several were published to the WordPress plugin repository in Q1 2026. These plugins automatically expose UCP-compliant REST endpoints using your existing WooCommerce product data, inventory, and order management, no custom code required.

What a UCP plugin typically handles: catalog endpoint generation from WooCommerce product catalog, inventory sync from WooCommerce stock management, checkout routing to your existing payment gateway via AP2 wrapper, and order creation in WooCommerce admin from agent purchases.

Before installing, verify the plugin: has active maintenance, is compatible with your WooCommerce version, supports the AP2 payment flow for your payment processor, and ideally has UCP certification testing built in.

Option 2: Custom REST API implementation

Merchants with developer resources who want full control can build UCP endpoints directly using the WooCommerce REST API as the backend. WooCommerce exposes its own REST API at /wp-json/wc/v3/, your UCP layer translates between the WooCommerce API format and the UCP specification.

Catalog endpoint

Your GET /ucp/v1/catalog endpoint should query the WooCommerce products API and transform the response to UCP format. The key field mapping:

  • WooCommerce id → UCP id
  • WooCommerce name → UCP name
  • WooCommerce description (stripped of HTML) → UCP description
  • WooCommerce regular_price → UCP price
  • WooCommerce currency → UCP currency
  • WooCommerce stock_status (instock/outofstock) → UCP availability (InStock/OutOfStock)
  • WooCommerce categories[0].name → UCP category (mapped to UCP taxonomy)

Sample PHP endpoint registration

add_action('rest_api_init', function() {
  register_rest_route('ucp/v1', '/catalog', array(
    'methods'  => 'GET',
    'callback' => 'ucp_get_catalog',
    'permission_callback' => 'ucp_verify_agent_cert',
  ));
});

function ucp_get_catalog($request) {
  $wc_products = wc_get_products(array(
    'status' => 'publish',
    'limit'  => $request->get_param('limit') ?: 50,
    'page'   => $request->get_param('page') ?: 1,
  ));
  $ucp_products = array_map('map_wc_to_ucp', $wc_products);
  return rest_ensure_response(array(
    'products' => $ucp_products,
    'total'    => wp_count_posts('product')->publish,
  ));
}

Payment integration: connecting AP2

The payment layer requires your WooCommerce payment gateway to support AP2 token processing. For Stripe (the most common WooCommerce payment processor): install the Stripe AP2 extension for WooCommerce (available via Stripe's plugin library), configure your AP2 merchant token in Stripe Dashboard → Agentic Commerce, and update your UCP checkout endpoint to pass AP2 tokens to Stripe's AP2 payment intent API.

For other processors (Adyen, PayPal, Square): contact your processor for their WooCommerce + AP2 integration guide. All UCP-coalition payment processors have published WooCommerce integration documentation.

Inventory sync: keeping data fresh

A common issue with WooCommerce UCP implementations is stale inventory data. WooCommerce does not natively push stock changes to external APIs, your UCP endpoints must pull current stock on each request. For high-traffic stores, add a caching layer (Redis or WordPress Transients API) with a maximum 15-minute TTL. For lower-traffic stores, query WooCommerce stock directly on each UCP request, the overhead is typically acceptable.

Testing your implementation

Before registering your endpoint, validate with these steps:

  1. Test catalog endpoint: curl -H "Authorization: Bearer [test-token]" https://yourstore.com/ucp/v1/catalog, verify response matches UCP schema
  2. Test availability endpoint for a specific product ID, verify real-time stock reflection
  3. Run a test checkout with the UCP sandbox mode, verify order appears in WooCommerce admin
  4. Run the official UCP test suite (ucp.dev/testing) against your staging site
  5. Check response times, all endpoints should respond within 3 seconds

Registering your WooCommerce store

Once tested, register your UCP endpoint at ucp.dev/merchant-registry. You'll need: your store URL, your UCP endpoint base URL, your AP2 merchant token, and your UCP certification test results. After registration, submit your endpoint URL to Google Merchant Center under Agentic Commerce settings to enable Gemini discovery.

Further reading