mcpField
B
billing-automation

billing-automation

github.com/wshobsonOther41.9k11.4k installsUpdated 2w ago
Repository

About billing-automation

A guide to automated billing systems for teams implementing subscriptions and payment operations. It covers recurring charges, invoices, failed-payment recovery, proration, tax, and usage-based billing patterns.

Key features

  1. 01Recurring billing and billing cycles
  2. 02Invoice generation and delivery
  3. 03Failed-payment recovery workflows
  4. 04Proration for subscription changes
  5. 05Tax calculation concepts
  6. 06Usage-based billing patterns

Use cases

  1. 01Implementing SaaS subscription billing
  2. 02Automating invoice handling
  3. 03Recovering failed subscription payments
  4. 04Calculating mid-cycle plan or seat changes

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/wshobson/agents --skill billing-automation

After installing, type/billing-automationin Claude Code to confirm it loaded.

Bundled filesreferences/details.md

Details

From the project README

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

# Initialize billing engine
billing = BillingEngine()

# Create subscription
subscription = billing.create_subscription(
    customer_id="cus_123",
    plan_id="plan_pro_monthly",
    billing_cycle_anchor=datetime.now(),
    trial_days=14
)

# Process billing cycle
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.

Comments

Markdown supported