Stripe Connect & Checkout
When Stripe is connected, CognitiveCart can create Stripe Checkout sessions for AI-facilitated purchases and record transactions (Chat vs Agent source).
When Stripe is connected#
Until you connect Stripe, the UCP manifest and Abilities API still expose discovery and cart abilities (list products, add to cart, get cart summary, etc.). Only checkout requires Stripe. Once connected:
- The UCP manifest includes checkoutCreateSessionEndpoint and checkoutCompleteUrlTemplate.
- Agents (or your chat UI) can call get-checkout-url (session-based cart) or create-checkout-session (line items for third-party agents) to get a Stripe Checkout URL.
- The customer completes payment in their browser; Stripe redirects back to your site where CognitiveCart completes the order and marks it as paid.
- Transactions can be logged with a source (e.g. Chat vs Agent) for reporting.
Checkout session creation#
Two flows are supported:
- Session-based (get-checkout-url) — The visitor has a WooCommerce session and a cart. The API creates a Stripe Checkout session for that cart and returns the redirect URL. Used when the purchase originates from your site or chat.
- Line-items (create-checkout-session) — The agent sends
line_items(name, amount_total in cents, quantity) plussuccess_urlandcancel_url. No WooCommerce session is required. Used by third-party AI agents (e.g. Claude, ChatGPT) that don’t share your session.
In both cases, the user is sent to Stripe Checkout; after payment, Stripe redirects to the completion URL. CognitiveCart’s completion endpoint creates or updates the order and marks the payment as completed.
Worker URL#
Stripe Connect and checkout are coordinated via a CognitiveCart Worker (hosted by Gaucho Plugins by default). The plugin uses COGNITIVE_CART_WORKER_URL to talk to the Worker. You can override this in wp-config.php if you run your own Worker:
define( 'COGNITIVE_CART_WORKER_URL', 'https://your-worker.example.com' );
If the Worker URL is not set or the Worker is unreachable, Connect and checkout will not work; discovery and cart abilities are unaffected.
Connectivity tab#
In the WordPress admin, go to CognitiveCart → Connectivity. From there you can:
- Start the Stripe Connect OAuth flow to connect your Stripe account.
- See connection status and disconnect if needed.
After connecting, the UCP manifest will include the checkout endpoints and agents can create checkout sessions (subject to your Kill-Switch and any other restrictions).