Try it: Playground (no login) · Demo video · Code · Review path for judges

Inspiration

Rosa Marín and Theo throw, glaze and fire every piece at Juniper Clay, a two-person pottery studio in Portland. Their shop takes PayPal. More of their customers now ask an AI assistant to do the shopping, and that assistant has two options: click through a website built for people, or go to a marketplace that has an API. Visa's Agentic Commerce Benchmark (Nov 2026) found that 42.8% of AI shopping runs failed and 54% of the failed runs still bought something. PayPal already has the right protocol for this, the Store Sync Cart API that its agentic commerce platform calls on a merchant's server, but today it is a program for large merchants. We built Counter so a two-person studio gets the same thing.

What it does

Counter gives any small PayPal shop the merchant side of Store Sync and opens it to any AI agent. A buyer agent connects over MCP (or WebMCP on the shop's own pages), finds the exact variant with real stock and delivery dates, can ask the shop for a deal, builds a cart through the shop's Store Sync API, and hands the person a PayPal approval link. Checkout authorizes the payment; PayPal holds it until the shop ships, and the shop captures it from its Console with tracking, or voids it on cancel. A seller agent haggles for the shop, but a pricing engine in code has the final word: it never sells below the merchant's floor, and a lowball is answered above the floor so one probe never reveals it. If a buyer later disputes an agent's purchase, Counter answers with an evidence PDF built from what the agent actually asked for, the cart it confirmed, the negotiation and the shipment.

  • Playground (no login): watch a buyer agent shop, haggle and pay, with every Store Sync and PayPal call on screen.
  • For agents: one MCP server, eight tools, in-chat product, cart and approval cards (MCP Apps), and WebMCP on storefront pages.
  • For shops: Studio imports products from a product URL, a photo or CSV, checks the market price with Channel3 and suggests a floor; the Console (AG Studio) shows agent traffic, negotiations against the floor, orders to ship and disputes, with an assistant that can prepare a shipment but never capture one without the merchant's confirmation.

How we built it

Counter is a TypeScript monorepo: a Next.js 16 app on Vercel with Postgres (Neon), and packages for each layer. store-sync implements PayPal's merchant Cart API to the spec and validates every request and response with PayPal's own schema package, @paypal/commerce-cart-zod. gateway plays the role of PayPal's agent platform in sandbox: it signs each Store Sync call with an RS256 token the way PayPal does and exposes the shopping tools over MCP. paypal is our client on top of the PayPal Server SDK (Orders v2, Payments v2) plus Partner Referrals, Disputes, tracking, webhooks and Vault. platform connects them: authorize-at-checkout, capture on shipment with a platform fee for onboarded shops, void and refund, webhook handling, dispute decisions with a generated evidence PDF, and seller onboarding. negotiate is the seller agent and its deterministic pricing engine. importer turns a URL, photo or CSV into agent-legible variants with Channel3. The Console is built on AG Studio with three custom widgets and a merchant-ops agent in Studio's agent framework. A negotiated deal travels through the protocol itself: the offer id goes into the Store Sync cart's discounts.codes, the shop applies it only for the agent and lines it was made for, and it lands in the PayPal order's discount breakdown. 923 tests run with no network and no keys (pnpm -r test).

PayPal Developer Platform

  • Store Sync merchant Cart API (POST /merchant-cart, GET/PUT /merchant-cart/{id}, POST /merchant-cart/{id}/checkout) served for every shop, validated with @paypal/[email protected]; a Node port of PayPal's Postman conformance collection runs in our test suite (166 checks pass; 3 assertions contradict the schema the collection itself loads, documented in the repo).
  • Orders v2 with intent: AUTHORIZE (one order per cart, patched as the cart changes), authorize at checkout.
  • Payments v2: capture on shipment (final_capture, platform fee for onboarded shops), void, refund; order tracking.
  • Partner Referrals v2 + PayPal-Auth-Assertion for shops that connect their own PayPal account.
  • Webhooks with signature verification; Disputes (provide-evidence, provide-supporting-info, accept-claim).
  • Live on the PayPal sandbox: orders created by a buyer agent through the Store Sync API, approved by a sandbox buyer in PayPal, authorized, captured on shipment with tracking, voided on cancel and refunded, with PayPal webhooks received and verified. A second seller connected its own PayPal account through Partner Referrals, and its next agent order was captured to that account with a 2% platform fee to Counter (JC-10006). A buyer's "item not received" dispute arrived by webhook and was answered with the tracking number and a generated evidence PDF, which PayPal lists as submitted by the seller. Every id is in docs/live-verification.md.

AI

  • Seller agent (z-ai-glm-5-3-flash via Venice AI): talks to buyer agents and proposes deals; the pricing engine decides. It never sees floors or costs; buyer text reaches it only as quoted data; every dollar amount in its reply must match the engine's deal or the reply is rewritten.
  • Buyer agent in the Playground (z-ai-glm-5-3-flash): shops through the MCP tools and stops at the PayPal approval link; a person approves every payment.
  • Catalog import (z-ai-glm-5-3-flash, text and vision): names attributes and writes descriptions from stated facts only; the merchant reviews every draft.
  • Console assistant (openai-gpt-6-luna / openai-gpt-61-terra via AG Studio's agent framework): explains negotiations, lists orders to ship, prepares shipments, sets floors within server-side limits.
  • Benchmarks: purchase runs used openai-gpt-6-sol and z-ai-glm-5-3-flash; negotiation runs used z-ai-glm-5-3-flash and claude-haiku-5-5.

The numbers (honest)

We expected Counter to make agents more accurate than shopping web pages. On our own clean, accessible storefront it did not: a frontier browser agent was accurate too (40/40 for the larger model, 39/40 for the small one; Counter 39/40 and 40/40). The difference is effort: on the same 40 pre-registered tasks Counter used a median of 4 tool calls against 11.5 and $0.67 against $3.55 in model spend for the larger model (3 vs 10 calls and $0.07 vs $0.32 for the small one). No run in either arm bought the wrong thing. In 120 pre-registered haggling runs (polite asks, "$5 or I leave", prompt injections, bundle requests) across two models, the seller agent sold below a merchant's floor 0 times and broke a shop rule 0 times; without the engine, the same seller broke a shop rule once and one of its follow-up proposals would have sold a line below its floor. A seller simply shown the floors in its prompt also held on this set; the scenarios are single-turn, and code enforcement is what still holds when a model keeps probing. Everything is reproducible from results/ and the bench/ READMEs.

Challenges we ran into

PayPal's Store Sync platform is access-gated, so we built the merchant side to the published spec and a gateway that signs requests exactly like PayPal's platform, then verified both against PayPal's schema package and conformance collection. Three assertions in that collection contradict the schema it loads; we document them with suggested fixes. Our first negotiation engine answered a lowball with exactly the floor, which tells the buyer the floor after one probe; it now answers above it. Our first purchase benchmark run exposed two tool bugs (search results without product ids, buying rules too strict on colour words); we fixed them and kept the first run's numbers in the results file.

What we learned

Agents do not need a smarter browser to shop a small store correctly; they need the store to answer in a structured way, and they need a payment flow where the person stays in control. Authorize-then-capture on shipment turned out to be the right shape for agent purchases: the money is committed, nothing is taken until goods move, and a mistake can be voided before anyone is charged.

What's next

Onboarding real small shops through Partner Referrals, taking the Store Sync program live with PayPal for those shops, and multi-turn negotiation benchmarks.

Built With

  • ag-grid
  • ag-studio
  • channel3
  • drizzle
  • mcp-apps
  • model-context-protocol
  • neon
  • next.js
  • paypal
  • paypal-disputes
  • paypal-orders-v2
  • paypal-partner-referrals
  • paypal-server-sdk
  • paypal-store-sync
  • paypal-webhooks
  • playwright
  • postgresql
  • react
  • typescript
  • venice-ai
  • vercel
  • vitest
  • webmcp
  • zod
Share this project:

Updates

Submission history