billing-api
running2024Subscription billing for SaaS
- Problem
- Invoicing was kept in spreadsheets. As soon as plans, proration and refunds appeared, every month ended with manual reconciliation and mistakes that reached customers.
- My role
- Sole backend developer: domain model, REST API, payment-provider webhooks, containerisation and deployment.
- Hard part
- Payment webhooks arrive out of order and more than once — a naive handler charges twice. I built an idempotent event log with a deduplication key and a retry queue on RabbitMQ, so a repeated callback is recorded but never billed again.
- PHP 8.4
- Symfony
- PostgreSQL
- Docker
- RabbitMQ