BillaBear is a self-hostable subscription management and billing system designed for SaaS companies that need full control over their billing infrastructure. Built in PHP and integrated with Stripe, it provides a complete REST API to manage subscriptions, invoices, payments, taxes, and customer communications. Unlike cloud-only solutions like ChargeBee or Recurly, BillaBear allows organizations to host and customize their billing system on-premises or in private clouds, ensuring data sovereignty and compliance. It’s ideal for engineering teams that need to embed billing logic directly into their product stack without vendor lock-in. The open-source version releases new features every six months, with a managed cloud option available for teams preferring hosted maintenance.
What You Get
- REST API Integration - Full-featured RESTful endpoints for managing customers, subscriptions, invoices, and payments; integrates with frontend via Stripe.js tokens for secure card processing.
- Advanced Tax System - Configurable tax rules per country and state, including EU reverse charge, OSS, and threshold-based taxation; supports VAT Sense for automated tax rule syncing.
- Twig Template Engine - Customize invoices, quotes, and emails using Twig templates, enabling non-technical teams to modify document layouts without code changes.
- Workflow Engine - Asynchronous, retryable workflows for critical billing operations like refund processing or microservice triggers on subscription events.
- Multi-Currency & Multi-Language Support - Handle pricing and communications in multiple currencies and languages with localized invoice generation.
- Email Service Provider Integration - Native support for SendGrid, Mailgun, and PostMark to send transactional emails via their APIs or custom Twig templates.
- Document Generation - Generate PDF invoices and quotes using DocRaptor integration with dynamic Twig-based templates.
- Dunning & Credit Notes - Automated retry logic for failed payments and issuance of credit notes with customizable templates.
- Multiple Brand Support - Manage distinct branding, logos, and tax rules for different product lines or subsidiaries within a single instance.
- Webhooks & Third-Party Integrations - Connect to Xero, EasyBill, Slack, FreshDesk, Zendesk, Mailchimp, and EmailOctopus for accounting, notifications, and marketing syncs.
Common Use Cases
- Building a multi-tenant SaaS dashboard with tiered usage billing - A company selling API access with volume-based pricing uses BillaBear to dynamically calculate charges based on monthly usage, apply tax rules per customer location, and generate branded invoices via Twig templates.
- Managing enterprise subscriptions with EU tax compliance - A European SaaS provider automates VAT calculations and OSS reporting using BillaBear’s tax thresholds and VAT Sense integration to avoid manual compliance errors.
- Problem: Manual invoice updates causing support tickets → Solution: Twig-based email/invoice templates - Marketing teams update invoice wording or branding without developer involvement by editing Twig files in the admin UI, reducing ticket volume by 70%.
- DevOps teams managing billing for microservices - Engineering teams use BillaBear’s workflow system to trigger resource provisioning in Kubernetes when a new subscription is created, with automatic retry on API failures.
Under The Hood
Billabear is a full-stack billing and subscription management platform designed with extensibility and multi-provider support in mind, particularly focusing on Stripe integration. It combines a Symfony-based PHP backend with a Vue.js frontend to deliver a modular and maintainable solution for handling complex billing workflows.
Architecture
Billabear adopts a monolithic architecture with clear separation between frontend and backend, emphasizing reusable components and modular design.
- The backend follows Symfony’s bundle system and layered architecture to isolate domain logic from infrastructure concerns.
- The frontend is structured as a Vue.js application with component-based UI organization and state-driven communication.
- Service-oriented architecture and dependency injection are used to manage interactions between backend modules.
Tech Stack
The project leverages modern web technologies to support robust billing and subscription features.
- Built with PHP and Vue.js, using Symfony as the core backend framework and Symfony Webpack Encore for asset handling.
- Integrates libraries such as Axios, Flowbite-Vue, Stripe SDK, and Vuex/Pinia for state management.
- Employs Vite and Webpack for module bundling, Tailwind CSS for styling, and Babel for JavaScript compilation.
- Utilizes Vitest, Jest, PHPUnit, and Behat for comprehensive frontend and backend testing.
Code Quality
The codebase reflects a balanced approach to quality with consistent patterns and extensive testing practices.
- Comprehensive test coverage across both frontend and backend components ensures reliability and maintainability.
- Error handling is implemented consistently with clear separation of concerns in domain logic and infrastructure layers.
- Type annotations and well-organized directory structures contribute to code clarity and long-term sustainability.
What Makes It Unique
Billabear distinguishes itself through its modular design and deep integration with billing-specific workflows.
- A modular background job system powered by state machines enables flexible handling of complex billing operations like card expiration notifications.
- Dedicated services and process management provide robust support for Stripe subscription lifecycle events.
- Multi-language, multi-currency, and VAT-aware billing operations are embedded into core functionality for global support.
- Custom dependency injection and service containers in Symfony and Vue enhance code modularity and extensibility.