This chapter covers the core features and capabilities of Subscription Billing.
# Run the full lifecycle demo
python src/subscription_billing.py --action demo
# Create plans
python src/subscription_billing.py --action create-plan --name "Pro" --price 4999 --interval month
# Create a subscription with trial
python src/subscription_billing.py --action subscribe --customer cus_001 --plan plan_pro
# Upgrade plan with proration
python src/subscription_billing.py --action change-plan --sub-id sub_abc --new-plan plan_enterprise
# View dunning schedule
python src/subscription_billing.py --action dunning-scheduleFollow this guide to get Subscription Billing up and running in your environment.
| Flag | Description |
|---|---|
--action, -a | Action to perform (required) |
--name | Plan name |
--price | Plan price in cents (4999 = $49.99) |
--interval | Billing interval: month, year, week |
--customer | Customer ID |
--plan | Plan ID |
--sub-id | Subscription ID |
--new-plan | New plan ID for upgrades/downgrades |
--no-trial | Skip trial period |
--immediate | Cancel immediately instead of at period end |
--reason | Cancellation reason |
--data-dir | Data storage directory (default: ./billing_data) |
| Day | Action | Description |
|---|---|---|
| 0 | retry | Immediate retry — often temporary |
| 3 | email_reminder | Update your payment method |
| 7 | retry | Second retry attempt |
| 10 | final_warning | Subscription will cancel in 4 days |
| 14 | cancel | All retries exhausted |
Get the full Subscription Billing and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.