Designing a Billing Microservice for an AI SaaS Platform
From zero to a production-ready billing domain: subscriptions, credits, Stripe integration, domain events, and failure-safe webhook handling.
Overview
Built the billing backbone for an AI SaaS platform, designing how usage, plans, credits, and payment events interact without tightly coupling the product to Stripe-specific workflows.
Problem
The main problem was keeping billing reliable while still supporting frequent product changes, usage-based pricing, and webhook-driven updates from external systems.
Approach
Modeled billing as its own domain, introduced domain events around payments and subscription state, and made webhook processing idempotent and failure-tolerant.
Outcomes
- Supported subscription and credit-based monetization.
- Separated billing concerns from product logic.
- Reduced the blast radius of payment webhook failures.
More selected work
Real-Time Conversational Engine for AI Voice Agents
Designed a finite-state conversational engine orchestrating telephony, speech recognition, language models, tool execution, and speech synthesis for real-time AI phone calls.
Data Extraction and Document Intelligence Systems
Integrated government portals, financial platforms, and document processing pipelines to transform fragmented external data into structured APIs and product workflows.
Scaling Digital Onboarding for a European Bank
Unified multiple identity verification providers, automated KYC and KYB risk assessment, and streamlined compliance workflows to help users open bank accounts in under five minutes.
Building a Low-Cost Payments Platform with Open Banking
Co-founded and built a recurring payments platform that leveraged direct debit and Open Banking infrastructure to reduce transaction costs compared to traditional card networks.
Designing the Microservice Foundation for an AI Platform
Defined the architectural standards, development patterns, and event-driven conventions used across all backend services of a multi-service AI platform.