Inspiration
What it does
Checkout is still a form-filling chore: search ten tabs, compare prices, re-type your details. Meanwhile AI agents can act, and PayPal moves money. We wanted the shortest path between "I want wireless earbuds under $60" and a paid order — a conversation, not a checkout form. PayPal's own agentic-commerce push made this the obvious hackathon build. What it does Checkout Agent is a chat UI powered by a Gemini function-calling agent: You describe what you want in plain words ("find me wireless earbuds under $60", or "put together a fitness gift bundle under $100"). The agent searches the product catalog, recommends options with exact prices, and — only after you confirm — creates a PayPal order (Orders v2, intent=CAPTURE). You approve on PayPal's hosted page (sandbox for the demo); the server captures the payment and the chat shows a receipt with the capture ID. Bundles: ask for a gift set and the agent assembles 2–4 products under your budget into a single PayPal order with an itemized breakdown — one payment, one receipt. All money operations happen server-side; the browser never sees secrets or amounts. Every demo dollar is PayPal sandbox money. How we built it Agent: Google Gemini (gemini-3.8-flash) with function calling — a small explicit tool loop (no black-box framework), tools: search_catalog, create_paypal_order, check_order_status, capture_paypal_order. Payments: PayPal REST — POST /v1/oauth2/token, POST /v2/checkout/orders (with item breakdown + idempotency keys), POST /v2/checkout/orders/{id}/capture. Approval via PayPal's hosted approve URL; return_url handler captures on redirect. Stack: Python, FastAPI, vanilla JS chat UI (no build step), 12-product JSON catalog. AI-assisted build: scaffolded and iterated with AI coding assistance (allowed by the rules). Challenges we ran into Sandbox ≠ real PayPal: approving a test order requires separate sandbox test accounts — your real login doesn't exist there. Cost us 20 confused minutes. Model churn: the Gemini model name we started with was retired mid-build; the API error message itself told us the replacement. Agent loop discipline: the first bundle attempt sent the model into an endless re-search spiral (AND-matching returned empty). Fixed with ranked OR-matching, a 2-search limit, and a forced closing reply. Accomplishments that we're proud of A real end-to-end purchase in the PayPal sandbox: agent → order → human approval → capture COMPLETED ($49.99), plus a 2-item bundle order ($99.98) — verified via the PayPal API, not mocked. The bundle flow: one conversation, one PayPal order, itemized receipt. That's the agentic-commerce moment. What we learned PayPal's Orders v2 flow (create → approve → capture) maps perfectly onto an agent's tool loop: the agent's "hands" are just API calls, and the human stays in control at the approval step — the right trust boundary for agents that spend money. APPROVED ≠ paid. The capture call is where money moves; demo accordingly. What's next Live product APIs instead of the static catalog; refunds via chat ("return the earbuds"). PayPal's MCP server as the tool layer for deeper agentic-commerce integration.
Log in or sign up for Devpost to join the conversation.