More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Billing Automation: Subscriptions and Dunning

    1

    Build recurring billing that stops leaking money: an explicit subscription state machine, dunning that recovers failed payments, correct proration, and reconciliation that catches lost webhooks.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Billing Automation: Subscriptions and Dunning

    Billing Automation: Subscriptions and Dunning

    Example session with this skill installed

    We sell a $29/seat/month SaaS plan. Design the billing: mid-cycle seat changes, what happens when a renewal payment fails, and how we catch billing mistakes before customers do.

    • Read your context and instructions
    • Compiled the billing automation

    BILLING DESIGN — produced by applying the skill.

    State machine: trial (14 days) → active → past_due → canceled; paused available from active. Every transition writes an event row, so any subscription's history is traceable. State and access are separate axes: a subscription enters past_due on the first failed charge, but access degrades on the dunning schedule, not instantly.

    Mid-cycle change: on day 18 of 30, a customer grows 10 → 14 seats. Proration = 4 seats × $29 × (12/30) = $46.40, charged immediately as a line item that shows its math: "4 seats added: 12 of 30 days × $29 = $46.40." Downgrades credit the account balance instead of refunding the card.

    Failed renewal: day 1 retry fails and the customer gets one short email — what happened, which card (last four), one link to fix it. Day 3 retry fails silently. Day 7 retry succeeds: the subscription exits dunning in the same transaction, full access restores, and the recovery is logged. If day 14 also failed, day 21 cancels. The recovery-rate dashboard tracks what fraction of past_due accounts return to active; this quarter's 61% is the number the schedule gets tuned against.

    Catching mistakes: webhook handlers are idempotent by event ID and signature-verified. A nightly job diffs local subscriptions against the provider's list. In its first week it catches a subscription canceled at the provider but still active locally — a webhook lost during a deploy — and corrects the cache before that customer is billed for a canceled plan.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Billing code fails in boring ways, and every boring failure is revenue walking away: a proration computed wrong, a dunning email that never fired, a webhook lost during a deploy so a canceled customer gets billed again. This skill designs subscription billing as a system instead of a pile of callbacks. It starts with the subscription state machine — trial, active, past_due, canceled, paused — drawn before any code, with past_due as a real state carrying its own clock and every transition logged so "how did this subscription get here?" is always answerable. Dunning is built as a recovery pipeline, not a cron job: a retry schedule kept as data (days 1, 3, 7, 14, cancel at 21), a customer email at first failure, access that degrades in communicated steps instead of vanishing, and a measured recovery rate so you know whether the pipeline works or is decorative. Proration is settled once — the formula, upgrades charged immediately, downgrades credited to the balance, per-seat-day math for team plans, and the arithmetic printed on the invoice where it prevents support tickets. Tax is a pipeline with its inputs stored per invoice, not a constant in a config file. Webhooks are treated as unreliable by design: idempotent handlers, signature verification, out-of-order tolerance, and a nightly reconciliation job that diffs your records against the provider's — the diff report is the most valuable artifact in the system. Finally, everything is exercised with a test clock, because billing bugs hide in time and paths you cannot fast-forward get debugged by real customers at 2am. You get the full protocol, an eight-item launch checklist, a 20-point design review rubric, and a worked example that runs a seat increase, a failed renewal, a dunning recovery, and a reconciliation catch end to end.

    • It designs the billing system; it is not tax advice. Jurisdiction-specific nexus and rate questions still need your tax provider's data and, for edge cases, an accountant.
    • Recovery rates and the right dunning cadence vary by market and price point — the skill gives you the pipeline and the measurement, but your own recovery data has to tune the schedule.
    • Usage-based metering with high event volume needs its own aggregation design; this skill covers the subscription lifecycle around it, not meter ingestion at scale.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 24 days ago

    Permissions

    No special permissions declared or detected

    Listed24 days ago
    Updated21 days ago

    What's inside

    Frequently Asked Questions

    Because "working" means the ones that arrived were processed. Webhooks get lost during deploys, outages, and endpoint changes, and a lost cancel or payment event silently corrupts your records. The nightly diff against the provider's list is how you find out before a customer does.

    Refunds cost processing fees, create accounting churn, and end the relationship signal. A balance credit applies automatically to the next invoice, keeps the customer whole, and measurably reduces downgrade-to-cancel flow. The customer is never out money; it is spent on the next cycle instead of returned and re-charged.

    When the recovery curve flattens. With the schedule as data and the recovery rate measured per step, you can see which retry day actually recovers accounts and which only delays cancellation. Most products find the value in the first two weeks; the skill's schedule ends at day 21 for that reason.

    New in APIs & Backend