How getlago/lago-api works
Lago API is an open-source billing platform for usage-based and subscription billing. Its central product flow accepts billing configuration and usage events, evaluates subscriptions and pricing, and produces invoices and payment outcomes; the tree also shows analytics, customer self-service, catalog management, and integrations. The graph reflects those documented capabilities, but most domain links are necessarily broad: sampled excerpts are concentrated on invoice preview and webhook querying, and the README does not specify detailed request routing or event dispatch.
Main entry points: invoices Invoices · subscriptions Subscriptions · events_controller.rb Usage events · api REST API
Components 20
API and access
- REST API
app/controllers/api - GraphQL API
app/graphql - Customer portal
app/graphql/mutations/customer_portal
Billing lifecycle
- Subscriptions
app/graphql/mutations/subscriptions - Invoices
app/graphql/mutations/invoices - Invoice preview
app/services/invoices - Preview context
app/services/invoices/preview_context_service.rb - Coupon preview
app/services/coupons/preview_service.rb - Payments
app/graphql/mutations/payments - Wallets and credits
app/graphql/mutations/wallets
Catalog and contracts
- Pricing and fees
app/graphql/mutations/charges - Plans and products
app/graphql/mutations/plans
Events and integrations
- Usage events
app/controllers/api/v1/events_controller.rb - Webhook endpoints
app/queries/webhook_endpoints_query.rb - Webhook history query
app/queries/webhooks_query.rb - Webhook records
app/models/webhook.rb - Webhook delivery
app/jobs/send_webhook_job.rb
Analytics and reporting
- Billing analytics
app/graphql/resolvers/analytics
Other components
- Customer or operator
- External billing services
Connections 18
- Customer or operator → REST API: sends billing requests
- Customer or operator → GraphQL API: manages billing
- Customer or operator → Customer portal: uses self-service
- REST API → Usage events: submits usage
- Usage events → Subscriptions: supports usage billing
- Subscriptions → Pricing and fees: applies pricing
- Plans and products → Subscriptions: defines subscription options
- Subscriptions → Invoices: supports subscription billing
- Usage events → Invoices: supports usage billing
- Invoices → Invoice preview: previews invoices
- Invoice preview → Preview context: builds preview context
- Preview context → Coupon preview: provides applied coupons
- Invoices → Payments: supports payment collection
- Customer portal → Wallets and credits: manages wallet activity
- Invoices → Billing analytics: informs billing analytics
- Webhook history query → Webhook records: queries records
app/queries/webhooks_query.rb - Webhook endpoints → External billing services: configures delivery targets
- Webhook delivery → External billing services: delivers events