Ferhat RudvanoğullarıData Engineer
← All work

Application development

Subscription & Credit Billing

Added Stripe subscriptions, expiring credits and consent-first analytics to a B2B sourcing platform so it could launch as a paid product.

Full-stack developer in a small team

Jul–Nov 2026

In numbers

trial turned into a paid product
Free → paid
trial turned into a paid product
isolated dev and test environments
99
isolated dev and test environments
tracking until the user opts in
Off by default
tracking until the user opts in

The problem

The platform was running as a free trial. A paid launch needed three things it didn't have: a way to take payments, a way to track what each customer was entitled to, and analytics that respected user consent.

What I did

  1. 1

    Payments

    I built monthly and yearly subscriptions on Stripe, including plan changes and cancel-at-period-end. Stripe handles the payments themselves; the real work is keeping the platform's own state in sync with the events Stripe sends back through webhooks.

  2. 2

    Credits

    Every supplier search spends credits. Credits expire, the balance is checked before a job starts rather than halfway through, and customers can top up with extra packs. Early customers get fixed founding-customer pricing, capped at one purchase per environment.

  3. 3

    Analytics with consent

    I wired up Google Analytics and Microsoft Clarity so that no tracking tag loads until the user agrees. Consent starts denied (Google Consent Mode v2) and personal data is masked in session recordings.

  4. 4

    Test in isolation

    Each feature was built in its own isolated environment and shipped separately. Sensitive flows like payments were tested end to end there against Stripe's test mode before going anywhere near production.

Result

The platform went live as a product that takes payments, meters usage with credits and follows consent rules.

What I learned

The happy path is the easy part of billing. Most of the time goes into the edge cases: plan changes, cancellations, credits that expire mid-cycle.

Stack

  • TypeScript
  • React
  • Node.js
  • Stripe
  • PostgreSQL
  • Google Analytics
  • Microsoft Clarity