Stripe Billing Scaffold

    2

    Production Stripe billing in one shot. Subscriptions, metered usage, webhooks, customer portal, tax, fraud. 12 patterns, TS+Python.

    Free

    7 usesSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    stripe-billing-scaffold

    Example session with this skill installed

    Build a Next.js subscription system with a 14-day trial, Stripe Tax for EU customers, and a webhook handler for plan changes.

    • Read your context and instructions
    • Compiled the stripe-billing-scaffold

    Generated

    1. /api/checkout/route.ts (Trial + Tax config)
    2. /api/webhooks/route.ts (Idempotent events)
    3. /lib/stripe.ts (Client init)
      Security Audit: Passed (webhook signatures enabled).

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

    About this skill

    Stripe Billing Scaffold

    Stop reading 600 pages of Stripe docs. This skill scaffolds a production-ready billing system in one shot — covering the 80% of cases that take 80% of the time.

    What it does

    Generates and explains the code for:

    • Subscriptions — recurring billing with trials, proration, plan changes
    • Metered usage — pay-per-API-call, storage GB-hour, etc.
    • One-time payments — Checkout Sessions, Payment Intents
    • Customer Portal — self-service plan changes, invoices, payment methods
    • Webhooks — 12 critical events handled with idempotency
    • Tax — Stripe Tax with automatic calculation
    • Multi-currency — present in local currency, settle in your currency
    • Coupons / discounts — first-purchase, recurring, duration
    • Invoice customization — branding, line items, custom fields
    • Refunds & disputes — auto-handle chargebacks
    • Fraud — Radar rules, 3DS, manual review queue
    • Reporting — MRR, churn, LTV, cohort analysis

    Output: TypeScript (Node + Next.js) and Python (FastAPI) starter projects, plus a 60-item security checklist.

    When to use it

    • You're building a SaaS and need to add billing
    • Your current Stripe integration is buggy and you want a reference
    • You need to add subscriptions to an existing product
    • You're launching internationally and need tax + multi-currency
    • An auditor is asking "how do you handle failed payments?"
    • You want to meter usage for AI/API products

    Why it's better than ad-hoc prompting

    Most "integrate Stripe" prompts give toy examples with no error handling. This skill is different:

    • Production patterns — every snippet includes idempotency, retries, error handling
    • 12 patterns — covers edge cases most tutorials skip
    • TypeScript + Python — language-agnostic concepts, idiomatic code
    • Security checklist — 60 items (PCI scope, secret rotation, webhook signatures)
    • Real edge cases — failed payments, disputes, plan downgrades mid-cycle

    Architecture

    ┌─────────────────────────────────────────────────────────┐
    │               Agent (Claude/Cursor)                     │
    │  - Asks for billing requirements                        │
    │  - Generates code from templates                        │
    │  - Walks through security checklist                     │
    └───────────────┬─────────────────────────────────────────┘
                    │
                    ▼
    ┌─────────────────────────────────────────────────────────┐
    │            skills/stripe-billing-scaffold/              │
    │  scripts/                                                │
    │    ├── scaffold.py        # Generate starter project     │
    │    ├── webhook_handler.py # Production webhook handler  │
    │    ├── metered_usage.py   # Track + bill usage          │
    │    ├── tax_calc.py        # Stripe Tax integration      │
    │    └── check_security.py  # 60-item audit               │
    │  references/                                             │
    │    ├── 12-patterns.md     # All patterns explained      │
    │    ├── webhook-events.md  # 12 critical events          │
    │    ├── subscription-lifecycle.md                          │
    │    ├── metered-usage-guide.md                            │
    │    ├── tax-and-compliance.md                             │
    │    └── security-checklist.md                             │
    │  templates/                                              │
    │    ├── typescript/        # Next.js + Stripe SDK        │
    │    └── python/            # FastAPI + Stripe SDK         │
    └─────────────────────────────────────────────────────────┘
    

    Quick start

    # 1. Install
    pip install stripe
    
    # 2. Generate a starter
    python scripts/scaffold.py --lang typescript --framework nextjs --out myapp/
    python scripts/scaffold.py --lang python --framework fastapi --out myapp/
    
    # 3. Audit your existing integration
    python scripts/check_security.py ./src/
    
    # 4. Webhook handler ready to copy
    cp templates/typescript/webhooks/stripe.ts src/app/api/webhooks/stripe/route.ts
    

    The 12 patterns

    #PatternUse case
    1Checkout SessionHosted payment page (one-time)
    2Subscription createRecurring plans with trial
    3Metered usagePay per API call / GB / hour
    4Plan upgrade/downgradeMid-cycle, with proration
    5Customer PortalSelf-service plan mgmt
    6Webhook handler12 events, idempotent, retried
    7Stripe TaxAuto-calc + collect per region
    8Multi-currencyShow local, settle in USD
    9Coupon engineFirst-purchase, % off, fixed off
    10DunningSmart Retries, recovery emails
    11Refund / disputeAuto-respond to chargebacks
    12Revenue recognitionFor SaaS metrics + accounting

    The 60-item security checklist (top items)

    • API keys in env vars, never in code
    • Webhook signature verification on every event
    • Idempotency keys on all POST requests
    • Restricted API keys (different per service)
    • PCI scope: never touch card data directly
    • HTTPS only, HSTS, secure cookies
    • 3DS for high-risk transactions
    • Webhook handler is idempotent (event ID dedup)
    • Webhook handler returns 2xx within 5s
    • Long work moved to background queue
    • Failed payments trigger dunning workflow
    • Stripe Radar enabled with custom rules
    • Test mode keys never in production
    • Secret rotation every 90 days
    • Audit log all financial operations
    • ...50 more

    Pricing

    Single-purchase, lifetime access. $15.00.

    Includes:

    • 5 Python scripts (scaffold, webhook, metered, tax, security audit)
    • 6 reference docs (12 patterns, webhooks, lifecycle, metered, tax, security)
    • 2 starter projects (TypeScript Next.js + Python FastAPI)
    • 60-item security checklist
    • Future updates for the same major version

    Example usage

    "I have a Next.js SaaS. Add subscriptions with a 14-day trial and metered API usage. Use Stripe Tax for EU customers."

    The skill will:

    1. Generate the Next.js route handlers (/api/checkout, /api/webhooks/stripe, /api/portal)
    2. Generate the database schema (users, subscriptions, usage_records)
    3. Generate the customer portal link
    4. Configure Stripe Tax
    5. Output a STRIPE_SETUP.md walkthrough

    Compatibility

    Works with any agent that supports the SKILL.md standard and can execute Python: Claude Code, OpenClaw, Codex CLI, Cursor, Gemini CLI, Cline, Windsurf, Aider. Code is framework-agnostic; reference implementations for Next.js + FastAPI included. Tested on Linux, macOS, Windows.

    Tags

    stripe, billing, payments, subscriptions, saas, fintech, backend, ecommerce

    • Focused exclusively on Stripe: no support for PayPal or Lemon Squeezy.
    • Requires Python 3.8+ to run local scaffolding and audit scripts.

    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

    7 uses

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 4 months ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Listed4 months ago

    What's inside

    Frequently Asked Questions

    This skill provides production-grade code scaffolds, security scripts, and reference patterns for Stripe, handling complex edge cases like idempotent webhooks, metered usage, and global tax compliance that basic AI prompts often miss.

    The purchase includes five Python integration scripts, two complete starter projects for TypeScript (Next.js) and Python (FastAPI), six comprehensive reference guides, and a 60-item security audit checklist.

    Yes, the skill includes specific patterns for metered billing (pay-per-use) and automatically handles mid-cycle plan changes with proration and localized Stripe Tax calculations.

    It is compatible with any AI agent that can execute Python scripts and follow the SKILL.md standard, including Cursor, Claude Code, Aider, Windsurf, and Cline.

    The skill includes a 60-item security audit script and checklist covering PCI scope, webhook signature verification, and secret rotation to ensure your integration is ready for production and audits.

    You receive lifetime access and all future updates for the current major version, ensuring your integration stays current with the latest Stripe API changes and security best practices.

    New in APIs & Backend

    Free