| name | billing-automation |
| description | Build automated billing systems for recurring payments, invoicing, subscription lifecycle, and dunning management. Use when implementing subscription billing, automating invoicing, or managing recurring payment systems. |
| zh_description | 用于构建订阅计费、自动开票、续费生命周期和催收管理流程。 |
| version | 1.0.1 |
| author | seaworld008 |
| source | github:wshobson/agents |
| source_url | https://github.com/wshobson/agents/blob/main/plugins/payment-processing/skills/billing-automation/SKILL.md |
| license | MIT |
| tags | ["automation", "billing", "workflow"] |
| created_at | 2026-05-28 |
| updated_at | 2026-06-29 |
| quality | 3 |
| complexity | intermediate |
Billing Automation
Master automated billing systems including recurring billing, invoice generation, dunning management, proration, and tax calculation.
When to Use This Skill
- Implementing SaaS subscription billing
- Automating invoice generation and delivery
- Managing failed payment recovery (dunning)
- Calculating prorated charges for plan changes
- Handling sales tax, VAT, and GST
- Processing usage-based billing
- Managing billing cycles and renewals
Core Concepts
1. Billing Cycles
Common Intervals:
- Monthly (most common for SaaS)
- Annual (discounted long-term)
- Quarterly
- Weekly
- Custom (usage-based, per-seat)
2. Subscription States
trial → active → past_due → canceled
→ paused → resumed
3. Dunning Management
Automated process to recover failed payments through:
- Retry schedules
- Customer notifications
- Grace periods
- Account restrictions
4. Proration
Adjusting charges when:
- Upgrading/downgrading mid-cycle
- Adding/removing seats
- Changing billing frequency
Quick Start
from billing import BillingEngine, Subscription
billing = BillingEngine()
subscription = billing.create_subscription(
customer_id="cus_123",
plan_id="plan_pro_monthly",
billing_cycle_anchor=datetime.now(),
trial_days=14
)
billing.process_billing_cycle(subscription.id)
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Implementation Checklist
Before building or changing billing logic, capture:
- Product catalog: plan ids, prices, currency, billing interval, trial rules, and included usage.
- Customer lifecycle: signup, trial conversion, renewal, pause, resume, cancellation, and reactivation.