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
- The AgentCart plugin generates WooCommerce REST API keys (consumer key + secret) on activation
- A 6-digit pairing code links the plugin to the merchant’s AgentCart account
- AgentCart stores the credentials and uses them for all catalog and checkout operations
Capabilities
| Capability | Implementation |
|---|---|
| Catalog search | WooCommerce REST API — GET /wp-json/wc/v3/products with search, pagination, and filtering |
| Product lookup | WooCommerce REST API — GET /wp-json/wc/v3/products/{id} |
| Checkout | Cart creation via custom plugin endpoint, returns WooCommerce checkout URL |
| Product sync | WooCommerce product webhooks (create, update, delete) push changes to AgentCart |
| Order tracking | Orders 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:
| Endpoint | Method | Auth | Purpose |
|---|---|---|---|
/wp-json/agentcart/v1/store-info | GET | Public | Store name, currency, product count, versions |
/wp-json/agentcart/v1/cart/create | POST | Basic Auth | Create cart with items, return checkout URL |
/wp-json/agentcart/v1/health | GET | Public | Connection status, plugin version |
UCP product mapping
WooCommerce products are mapped to UCP format:
| WooCommerce field | UCP field |
|---|---|
name | title |
description / short_description | description (HTML stripped) |
slug | handle |
permalink | url |
price | price_range.min / price_range.max (in minor units) |
images[].src | media[].url |
stock_status | availability (in_stock / out_of_stock) |
categories[].name | tags[] |
For merchants
See Connecting WooCommerce for the step-by-step setup guide.
Last updated on