-
-
AI-assisted planning turns a brief into a $411 basket for three employees, within the $450 budget. Buyer approval is required.
-
A headset price increase raises the total to $486. BriefBuy blocks checkout and clears approval because the $450 budget is exceeded.
-
BriefBuy finds a $441 replacement, highlights changed items, and requires fresh approval while keeping the original $450 budget.
-
The $441 replacement is paid through PayPal Sandbox. Server verification confirms payment completion. No real money is charged.
Inspiration
An AI shopping assistant can recommend a basket, but what happens when its prices change after you approve it?
I built BriefBuy around that moment. A buyer’s budget and approval should remain meaningful even when the purchasing plan changes.
What it does
BriefBuy turns a plain-language request into a proposed equipment basket with a spending limit and explicit requirements.
For example: “Equip three employees with a keyboard, mouse and headset each. Keep the entire order under $450.”
The buyer reviews the basket and approves its exact contents. If a simulated price or stock change makes that basket invalid, BriefBuy blocks checkout, clears the approval, and finds a replacement under the original rules. The replacement needs fresh approval.
PayPal Sandbox handles checkout, and the server verifies the payment result before displaying a completed purchase.
The defining demo
Our deployed demo shows this sequence:
- A complete basket for three employees costs $411.
- The buyer approves that basket.
- A simulated headset price increase raises its current cost to $486, exceeding the $450 limit.
- BriefBuy blocks checkout and clears the previous approval.
- The planner finds a $441 replacement, leaving $9.
- The buyer must approve the replacement before continuing to payment.
This demonstrates the core idea: approval belongs to an exact basket, not an open-ended permission to spend.
How I built it
The interface uses React and TypeScript with Vinext. Cloudflare Workers runs the server, and Cloudflare D1 stores purchases and their event history.
Meta Muse Spark 1.3 interprets purchase briefs and generates explanations. A deterministic server-side planner checks the catalogue and enforces quantities, equipment requirements, wireless preferences, and the total budget—including shipping. AI output is validated before it becomes a purchasing contract.
PayPal Orders API v2 creates and captures sandbox orders. Server-side checks validate the order reference, currency, amount, and completed capture before recording payment success. Returning from PayPal alone is not treated as proof of payment.
Challenges
The hardest part was keeping the brief, basket, approval, and payment consistent.
A price change must invalidate an outdated approval. A replacement must obey the original budget. A payment must match the purchase that was actually approved. BriefBuy makes these separate states explicit and checks them on the server.
Another challenge was making AI explanations understandable without letting generated text become the authority for prices or payment status.
Accomplishments
- Deployed a working application with persistent purchase records.
- Demonstrated AI-assisted basket creation and verified PayPal Sandbox checkout.
- Demonstrated approval invalidation and budget-respecting repair on the hosted application.
- Passed 26 automated tests covering planning rules, provider handling, API behaviour, and payment verification.
- Added a progress indicator, clearer budget information, and visible explanations of changed products.
What I learned
I learned how to combine AI interpretation with deterministic validation, implement PayPal’s order and capture flow, and manage purchase state across browser redirects and persistent storage.
The central lesson was that an AI recommendation and permission to spend are different things. A useful purchasing assistant needs both a flexible planner and explicit checks around approval and payment.
Demo scope and next steps
BriefBuy currently uses a fictional equipment catalogue, simulated price and stock changes, and PayPal Sandbox. No real goods are ordered and no real money is charged. Product quality scores are demo values.
Next steps include merchant catalogue integrations, stronger account management, broader accessibility testing, and support for more purchasing requirements.
Built With
- cloudflare-d1
- cloudflare-workers
- css
- meta
- paypal
- react
- typescript
- vinext
- vite

