Inspiration
Every service payment today is all-or-nothing. Pay up front and hope the work gets done, or pay afterwards and the seller has to trust you. When a job is only half done, there is no fair middle: just arguments, chargebacks and disputes. We asked a simple question: what if money only moved for results that were actually verified?
What it does
OutcomePay is pay-for-what-works on PayPal.
- Promise to contract. A seller writes a promise ("your homepage will load in 2 seconds on mobile"). Google Gemini turns it into a measurable Outcome Contract: what gets checked, the anti-cheating rules, and a payout curve (2 s or less pays 100%, 2.4 s pays 60%, slower pays less).
- PayPal holds the money. The buyer pays with the PayPal button using an authorization, so the money is held, not sent. The contract's SHA-256 fingerprint is stored in the PayPal order, so nobody can change the deal afterwards.
- Evidence, not opinions. Independent checks measure the result before and after the work. Anti-cheating checks catch shortcuts like deleting page content or breaking checkout.
- Code decides, PayPal executes. Deterministic code applies the contract to the evidence. PayPal then captures exactly the earned share (a partial capture), releases the rest to the buyer, or voids the hold if nothing was earned. Example: the site loads in 2.21 s, so the seller gets $180 and $120 goes back to the buyer.
It also includes:
- Photo-verified services: for real-world jobs like cleaning, Gemini vision checks each checklist item from the seller's and the buyer's photos. A seller's own photos can never release money on their own, and if the two sides' photos disagree, the money stays held.
- Team payouts: earnings are split among a team in one PayPal Payouts batch.
- AI purchasing agent and passkey approval: an agent picks a seller by verified track record (not star ratings) and drafts the contract. It can't spend: the buyer approves with a passkey whose challenge contains the exact contract fingerprint.
- Disputes: OutcomePay finds PayPal disputes on a payment and answers them with the job's evidence report.
- Outcome-based reputation and a dashboard (AG Grid) showing what is held, paid and returned.
Design principle: AI proposes, evidence verifies, code decides, PayPal executes, the audit trail remembers.
How we built it
- Next.js 14 + TypeScript, with Zod schemas for every contract.
- PayPal REST APIs: Orders v2 with
intent: AUTHORIZE, authorize, full and partial capture (final_capture), void, refund fallback, Payouts, Disputes (provide-evidence), and signature-verified Webhooks. Idempotency keys are tied to job IDs. The PayPal JS SDK powers the checkout button. - Google Gemini (gemini-2.5-flash) via the Vercel AI SDK for contract extraction, photo verification, the purchasing agent and the plain-English settlement report.
- WebAuthn passkeys (SimpleWebAuthn) that sign the contract hash.
- AG Grid for the dashboard.
- Everything runs on the PayPal sandbox.
Challenges we ran into
- Keeping AI away from money. LLMs are great at reading promises and photos, but we didn't want one deciding payouts. We split the system so AI only extracts and observes, and plain code makes every money decision.
- Partial settlement on PayPal. We use partial capture so the buyer is only charged for what was earned, with a fallback (full capture plus partial refund) if partial capture isn't available.
- Self-reported evidence. A seller can upload flattering photos. We added evidence provenance: seller photos alone never release funds, and conflicts with the buyer's photos keep the money held.
- Hold limits. PayPal honours an authorization for 3 days, so jobs need to be short or split into milestones.
- Real-world edge cases: recovering a payment approved in the popup when the page had been reloaded, and handling AI model availability and timeouts with a safe template fallback.
Accomplishments that we're proud of
- A real PayPal partial capture driven by measured evidence: a 2.21 s result paid exactly 60%, and the rest went back to the buyer.
- An AI agent that reasons about risk (it warns when the only seller in budget has a history of failed anti-cheating checks) but cannot spend without a human's passkey.
- A contract fingerprint that links the PayPal order, the passkey signature and the audit trail together.
What we learned
PayPal's authorize-then-capture flow is a powerful primitive for conditional payments, not just checkout. We also learned that trustworthy AI in payments is mostly about what you don't let the AI do.
What's next for OutcomePay
- PayPal Multiparty so captured funds go straight to sellers' own PayPal accounts, with a small platform fee charged only on verified, captured amounts. We only earn when the work works.
- An MCP server so any AI agent can hire through OutcomePay and pay only for verified outcomes.
- More verifiers: tests passing on a GitHub pull request, delivery tracking, uptime promises, ad conversions.
- Milestone contracts for longer jobs, plus photo anti-fraud (in-app capture with timestamps, duplicate-image detection).
Built With
- ag-grid
- gemini
- google-gemini
- next.js
- node.js
- passkeys
- paypal
- paypal-disputes
- paypal-js-sdk
- paypal-orders-api
- paypal-payouts
- paypal-rest-api
- react
- tailwindcss
- typescript
- vercel-ai-sdk
- webauthn
- zod