Inspiration

Every "AI shopping assistant" I tried ends the same way: a list of links and "happy shopping". The hard part isn't finding a keyboard, it's the last step: deciding and paying, and doing it again next month without me babysitting it. PayPal's prompt for this hackathon said it plainly: not just recommend, but actually transact. Gofer is my answer to that sentence.

What it does

Gofer is an iPhone agent that buys things for you with PayPal.

  • Say what you need. "Wired mechanical keyboard, blue switches, under $120."
  • It finds it. Real inventory across retailers via Channel3. Every result is checked against your hard constraints using structured attributes (switch type, connectivity, size…), not just the title. You get three candidates, each with a one-line trade-off.
  • You approve, it pays. Tap Buy with PayPal; the PayPal sheet opens inside the app. Gofer creates and captures the order (PayPal Orders v2) and, with your consent, vaults your wallet.
  • Then it buys on its own, within rules you set. Buy without asking under $100, monthly cap $500. Inside those limits Gofer charges your saved PayPal wallet with no sheet. Outside them, PayPal asks you.
  • Watch a price. "Buy it automatically if it drops under $60." A cron re-checks the live price; when it hits, Gofer buys unattended, still inside your rules, and sends you a push. If the rules say no, the watch is parked for a one-tap approval.
  • Every order shows how it was authorised: approved in PayPal, bought automatically, or bought on price drop, plus shipment tracking.

How we built it

  • iOS: SwiftUI, iOS 17+, XcodeGen. Chat with streaming agent events, product cards, receipts, Orders and Rules tabs. PayPal approval runs in ASWebAuthenticationSession and returns through a custom URL scheme. APNs push for unattended buys.
  • Backend: Cloudflare Worker (TypeScript) with D1. The agent is a tool loop on DeepSeek (deepseek-chat, function calling, OpenAI-compatible API) with tools search_products, present_candidates, start_checkout, watch_price. Events stream to the phone over SSE. The LLM layer is provider-agnostic; it also runs on Cloudflare Workers AI (Llama 3.3 70B), which we used until its free daily quota ran out during testing.
  • PayPal: OAuth2, Orders v2 create/capture/get/track, Vault (store_in_vault: ON_SUCCESS on the first approved order, payment_source.paypal.vault_id for unattended charges).
  • Channel3: /v1/search with price and availability filters, /v1/products/{id} for re-pricing watches, price-tracking subscription.
  • Rules engine: commerce.decide() on the server decides approve vs. auto for every purchase. The model never gets to skip it.

Challenges we ran into

  • An agent that spends money must not be prompt-dependent. Early on, a single-candidate result made the model skip "which one?" and buy. Now the loop refuses start_checkout unless the user's latest message selects a product, and never in the same turn in which candidates were presented. Prompts advise; code decides.
  • Unattended payments. Getting PayPal Vault right in the sandbox (vault on first approval, then vault_id charges that auto-capture) was the key technical risk; it was the first thing I verified with curl before writing UI.
  • Models follow rules loosely. Llama 3.3 (our first provider) sometimes presented a product its own reason admitted was wrong ("…but no blue switches"). A server-side filter drops any pick whose reason negates a constraint, and another drops products whose structured attributes contradict the request.
  • Shipment tracking: the classic /v1/shipping/trackers-batch endpoint returns 403 for a default sandbox app; Orders v2 /track works.

Accomplishments that we're proud of

A real end-to-end loop on a phone: natural-language request → verified candidates → PayPal approval → vaulted wallet → rule-bound unattended purchases → price-triggered purchases with a push notification, all persisted, all auditable in the Orders tab. And a backend that keeps the human in charge even when the model gets it wrong.

What we learned

Agentic commerce is 20% model and 80% guardrails, consent and receipts. The product that earns trust is the one that can explain, for every dollar, who authorised it and under which rule.

What's next for Gofer

PayPal webhooks for order state, multi-quantity and variants (size/colour), shared household rules, and a PayPal Agent Toolkit / MCP surface so other agents can hand Gofer a shopping task.

Built With

Share this project:

Updates

Submission history