Inspiration
PayPal's hackathon brief asks for agents that do not only recommend — they transact. A shopping copilot that stops at "you might like this mug" does not answer that. We wanted the smallest loop that still includes a human approval, a real capture, and a real refund, so a judge can see the sandbox move.
What it does
- Understands a shopping request against a fixed catalog
- Confirms the cart and the total before any PayPal call
- Creates a sandbox order with the PayPal Agent Toolkit and returns the approval link
- Captures only after the buyer approves
- Reports order status and issues a full or partial sandbox refund
- Optional MCP tool path using the PayPal Agent Toolkit MCP server
How we built it
Next.js and TypeScript for the counter UI. Vercel AI SDK 4 for the multi-step tool loop. @paypal/agent-toolkit for PayPal function calling, pointed at the sandbox. The MCP path is the toolkit's MCP server over stdio. Shelf prices, the confirmation gate, and the "must be APPROVED before capture" check sit in our code so a confused model cannot skip them.
Built and developed with Cursor Cloud Agent / Grok Bot.
Challenges we ran into
PayPal checkout is a redirect, not a single server call. The agent has to create the order, stop, and capture only after the buyer returns. Keeping the demo on sandbox, and refusing a live PAYPAL_ENV, mattered more than adding more PayPal products.
Accomplishments that we're proud of
One conversation can quote a cart, open a sandbox order, capture it, and refund it. Verified end-to-end in sandbox: order 38V51416CB497980P, capture 2K643895FX191273N ($36 COMPLETED), refund 63J622615D751053S (COMPLETED).
What we learned
Agentic checkout is mostly about gates: confirm the cart before create_order, refuse capture while status is still CREATED, and refund by capture id — not order id.
What's next
Richer catalogs, saved sandbox buyers, and shipping labels once the capture and refund loop is the boring part.
Built With
- ai
- cursor
- mcp
- next.js
- paypal
- sdk
- toolkit
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.