PayPal AI Hackathon 2026
Crumb
Tonight's surplus food, paid only on handover.
- Next.js
- TypeScript
- PayPal Orders v2 & Vault v3
- Gemini
- MCP
- Postgres
Holdnot charge: PayPal authorise, then partial capture
MCPAI buyer agents with spending mandates
Problem
Small bakeries and cafés don't have time to list leftovers item by item at closing, so most of it is binned. Surplus-food apps lose trust when bags come up short and buyers chase refunds.
Approach
- Snap to list: the owner photographs the counter; Gemini counts items, flags allergens, groups rescue bags and suggests a price, clamped in code to the shop's floor. Nothing goes live until the owner publishes.
- Reserving places a PayPal hold (Orders v2, intent AUTHORIZE). At pickup, staff photograph the open bag, AI proposes a partial capture for what's actually there, a person confirms, and the rest is released.
- If a shop runs out, one tap voids every hold, so there's nothing to refund.
- Buyers can let an AI assistant shop for them within a mandate (per-bag cap, weekly budget, distance, diet), through an MCP server or the built-in agent.
Architecture
- Next.js 16 with a JSON API, an MCP server and a verified PayPal webhook.
- PayPal Orders v2, Payments v2 (capture, void), Vault v3 and the JS SDK, with idempotency keys on every write.
- Gemini vision with JSON schemas and a deterministic mock, so the whole app runs offline.
- Postgres with Drizzle; a public audit trail of every hold, charge, release and agent refusal.
Decisions
AI counts, code decides money
The model only counts what's in a photo; amounts are computed in code from the listing and confirmed by a person before PayPal is called.
Refusals are logged too
When an agent won't buy (“Not vegan — contains dairy”, “weekly budget used”), the reason lands in the audit trail.
My role
Built for the PayPal AI Hackathon 2026. PayPal sandbox only; no real money moves.