Inspiration
Most small subscription businesses on PayPal pick a price once and never touch it again. Not because they don't care, but because testing a price feels like gambling with your customers. ProfitWell's founder has said the average company spends about eight hours on pricing in its whole life. We wanted to make a price test something a two-person business could run on a Tuesday without losing sleep.
And when a customer clicks cancel, nobody is there to ask why. That felt like the other half of the same problem.
What it does
PlanLab is a copilot for businesses that bill subscriptions through PayPal. It has two agents.
The Pricing Agent. You describe a goal in plain words, like "raise annual-plan uptake without hurting retention". The AI proposes 2 to 4 price options with a reason for each, and PlanLab checks every option against PayPal's plan rules before creating it as a real PayPal billing plan. New sign-ups are split across the options with Thompson sampling. A winner is only declared when it's at least 95% likely to earn more new monthly revenue per visitor, and guardrails (churn, retention, refunds, disputes) stop a risky price on their own and explain why, with the numbers. The AI suggests; the guardrails get the last word. When there's a winner, it rolls out through PayPal's API in one click.
The Save Agent. A customer types why they're cancelling, in their own words. The AI works out the reason (price, not using it, card problems) and the merchant's own rules pick an offer: a pause, a downgrade, a discount for a few months, or letting them go. Every offer is a real PayPal call, and every decision lands in a log the merchant can override.
It also imports 12 months of PayPal transaction history into cohort charts, so a merchant sees their retention before running a single test, and it's honest about traffic: it tells you how many visitors a test needs and how long that takes.
How we built it
The backend is FastAPI in Python and the workspace is Next.js. PayPal Subscriptions runs through PayPal's APIMatic-generated Server SDK: plans, subscriptions, webhooks, Transaction Search and rollout. To get real sign-ups without real customers, KERNEL cloud browsers log in as PayPal sandbox buyers and click "Agree & Subscribe", so every conversion in the demo is an actual sandbox checkout. The workspace uses AG Grid (you can ask the grid a question in plain English and the AI sets the grid's own filters, so you see exactly what it did) and a Bryntum Gantt for the experiment timeline. Everything is deployed on Render from Docker, with scheduled jobs for the Save Agent sweep and guardrail checkpoints.
A real price test takes weeks. We didn't have weeks, so we split it honestly: sign-ups and payments are real PayPal sandbox transactions, and the 60 days after them are simulated so you can watch the whole test in a minute. Every number in the app is labelled real or simulated.
AI tools we used and how
In the product: Gemini proposes the price options, reads cancel reasons, turns grid questions into AG Grid filters and writes the plain-English explanations. If Gemini is overloaded it fails over to Groq, then to a local Ollama model, and if all of them fail, built-in templates take over. No LLM ever decides a winner; the statistics do.
To build it: we used Claude throughout development, for writing and debugging code (the simulated clock, the KERNEL checkout bot, the one-click demo), for testing the app end to end, and for fixing the bugs we found. [Teammates: add the tools you used and for what.] The APIMatic Context Plugin helped us with PayPal's Server SDK.
Challenges we ran into
- PayPal's SDK quietly dropped
total_cycles: 0, so every test subscription expired after its first payment. We only caught it by running real checkouts, then patched it and added a test. - Our first sandbox buyers were created in India, and PayPal showed a "We're sorry" page right after login. Switching to US sandbox buyers fixed it, but it took us a while to work out.
- The sandbox sometimes answers with a 503. We added retries everywhere, and the 12-month import now keeps whatever months it got instead of failing outright.
- New payments take a couple of hours to show up in Transaction Search, so our history screen lagged behind our own sign-ups.
- PayPal has no timed pause, so we suspend the subscription and a nightly sweep reactivates it.
- The AI model we started with was retired halfway through the hackathon. That's why the failover chain exists.
Accomplishments we're proud of
- Every Save Agent action is verified against the PayPal sandbox, not mocked.
- The guardrail moment: watching it stop a price that looked like a winner on sign-ups but was quietly losing customers.
- Over a hundred automated tests, and a judge can run the core of the app from a fresh clone with no API keys.
What we learned
That the hard part of an AI product isn't the AI, it's deciding what the AI is allowed to do. Letting the model propose and the statistics decide made everything easier to trust and to explain. We also learned to test against the real sandbox early: most of our real bugs only showed up there.
What's next
- Run the history import and a full test against a real merchant account.
- Let merchants set their own guardrail limits from the workspace.
- Connect an outside agent to PlanLab's read-only tools, so a merchant can ask about their tests from wherever they work.
Built With
- ag-grid
- apimatic
- bryntum
- docker
- elasticsearch
- fastapi
- gemini
- groq
- kernel
- next.js
- ollama
- paypal
- paypal-server-sdk
- paypal-subscriptions
- playwright
- postman
- pydantic
- python
- react
- render
- sqlite
- supabase
- typescript