Inspiration

Picture your daughter's birthday on Saturday. Twelve kids, $150, and you need a cake, flowers and balloons.

An AI agent could handle that, except it means three shops and three payments. What happens if the florist sells out after the bakery already took your money? You've got a cake, no flowers, and a mess to clean up.

Agent checkout today works for one purchase at one merchant. Real errands span several small shops, and that's exactly where nobody trusts an agent with their money. I wanted to fix that trust problem, and I wanted the small shops on your street to be part of it.

What it does

You give the agent a goal and a budget. Shelfie Street does the rest:

  • One approval. You approve up to $150 on PayPal. Nothing is charged yet.
  • Planning. Claude splits the goal into needs, searches real shop catalogs and picks the basket.
  • Signed mandates. Your limit is signed, and code checks it before every spend. The model can't overrule it.
  • Automatic recovery. If a shop sells out, the agent finds another one inside your limit, with no second approval.
  • All or nothing. If no substitute fits, PayPal voids the authorization and you pay $0.
  • Photo proof. Each shop uploads a packing photo. Claude compares it with the order, and nobody gets paid until every shop passes.
  • Agent firewall. Outside agents are screened for manipulation, lose trust when they misbehave, and get banned. You can run five live attacks yourself.
  • Audit trail. Every money event goes into a hash-chained ledger, shown in AG Grid.

Any small shop can join from a photo of its shelf. Claude builds the catalog, and the shop gets its own MCP server, product feed and llms.txt. When agents ask for something nobody sells, it shows up as a demand gap, and Claude can draft the product.

How I built it

The core is a saga across PayPal's money APIs. Shelfie is the merchant of record:

  1. Orders v2 with intent=AUTHORIZE holds the full budget on one approval.
  2. Stock is reserved at each shop, and failures trigger recovery.
  3. Partial captures with final_capture: false settle one shop at a time, but only after every proof has passed.
  4. Payouts send each shop its share, based on what PayPal actually left us after fees.
  5. Void releases the unused money.

Authorizing the full budget instead of the basket total is the key decision. That gap is what lets the agent recover without asking you again.

Claude (claude-opus-5-5) handles planning, catalog matching, proof checks and the firewall classifier, through structured outputs, vision and tool use. One rule shaped the whole design: AI decides what to buy, and code decides what is allowed.

The app runs on Next.js and Vercel, with Turso for storage, AG Grid for the ledger and the MCP SDK for shop servers. It also uses PayPal's Catalog Products, Invoicing, Refunds, Shipment Tracking and Webhooks.

A real run

This ran on PayPal's sandbox, not a mock:

  • $150.00 authorized on one approval
  • A florist sold out, and another was swapped in with no new approval
  • $98.00 captured as three partial captures
  • Three payouts accepted by PayPal
  • $52.00 released
  • A failed basket also voided cleanly, and the buyer paid $0

Challenges I ran into

  • The riskiest assumption. The whole design needed several partial captures on one authorization, followed by a void. Multi-unit authorize orders were refused, so I tested this on the sandbox before building further. It worked.
  • Silent checkout failures. PayPal showed only "something went wrong" on sandbox checkout. It turned out India-to-India payments aren't supported, and Payouts failed for the same kind of reason. Moving to US sandbox accounts fixed both.
  • Half-paid baskets. My first design captured each shop as its proof passed, which could leave money to claw back if a later shop failed. I changed it so no money moves until every shop has passed.
  • Recovery that was too strict. The search rejected a garden bouquet as "not a table arrangement" and cancelled the whole basket. Substitutes now only have to do the same job.
  • Real fees. PayPal kept about 5.4% on captures, so a flat 5% commission lost money on every basket. Payouts now start from the net amount.

Accomplishments that I'm proud of

Watching a shop sell out mid-purchase and seeing the agent fix it in seconds, with the ledger proving no money moved wrongly. And watching my own attacks fail because limits are enforced in code, so a fooled model still can't spend.

What I learned

Most agentic commerce problems are really about trust, not intelligence. PayPal's authorize, capture and void tools are a great fit for agents, because they separate "permission to spend" from "money moved".

What's next for Shelfie Street

  • Real seller onboarding, so shops get paid directly
  • Merchant accounts in place of browser-based ownership
  • Stronger proof checks, because a realistic generated image can still pass today
  • More real shops on a real street

Built With

Share this project:

Updates

Submission history