Work / Maxx
Maxx
Group buying on PayPal: buyers each approve a hold, AI agents bargain one price for the whole group, and every buyer is charged only the price they were allocated.
The problem
Buying alone means paying list price. Group-buy sites ask everyone to pay up front, wait, then refund whoever missed out. And once an AI negotiates on your behalf, the real question is trust: nothing it says may be able to move your money.
One group, one price
Each buyer approves a PayPal hold for the most they would pay, in PayPal's own approval popup. The holds gather in a Bloc. A group negotiator agent and one seller agent per seller bargain over live rounds, bounded by floors and stock enforced in code. A deterministic clearing engine, not a model, allocates units and sets every price. Served buyers are captured at the price they were allocated and the rest of the hold is released. Buyers who were not served have the whole hold voided. Sellers are paid per order on delivery. Every hold, capture, void, payout and PayPal fee is written to one hash-chained ledger. In one sandbox run, 1,603 buyers joined, 1,003 of them with real PayPal sandbox holds, and settlement made 225 partial captures and voided 778 holds with no failures.
How it works
- 01
Join a Bloc with a hold, not a payment
Each buyer sets the most they would pay and approves a PayPal hold for that amount in PayPal's own popup. Nothing is charged yet.
- 02
Agents bargain for the whole group
A negotiator agent works for the group and a seller agent speaks for each seller. They trade over live rounds you can watch. Agents only bargain: a fixed rule in code decides who is served and at what price.
- 03
Capture the allocated price, release the rest
Each served buyer is captured at the price they were allocated, never above their hold, and the remainder is released. Buyers who were not served have the whole hold voided, and a receipt says why.
- 04
Pay the seller when the parcel arrives
Tracking is attached to the buyer's PayPal order and the seller is paid per order on delivery. The books reconcile to the cent, including PayPal's own fees.
Engineering notes
- PayPal sandbox integration across Orders v2 (AUTHORIZE and CAPTURE), Payments v2 (partial capture, void, refund), Payouts, Webhooks, Subscriptions and the JavaScript SDK v6.
- Every PayPal write carries a PayPal-Request-Id, so a retry returns the first result and a capture above the hold is refused, even when it arrives by webhook. Settlement resumes after a restart.
- A hash-chained money ledger records every hold, capture, void, refund, payout and PayPal fee. Webhook signatures are verified with PayPal and each event is applied once.
- Negotiator and seller agents run on NVIDIA Nemotron models on Nebius Token Factory under strict JSON contracts per role; a deterministic clearing engine allocates units and sets every price.
- A Postgres ledger caps AI spend in total, per day, per person and per negotiation, and every model call is logged with its model id, tokens, latency and cost.
- The API refuses to start against PayPal's live servers. Sign-in by emailed link, Google, Apple, Microsoft or GitHub, with passkeys or an authenticator app.
Architecture
The browser talks to a Next.js 16 server-side proxy, which streams negotiation rounds through to a single FastAPI service. Inside that service are Blocs and the auction engine, the agents, screenshot scanning and price search, the money service, the marketplace and webhook handling. PostgreSQL holds the durable state: Blocs, jobs, an append-only event journal, a hash-chained money ledger, the price cache and model-call metadata. Models run on NVIDIA Nemotron through Nebius Token Factory. Money moves only through the PayPal sandbox, and the API refuses to start against PayPal's live servers.
Trade-offs
Models bargain, code sets the price
instead of letting the model choose allocations and amounts
A model that can be talked into a number can be talked into the wrong number. Keeping every amount in deterministic code, re-checked against the hold before PayPal is called, means no prompt can move money.
Authorise a hold, then partially capture
instead of charging everyone up front and refunding the losers
The final price is unknown when a buyer joins. A hold lets the buyer commit to a ceiling and pay the cleared price, and the rest never leaves their account.
Idempotent writes and a hash-chained ledger
instead of retrying calls and an ordinary transaction table
PayPal rate limits force retries and retries cause double charges. A request id makes a retry harmless, and chaining the ledger makes a tampered or missing entry detectable.
Sandbox-only, stated plainly
instead of implying production payments
The API refuses live credentials. A real marketplace needs PayPal's multiparty product, because the seller is unknown when the hold is placed. The README says so.
Evidence
1,603
buyers in one sandbox group run
$151,973
held across 1,003 real sandbox holds
225 / 778
partial captures / voided holds
0
failed settlements