Skip to Content

WooCommerce

AgentCart connects to WooCommerce stores via the WooCommerce REST API. The AgentCart WordPress plugin handles credential generation and pairing automatically.

How the connection works

  1. The AgentCart plugin generates WooCommerce REST API keys (consumer key + secret) on activation
  2. A 6-digit pairing code links the plugin to the merchant’s AgentCart account
  3. AgentCart stores the credentials and uses them for all catalog and checkout operations

Capabilities

CapabilityImplementation
Catalog searchWooCommerce REST API — GET /wp-json/wc/v3/products with search, pagination, and filtering
Product lookupWooCommerce REST API — GET /wp-json/wc/v3/products/{id}
CheckoutCart creation via custom plugin endpoint, returns WooCommerce checkout URL
Product syncWooCommerce product webhooks (create, update, delete) push changes to AgentCart
Order trackingOrders initiated by AI agents are tagged with agentcart_session_id in order meta

Authentication

AgentCart authenticates to the WooCommerce REST API using HTTP Basic Auth with the consumer key and secret generated by the plugin. These credentials have read_write scope.

Plugin endpoints

The AgentCart plugin registers three custom REST endpoints on the WordPress site:

EndpointMethodAuthPurpose
/wp-json/agentcart/v1/store-infoGETPublicStore name, currency, product count, versions
/wp-json/agentcart/v1/cart/createPOSTBasic AuthCreate cart with items, return checkout URL
/wp-json/agentcart/v1/healthGETPublicConnection status, plugin version

UCP product mapping

WooCommerce products are mapped to UCP format:

WooCommerce fieldUCP field
nametitle
description / short_descriptiondescription (HTML stripped)
slughandle
permalinkurl
priceprice_range.min / price_range.max (in minor units)
images[].srcmedia[].url
stock_statusavailability (in_stock / out_of_stock)
categories[].nametags[]

For merchants

See Connecting WooCommerce for the step-by-step setup guide.

Last updated on