billing-automation

Implement recurring billing, invoicing, dunning, proration, and tax calculation for subscription systems.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill billing-automation-sanketadlak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: billing-automation
Source: https://github.com/SanketAdlak/PDMProjectDesign/tree/main/.agents/skills/billing-automation
Command: npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill billing-automation-sanketadlak

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires stripe, reportlab.

What problem does it solve? Building subscription billing from scratch involves complex logic for recurring charges, failed payment recovery, mid-cycle plan changes, and multi-region tax rules. This Skill provides implementation patterns and code for the entire billing lifecycle so you avoid common pitfalls in revenue-critical systems. ## Core Features & Use Cases - Subscription Lifecycle Management: Model states from trial through active, past_due, paused, and canceled with billing cycle processing. - Dunning Management: Automate failed payment recovery with configurable retry schedules and staged customer email notifications. - Proration & Tax Calculation: Compute prorated charges for plan or seat changes and apply sales tax, VAT, or GST by jurisdiction. - Use Case: A SaaS company needs to charge customers monthly, retry failed cards on a 3/7/14-day schedule, and prorate upgrades mid-cycle. Use this Skill to implement the billing engine, dunning workflow, and proration calculator. ## Quick Start Ask the AI to implement a subscription billing engine with dunning retries and proration for a monthly SaaS plan using the patterns in this Skill.

Frequently Asked Questions about billing-automation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement recurring subscription billing in Python?

Create a Subscription class tracking status, current period start and end dates, then run a billing cycle processor that generates an invoice, charges the customer's saved payment method, and advances the period on success. On failure, mark the subscription past_due and start dunning.

How to handle failed payments with dunning management?

Use a retry schedule such as 3, 7, and 14 days after the initial failure, sending a notification email at each step. If payment succeeds, reactivate the subscription; if all retries are exhausted, cancel the subscription and notify the customer.

How do I calculate proration for mid-cycle plan changes?

Divide each plan's amount by total days in the period, then multiply by remaining days to get the unused credit on the old plan and the charge for the new plan. The net proration is the new plan charge minus the old plan credit.

Does this billing approach support usage-based pricing?

Yes, usage records are tracked per customer and aggregated over the billing period. Charges can be computed with per-unit, tiered, or volume pricing models and added as invoice line items alongside the base subscription fee.

How is sales tax, VAT, or GST calculated on invoices?

Tax jurisdiction is determined from the customer's country and state, then a rate lookup applies the appropriate percentage to the invoice subtotal. US states use sales tax, EU countries use VAT, and Australia uses GST.

What are the limitations of this billing implementation?

The code provides patterns rather than a production service: PDF generation, VAT number validation, and payment processor integration are stubbed. You must connect a real payment gateway like Stripe and persist subscription and invoice state in a database.