-
-
Welcome modal introducing Coco, the AI barista. Explains human-in-the-loop payment: AI prepares the cart, user approves in PayPal.
-
Home page: "AI prepares the order. You control the money." 3-step flow — AI Barista, Spending Mandate, PayPal Checkout.
-
AI Barista with graceful fallback: When AI models are at capacity, a rule-based planner still builds a valid, server-checked cart.
-
User Profile: Dietary preferences, allergen concerns, and scoped spending allowances. Server-enforced limits protect every checkout.
-
Cart with server-enforced spending allowance. Users set limits the AI cannot exceed. PayPal approval required above threshold.
-
Cart review: Server-enforced policy checks, AI Transaction Passport explaining why the cart was built, and clear approval flow.
-
Transparent checkout flow (AI → Server → You → PayPal → Server). "Take it home" suggests external retailers via Channel3 integration.
-
Split Bill: Each person pays their own share via PayPal. QR code invites expire in 1 hour. Spending limit checked before split.
-
Agent Control Center: KPIs ( orders, AI-assisted, block rate), Ops Copilot (read-only PayPal), refund queue, and operational status.
-
Per-session spending policies (max €20/order, €100/day) and split-bill tracking: real-time status of shared payments across sessions.
-
AG Grid orders table with CSV/JSON export. Policy events log: AUTO_ALLOW vs REQUIRE CONFIRMATION decisions with full audit trail.
-
7-day rolling pickup schedule and agent activity summary: 100 carts checked, 5 blocked, €401.35 captured. Wellbeing Guard allergen decisions
-
Allergen guard audit (fail-closed: unverified allergens block checkout). Disputes module: merchant-controlled case files synced with PayPal.
-
"For cafés" page: 7-step setup path for café owners (PayPal Business, webhooks, credentials) and live deployment readiness checklist.
-
Café benefits: AI-prepared orders, human-in-the-loop refunds, split bills, dispute evidence. Interactive ROI calculator for café owners.
Inspiration AI agents are starting to shop for us, but an agent that can talk is helpful and an agent that can spend your money is scary. We wanted to show that agentic commerce works when the boundary is built into the system: the AI prepares, the human approves, PayPal pays.
What it does AI Café is a conversational café assistant (web storefront + Flutter app, one backend).
- Barista agent: describe what you want ("I want a lunch for around 12 euros"). The agent searches the real menu with tool calls and prepares a cart. It has no payment tool.
- Server-side policy gate: prices, per-purchase caps, daily limits and confirmation thresholds are enforced on the server and shown as allowed / needs confirmation / blocked.
- Scoped AI allowances: the shopper can give the agent a small allowance (for example €5 a day). Checkout re-checks it on the server and fails closed if it cannot be verified.
- Wellbeing guard and honest allergy notes: dietary preferences guide server-side catalog discovery; allergen notes are always shown as unverified, never as "safe".
- Human approval in PayPal Sandbox: orders follow create → buyer approval → capture, with idempotency keys and webhook signature verification.
- Trust layer: every order carries a signed Cart Mandate (who held payment authority), a dispute evidence package anyone can verify, and an order page built from the server record. Refunds are requests that need an authenticated merchant approval; nothing is automatic.
- Merchant Agent Control Center: an AG Grid dashboard with orders, policy decisions, refund queue, filters and CSV/JSON export.
- For other agents: an MCP server and
/.well-known/agent-commerce.jsonlet external agents search, prepare and track, but never pay, capture or refund. - Split Bill: the server computes every share. An organiser can always see why a bill can or cannot be closed; a checkout that was started but never captured is discarded only after the server asks PayPal for proof that no capture exists. A share that was actually paid is never erased — it needs a café-approved refund.
- Channel3 "Take it home": read-only retailer suggestions on the cart that open the retailer's own page. They are never in the PayPal cart, never covered by an allowance and cannot be bought through this app.
How we built it TypeScript/Express backend, vanilla-JS storefront (strict CSP) and a Flutter client, PostgreSQL for durable orders, PayPal Orders v2 and refunds in the free Sandbox, a multi-provider LLM layer (Gemini and Groq live, with OpenRouter, Cerebras and OpenAI in the code fallback chain), and a truthful rule-based planner when no model is reachable. One design-token file feeds both web and Flutter. The backend has 141 Jest suites / 1361 tests, all passing on 2026-11-07 (PayPal and AI mocked); the Sandbox purchase flow was run end to end on the deployed app on 2026-10-27, and order creation plus the no-money Split Bill cancellation path were re-verified there on 2026-11-07/08.
Challenges
- Making "the agent cannot pay" a property of the architecture, not a prompt: no AI pathway can approve a capture or a refund.
- Keeping server and client consistent: scope handling, order details and receipts all come from one server record, so the UI can never show a different product than was bought.
- Free-tier AI providers go down; the labelled fallback keeps the flow honest.
- Giving an organiser a safe way out of a Split Bill: a PayPal checkout can be started and abandoned, so we had to prove with PayPal that no capture happened before cancelling anything.
What we learned Trust features (mandates, evidence, fail-closed scopes) are what make agentic payments believable. Idempotency and signature checks matter more than the model.
What's next Live webhook-replay and refund evidence on the Sandbox, validation against a real PayPal dispute lifecycle, and merchant onboarding for businesses beyond one café.
Honest scope PayPal Sandbox only; live money cannot be configured. One deployment serves one merchant. The "e-invoice" is an itemised order record, not a tax invoice. The Cart Mandate is our own Ed25519-signed audit format, not AP2 or an official PayPal Agent Ready integration. Webhook replay and partial refunds are not recorded as verified on this build.
Built With
- ag-grid
- apimatic
- channel3
- dart
- express.js
- flutter
- gemini
- groq
- javascript
- jest
- model-context-protocol
- node.js
- openai-api
- openapi
- openrouter
- paypal
- paypal-orders-api
- paypal-sandbox
- postgresql
- postman
- render
- typescript