Abilities API
CognitiveCart registers store capabilities for AI agents. The UCP manifest points to the abilities endpoint; agents call the corresponding REST routes under cognitive-cart/v1.
Overview#
The Abilities API lets AI agents discover what your store can do and then execute those actions via REST. The manifest at /.well-known/ucp includes abilitiesEndpoint (e.g. /wp-json/cognitive-cart/v1/abilities). A GET to that URL returns the list of abilities with IDs, labels, descriptions, and input schemas.
Abilities list#
The following abilities are registered by CognitiveCart. Each maps to a REST route under the cognitive-cart/v1 namespace.
| Ability | Description |
|---|---|
| list-products | Query the product catalog. Optional product_id returns full details for one product. |
| get-cart-summary | Get a short text summary of the current cart contents. Requires an active WooCommerce session. |
| add-to-cart | Add a product to the cart by product_id, optional quantity and variation_id for variable products. |
| empty-cart | Remove all items from the cart. |
| remove-item | Remove an item by cart_item_key or product_id. |
| update-item | Set quantity for a cart item (by cart_item_key or product_id). Use quantity 0 to remove. |
| apply-coupon | Apply a coupon code to the cart. |
| remove-coupon | Remove a coupon from the cart by code. |
| get-checkout-url | Get a Stripe Checkout URL for the current cart. Requires WooCommerce session and Stripe Connect. Returns redirect URL. |
| create-checkout-session | Create a Stripe Checkout session with line_items (name, amount_total in cents, quantity). For third-party agents with no session. Requires success_url, cancel_url. Optional source for attribution (e.g. agent:Claude). |
| get-chat-context | Get cart summary, product inventory, and current product status for AI chat context. Optional product_id for in-cart status of a product. |
REST base#
All CognitiveCart REST routes live under:
/wp-json/cognitive-cart/v1/
Examples: GET .../abilities, GET .../products, POST .../cart/add, POST .../checkout/create-session. The exact paths and methods are defined by the plugin; the abilities endpoint returns the list and descriptions so agents can build requests correctly.
get-checkout-url and create-checkout-session require Stripe Connect to be configured. Without Stripe, discovery and cart abilities still work; only checkout is unavailable.