---
title: "Abilities API"
description: "CognitiveCart Abilities API: list-products, get-cart-summary, add-to-cart, update-item, remove-item, apply-coupon, get-checkout-url, create-checkout-session. REST endpoints for AI agents."
url: "https://docs.cognitivecartplugin.com/features/abilities-api/"
---
## 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.
