Inspiration

Coupon codes are a leaky way to give a discount: they get forwarded, posted publicly, and farmed. Earned Price replaces the code with proof — the price a buyer pays depends on verified public facts about them, so there is nothing to leak.

What it does

Earned Price is a checkout where the price depends on verified public facts about the buyer instead of a coupon code — so there is no code to leak, forward, or farm. A merchant writes a discount rule in a plain sentence (for example: 20% off for buyers whose GitHub account is at least a year old). AI compiles that sentence into a typed, tiered rule over a small whitelist of GitHub profile fields, and reads it back in plain English for the merchant to confirm — AI proposes, but deterministic code decides every money figure. At checkout the buyer signs in with GitHub (zero OAuth scopes requested) or picks a labelled sample profile; the price builds up live, tier by tier, from facts read at that moment. Payment runs through PayPal at the earned price, with the discount shown as its own line and a hash of the fact snapshot stored in the order's custom_id. The licence key is issued only after capture. The receipt page re-reads the order from PayPal and verifies the amount, so every figure the buyer sees after payment comes from PayPal itself. It also supports buy-first-prove-later: pay full price now, prove eligibility afterward, and the difference is refunded through PayPal with an idempotency key. One redemption per GitHub user ID stops repeat farming. Built for developer-tool and course sellers, and conferences that discount for open-source contributors.

How we built it

Next.js and TypeScript for the app, PayPal Sandbox REST API for orders, captures, and refunds, GitHub OAuth (zero scopes) for verified public profile facts, Neon Postgres for orders, rules, and redemptions, Render for hosting, and Nebius Token Factory (DeepSeek-V4.1-Flash) for the natural-language rule compiler. The compiler is constrained to a typed, whitelisted set of GitHub fields and tiered rules; deterministic code — not the model — computes every price.

Challenges we ran into

Keeping AI in its place: letting a merchant write rules in plain English without letting the model touch money. The fix was a strict boundary — AI proposes a typed rule and a plain-English read-back, and only deterministic code evaluates it. We also had to close farming loopholes, for example by excluding a buyer's own repositories from contribution-based tiers, enforce one redemption per GitHub user ID, and make the receipt trustworthy by re-reading the order from PayPal instead of trusting local state.

What we learned

That a trustworthy discount needs three separate proofs: the facts at pricing time, the amount PayPal actually captured, and the receipt re-read from PayPal — and that a clear AI/human boundary makes a natural-language feature safe to ship.

Verified test purchases (PayPal Sandbox — no real money)

Try it

Built With

Share this project:

Updates

Submission history