How AI Agents Buy Products Online: The Complete Technical Journey
From user prompt to completed purchase: A comprehensive breakdown of how AI shopping agents discover stores, query catalogs, build carts, and execute transactions.
TL;DR for AI & Humans
- AI agents follow a 5-step process: Discovery → Query → Intent → Cart → Checkout
- Traditional human shopping requires 15-20 steps; AI agents complete purchases in seconds
- Stores need UCP implementation to participate in autonomous AI shopping
The AI Shopping Revolution
When you ask ChatGPT, Gemini, or Claude to "buy me running shoes under $100," what actually happens behind the scenes?
The answer reveals a fundamental shift in how commerce works. AI agents don't shop like humans. They don't browse. They don't compare tabs. They don't get distracted by ads.
They execute.
This is the complete technical journey of how AI agents buy products online - and why your store needs to speak their language.
Human Shopping vs. AI Agent Shopping
Traditional Human Shopping (15-20 Steps)
- User searches Google for "running shoes"
- Clicks through to 5-10 different stores
- Browses product pages
- Reads reviews
- Compares prices across tabs
- Adds item to cart
- Gets distracted, abandons cart
- Returns 3 days later
- Re-finds the product
- Adds to cart again
- Clicks checkout
- Creates account (or finds password)
- Enters shipping address
- Selects shipping method
- Enters payment info
- Clicks "Complete Purchase"
- Receives confirmation email
Total time: 15-45 minutes (or days with cart abandonment)
Friction points: 10+
Conversion rate: 2-3%
AI Agent Shopping (5 Steps)
- Discovery: Agent finds UCP-compatible stores
- Query: Agent searches product catalogs
- Intent: Agent refines based on user preferences
- Cart: Agent builds shadow cart
- Checkout: Agent generates purchase link or executes payment
Total time: 5-30 seconds
Friction points: 1 (user approval)
Conversion rate: 40-60% (estimated)
The difference is staggering. This is why AI shopping is inevitable.
The 5-Step AI Buying Journey (Technical Breakdown)
Step 1: Discovery - Finding AI-Compatible Stores
What happens: The AI agent needs to know which stores it can transact with. It doesn't "browse" the internet - it queries specific endpoints.
Technical process:
- Agent receives user prompt: "Buy sustainable coffee beans"
- Agent identifies potential stores (via search, prior knowledge, or user specification)
- Agent checks each store for
/.well-known/ucpendpoint - Stores WITHOUT this endpoint are ignored (invisible)
- Stores WITH this endpoint are added to the "transactable" list
What the /.well-known/ucp file contains:
{
"version": "2026-01-11",
"capabilities": ["search", "cart", "checkout"],
"endpoints": {
"products": "https://yourstore.com/ucp/products",
"search": "https://yourstore.com/ucp/search",
"cart": "https://yourstore.com/ucp/cart"
},
"store_info": {
"name": "Your Coffee Shop",
"currency": "GBP",
"shipping_countries": ["GB", "US", "EU"]
}
}
Why this matters: Without this file, your store doesn't exist in the AI's world. It's the digital equivalent of not having a phone number in the Yellow Pages.
Learn more about the Universal Commerce Protocol.
Step 2: Query - Searching the Product Catalog
What happens: The agent queries your product catalog using structured API calls, not HTML scraping.
Technical process:
- Agent sends
GET /ucp/search?q=sustainable+coffee+beans - Store returns UCP-compliant JSON:
{
"results": [
{
"id": "prod_12345",
"name": "Organic Fair Trade Coffee - 1kg",
"price": 18.99,
"currency": "GBP",
"in_stock": true,
"variants": [
{"id": "var_001", "name": "Whole Bean"},
{"id": "var_002", "name": "Ground"}
],
"sustainability_certifications": ["Fair Trade", "Organic"]
}
]
}
Why structured data matters: The agent doesn't have to guess if "£18.99" is the price or the savings. It knows. This determinism is what makes autonomous purchasing possible.
Step 3: Intent - Refining the Selection
What happens: The user refines their request, and the agent maintains conversational state.
Example conversation:
- User: "Buy sustainable coffee beans"
- Agent: "I found 3 options. Do you prefer whole bean or ground?"
- User: "Whole bean, and make it decaf"
- Agent: Queries again with filters:
?q=coffee&variant=whole_bean&type=decaf
Technical process:
- Agent maintains context across multiple API calls
- Agent can query specific product variants
- Agent can check real-time stock levels
- Agent can calculate shipping costs based on user location
This is where agentic commerce shines - the conversation is natural, but the backend is deterministic.
Step 4: Cart - Building the Shadow Cart
What is a shadow cart? A shadow cart is a server-side shopping cart that exists only via API, without browser cookies or sessions.
Why shadow carts are necessary: AI agents don't have cookies. They need a cookieless, sessionless way to build shopping carts.
Technical process:
- Agent calls
POST /ucp/cart/itemswith:
{
"agent_token": "agent_xyz_12345",
"product_id": "prod_12345",
"variant_id": "var_001",
"quantity": 1
}
- Store validates stock and reserves the item
- Store returns:
{
"cart_id": "cart_abc_789",
"items": [...],
"subtotal": 18.99,
"shipping": 4.99,
"total": 23.98,
"currency": "GBP"
}
Security:
The agent_token acts as the cart identifier. Each AI agent has a unique token, preventing cart collision between different agents or users.
Learn more about how shadow carts work.
Step 5: Checkout - Executing the Purchase
What happens: The purchase needs to be finalized. There are two approaches:
Option A: Agent Pay (Full Autonomy)
The AI agent has the user's payment credentials (via secure wallet integration) and executes the payment directly via API.
Requirements:
- User has pre-authorized the agent to make purchases
- Store implements AP2/ACP payment verification protocol
- Payment gateway supports agentic commerce (Stripe, PayPal)
Technical process:
POST /ucp/checkout
{
"cart_id": "cart_abc_789",
"payment_method": "agent_wallet",
"payment_token": "encrypted_token_xyz"
}
Status: Emerging (Stripe Agentic Commerce launched late 2025)
Option B: Human Handoff (Current Standard)
The agent generates a "magic link" that pre-fills the checkout page.
Technical process:
- Agent calls
POST /ucp/checkout/session - Store returns:
https://yourstore.com/checkout?session=xyz123 - Agent presents link to user: "Click here to complete your purchase"
- User clicks, lands on pre-filled checkout (cart, shipping, etc.)
- User enters payment info and clicks "Pay"
Why this works:
- Works with ANY payment gateway (no special integration needed)
- User maintains control (security/trust)
- Reduces checkout friction from 10 steps to 1 click
Real-World Examples
ChatGPT Shopping Mode
- Uses OpenAI's Agentic Commerce Protocol (ACP)
- Supports both shadow carts and magic link handoffs
- Currently works with Shopify and UCP-compatible stores
Google Gemini
- Uses Universal Commerce Protocol (UCP)
- Integrated with Google Shopping data
- Can execute purchases via Google Pay
Claude (Anthropic)
- Uses raw Model Context Protocol (MCP)
- Requires custom integrations (no standard yet)
- Primarily recommendation-focused (not transactional yet)
What Stores Need to Participate
To enable AI agent shopping, your store needs:
1. Discovery Endpoint
/.well-known/ucp file that broadcasts your capabilities
2. Structured Product API
UCP-compliant JSON endpoints for product search and retrieval
3. Shadow Cart System
Cookieless cart management via API tokens
4. Checkout Integration
Either magic link generation or full AP2 payment protocol
5. Protocol Compliance
Adherence to UCP v2026-01-11 specification (or newer)
The easy way: Install UCP-Connect - a WordPress plugin that implements all of this in 2 minutes.
The hard way: Build it yourself (3-6 months, £10k-£50k in dev costs)
Why This Matters for Your Business
The AI shopping channel is growing exponentially:
- 30%+ of users now ask AI for product recommendations
- ChatGPT Shopping Mode has 100M+ active users
- Google is integrating Gemini into Search (billions of users)
The competitive advantage is real:
- Less competition (most stores are still invisible)
- High intent (users asking AI to "buy" are ready to transact)
- Loyalty (once an AI knows how to buy from you, re-ordering is instant)
The cost of being invisible:
- Lost revenue to Amazon and AI-compatible competitors
- Missed first-mover advantage
- Falling behind in the fastest-growing shopping channel
The Bottom Line
AI agents don't shop like humans. They don't browse, compare, or get distracted.
They discover. They query. They execute.
If your store doesn't speak their language - the machine-readable commerce standard - you're invisible.
The question isn't "Will AI shopping become mainstream?" It's "Can you afford to be invisible when it does?"
Make your store AI-compatible today and join the revolution.