| id | SKL-billing-BILLINGCYCLES |
| name | Billing Cycles |
| description | This skill provides comprehensive patterns for managing billing cycles in subscription-based applications. It covers billing cycle types (monthly, yearly, weekly, custom), proration logic for plan cha |
| version | 1.0.0 |
| status | active |
| owner | @cerebra-team |
| last_updated | 2026-02-22 |
| category | Backend |
| tags | ["api","backend","server","database"] |
| stack | ["Python","Node.js","REST API","GraphQL"] |
| difficulty | Intermediate |
Billing Cycles
Skill Profile
(Select at least one profile to enable specific modules)
Overview
This skill provides comprehensive patterns for managing billing cycles in subscription-based applications. It covers billing cycle types (monthly, yearly, weekly, custom), proration logic for plan changes, billing date handling, grace periods, dunning management for failed payments, automated billing jobs, and billing notifications.
Why This Matters
- Revenue Accuracy: Proper proration ensures fair billing for plan changes
- Customer Retention: Grace periods and dunning management reduce churn
- Automation: Automated billing jobs reduce manual overhead
- Compliance: Proper billing records support audit requirements
Core Concepts & Rules
1. Core Principles
- Follow established patterns and conventions
- Maintain consistency across codebase
- Document decisions and trade-offs
2. Implementation Guidelines
- Start with the simplest viable solution
- Iterate based on feedback and requirements
- Test thoroughly before deployment
Inputs / Outputs / Contracts
- Inputs:
- Environment variables:
STRIPE_SECRET_KEY, DATABASE_URL, BILLING_TIMEZONE
- Configuration: billing cycle types, retry intervals, grace period days
- Database schema: subscriptions, invoices, payments, dunning_attempts
- Entry Conditions:
- Database tables created for billing
- Payment gateway configured (Stripe, PayPal, etc.)
- Cron job scheduler available
- Outputs:
- Generated invoices
- Payment status updates