Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Subscription Billing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-subscription-billing-anvil)
---
name: subscription-billing
description: Design resilient SaaS subscription lifecycles handling upgrades, downgrades, proration, trials, grace periods, and dunning
---
<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->
# Subscription billing
Use when building recurring SaaS plan management, seat updates, entitlement gating, or payment recovery flows.
## State and entitlements
- Drive user entitlements strictly from verified subscription status and period-end timestamps synced from the billing provider—never trust frontend plan flags.
- Define explicit state transitions (`trialing`, `active`, `past_due`, `canceled`, `paused`) and separate soft grace-period access from hard cancellation.
- Schedule tier downgrades or seat reductions for the end of the billing cycle unless explicitly opting into immediate proration credits.
## Dunning and sync
- Combine webhook event handlers (handling out-of-order delivery cleanly via provider event timestamps/versions) with periodic API reconciliation jobs.
- Surface clear billing-portal update banners during `past_due` smart retry windows before revoking access abruptly.
## Verify
Test mid-cycle upgrades, end-of-cycle downgrades, expired trials, payment failure recovery, and duplicate/out-of-order webhook updates.