Billing Controller
The Billing Controller provides comprehensive financial management capabilities including subscription management, payment processing, credit operations, and billing analytics for the VChata platform.Base Path
Overview
This controller provides complete financial management capabilities:- 💳 Subscription Management - Start, pause, cancel, and modify subscriptions
- 💰 Credit Operations - Purchase, refill, and auto-refill credit balances
- 🔒 Payment Methods - Secure payment method management (add, update, remove)
- 📊 Usage Analytics - Detailed usage analytics and reporting
- 🧾 Transaction History - Complete transaction and invoice history
- 📈 Billing Insights - Real-time billing insights and forecasting
Authentication & Authorization
- 🔐 All endpoints require valid JWT authentication token
- 👥 Most operations restricted to OWNER or ADMIN roles
- 🏢 All operations scoped to user’s current organization
Rate Limiting
- 📊 Standard endpoints: 100 requests/minute per user
- 📈 Reporting endpoints: 20 requests/minute per user
- 💳 Payment operations: 10 requests/minute per user
Billing Setup
Setup Billing
- User must have OWNER or ADMIN role in the organization
- Organization must not already have billing setup
- Valid email and name are required for Stripe customer creation
Payment Methods
Add Payment Method
List Payment Methods
Delete Payment Method
Set Default Payment Method
Setup Intents
Create Setup Intent
Subscriptions
Get Subscription
Create Subscription
Cancel Subscription
Pause Subscription
Resume Subscription
Credit Management
Get Balance
Purchase Credits
Usage Analytics
Get Usage
Generate Usage Report
Transaction History
Get Transactions
Get Invoices
Auto-Refill Settings
Configure Auto-Refill
Get Auto-Refill Settings
Error Responses
Common Errors
Integration Notes
- 💎 Powered by Stripe - Secure payment processing
- 🔢 USD Currency - All monetary amounts in USD with 2 decimal precision
- 📅 ISO 8601 Timestamps - All timestamps in UTC format
- 🏷️ Metadata Tracking - Comprehensive tracking for all operations
- 💯 Atomic Operations - All financial operations are atomic
- 🔄 Automatic Retry - Built-in retry mechanisms for transient failures
- 📝 Audit Trails - Complete audit trails for all billing activities