Inspiration
AI shopping agents can misunderstand a budget or propose an over-budget cart. PayBoard separates AI recommendations from payment authorization.
What it does
A real AI model proposes a cart from a natural-language request. The shopper reviews it, and a deterministic state machine checks the server-side catalog, budget, actor permissions, and locked checkout amount. The buyer approves in PayPal Sandbox. The server verifies approval and amount before capture. PayBoard shows the Order ID, Capture ID, and per-session audit history.
Demo
At 00:16–00:36, the AI proposes a $4.50 latte and a $3.80 croissant, totaling $8.30 against an $8 budget. PayBoard blocks checkout even after the human accepts the suggestion. Swapping in a $3.50 Americano brings the total to $7.30 and enables checkout. PayPal Sandbox then returns real Sandbox order and capture IDs.
How we built it
TypeScript on Cloudflare Workers, Durable Objects for per-visitor state, and Cloudflare Workers AI (Gemma 4) for structured proposals. The PayPal JavaScript SDK handles buyer approval. The PayPal Orders v2 REST API creates, verifies, and captures orders. The backend computes prices and uses stable idempotency request IDs. GitHub Actions runs type checks, state-machine tests, and mocked end-to-end payment tests.
Challenges and lessons
Separating AI suggestions, human cart acceptance, checkout locking, buyer approval, and server capture clarified who has authority at each stage. Disabling unnecessary extended reasoning brought the observed demo response to approximately 1.3 seconds. The over-budget model suggestion showed that the budget guardrail works independently of the AI. Non-model fallbacks are labeled.
How to try it
Open the live demo and enter an $8 coffee or breakfast request. Accept or edit the cart, exceed the budget, and check that checkout remains blocked until corrected. Inspect the event history. To complete a test payment, use your own PayPal Developer Personal Sandbox buyer login. This is a Sandbox-only project with a bounded per-session event log.
What's next
Merchant and catalog integrations, stronger reconciliation, accessible audit exports, and production-grade fraud controls.
Built With
- cloudflare
- durable
- gemma
- workers