-
-
04-checkout-with-paypal
-
01-landing
-
07-trace-split-and-paypal-payouts
-
15-risk-review-queue
-
14-live-api-playground
-
08-merchant-dashboard
-
11-creator-dashboard
-
02-how-a-sale-is-split
-
03-shop-with-ai-cited-answer
-
10-merchant-ai-insights
-
12-prompt-injection-blocked
-
06-trace-ai-influence-and-risk-checks
-
09-merchant-orders-ag-grid
-
13-developer-api
-
05-trace-question-and-citations
Inspiration
AI agents are quickly becoming the new storefront. People no longer search, click ten links, and read reviews; they ask an assistant "what should I buy?" and get one answer.
But that answer is built on someone's work: the reviewer who tested the headphones, the creator who compared the cameras, the blogger who wrote the buying guide. In the agent world there is no click, so there is no affiliate link, no credit, and no payment. Creators quietly lose their income, merchants can't see what actually drove a sale, and the affiliate economy that pays millions of people starts to break.
We asked: what if every AI recommendation came with footnotes, and every footnote got paid? PayPal already sits at checkout and already pays people in 200+ markets. It is the natural home for the payment layer of agentic commerce. So we designed it as if PayPal had shipped it: PayPal Attribute.
What it does
PayPal Attribute is an attribution and payout rail for AI-driven commerce.
- An AI agent recommends a product and cites the sources that shaped its answer, shown to the shopper as footnotes.
- The agent registers those citations with the Attribute API and receives an attribution token.
- The shopper checks out with PayPal; the token travels with the order.
- When the payment is captured, Attribute's AI scores how much each source actually influenced the recommendation and splits the merchant's commission accordingly, with a plain-language explanation for every share.
- After a refund-protection hold window, creators are paid automatically through PayPal Payouts. Refunds trigger automatic clawbacks.
The portal has a page for each participant:
- Shop with AI: a shopping agent with cited answers and real PayPal sandbox checkout
- Sale attribution: a live, step-by-step trace of one sale from question → citations → capture → split → payout
- Merchants: commission rules, budget caps, and an AG Grid analytics view of every AI-attributed sale, plus natural-language questions about performance
- Creators: connect PayPal, register content, track citations, earnings and the payout schedule
- Developers: API keys, an OpenAPI reference, generated SDKs, and an MCP server so any agent can integrate in minutes
How we built it
- Frontend & API: Next.js + TypeScript, styled to feel native to PayPal
- PayPal: JavaScript SDK buttons, Orders v2 (attribution token carried in
custom_id), Payouts API for batch creator payments, Webhooks with signature verification, and Log in with PayPal for creator onboarding, all on the PayPal sandbox - AI: Claude powers the shopping agent (tool use + grounded citations), the influence scoring, fraud screening, and merchant insights
- Data: PostgreSQL with Prisma, holding an append-only ledger for every attribution, split, payout and reversal
- Sponsor tools: AG Grid for the merchant and creator ledgers, APIMatic to generate SDKs and docs from our OpenAPI spec, Channel3 for the product catalog, Bryntum for the payout schedule, Render for hosting
How the commission is split
For an order of amount $A$ with merchant commission rate $r$ and platform fee $f$, the creator pool is
$$C = (1 - f)\, r A$$
Each cited source $i$ receives an AI influence score $s_i$. Shares are normalised, then clamped so no single source can take everything and trivial mentions don't earn dust payments:
$$p_i = \operatorname{clamp}!\left(\frac{s_i}{\sum_j s_j},\; p_{\min},\; p_{\max}\right), \qquad \text{payout}_i = C \cdot \frac{p_i}{\sum_j p_j}$$
Challenges we ran into
- Fair attribution. An even split rewards citation-stuffing; a pure "most relevant" split is winner-takes-all. We combined AI influence scoring with floors, caps and human-readable reasons so every share is explainable.
- Money that can move backwards. Refunds after payout are real, so we added hold windows, a reversible ledger, and automatic clawbacks.
- Webhooks in the real world. Duplicate and out-of-order events had to be idempotent, and every webhook is signature-verified before any money moves.
- Adversarial content. Creator content is untrusted input to an AI, so we screen for prompt injection, self-citation and fake reviews.
Accomplishments that we're proud of
- A complete loop: AI answer → PayPal checkout → AI-scored split → real sandbox payouts
- A design where PayPal could switch this on for any agent with a single API key
- An attribution trace that makes every cent explainable to merchants and creators
What we learned
- Agentic commerce needs new payment primitives, not just new checkout buttons
- Trust in AI-driven payments comes from explainability and reversibility
- PayPal's existing building blocks (Orders, Payouts, Webhooks, identity) already cover most of what the AI era needs
What's next for PayPal Attribute
- Native support in PayPal's agent tooling so any agent can attribute by default
- Multi-currency creator payouts and creator tax/KYC handled through PayPal accounts
- Publisher-level licensing deals: pay news sites and review platforms when AI agents rely on them
- A path for Honey's affiliate network into the agentic era
Built With
- ag-grid
- anthropic
- apimatic
- bryntum
- channel3
- claude
- log-in-with-paypal
- model-context-protocol
- nextjs
- node.js
- openapi
- paypal
- paypal-javascript-sdk
- paypal-orders-api
- paypal-payouts-api
- paypal-webhooks
- postgresql
- prisma
- react
- render
- tailwindcss
- typescript