# Stripe SaaS Billing Pack

> Eight agent skills that build Stripe subscriptions correctly on stripe-node 23: Checkout, portal, webhooks, DB sync, entitlements, usage, tax, dunning, tests.

Stripe SaaS Billing Pack is a paid AI agent skill on Agensi by Abdalkader Alhamoud, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $29 (one-time purchase)
- Creator: [Abdalkader Alhamoud](https://www.agensi.io/creators/abdalkaderdev)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.0
- Last updated: 2026-10-13
- Security: scan passed (2026-10-13); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/stripe-saas-billing-pack
- Tags: api, stripe, saas, node-js, next-js, database, subscriptions, webhooks

## About this skill

AI agents write Stripe code from 2023. On today's stripe-node 23 and API `2026-09-30.endive` that code fails: `payment_method_types: ['card']` is rejected, `require('stripe')(key)` no longer constructs a client, `subscription.current_period_end` is undefined, `ui_mode: 'hosted'` errors, `createUsageRecord` is gone. Worse, the parts that compile are wrong in production: access granted on the success page, webhook handlers that parse JSON before verifying the signature, no dedupe, a late `customer.subscription.created` overwriting a cancellation, a staging endpoint on `invoice.created` that delays every renewal by 72 hours.

This pack gives the agent the current rules and working code, checked against the Stripe API changelog, docs.stripe.com and the stripe-node 23 types, typechecked with `tsc --strict` and run against stripe-mock and Postgres.

### What's inside

- **stripe-saas-billing**: architecture, pre-flight questions, go-live checklist, routing.
- **stripe-node-current**: v21, v22, v23 breaking changes and every billing API change since basil.
- **stripe-subscriptions-checkout**: catalog with lookup keys, Checkout Session route, success page, customer portal as code, trials, proration previews, downgrades at period end, cancel, pause.
- **stripe-webhooks-prod**: raw-body verification for Next.js App Router, Pages Router, Express, Fastify, Hono and Workers, the events a SaaS must handle, dedupe, ordering, retries, thin events, `stripe listen`.
- **stripe-subscription-sync**: Postgres schema, fetch-latest sync under advisory locks, entitlements, access per status, Supabase RLS, nightly reconciliation.
- **stripe-usage-billing**: Billing Meters vs Metronome, metered prices, idempotent meter events, v2 streams.
- **stripe-tax-dunning**: Stripe Tax without the silent zero-tax trap, Smart Retries, hard declines, recovery emails, `past_due` UX.
- **stripe-billing-testing**: test clock simulation script, test cards, stripe-mock CI, pre-launch matrix.

### Scripts included

`webhook-doctor.mjs` probes a running endpoint with signed, forged, stale and duplicate deliveries and scans a codebase for missing lifecycle events and stale API usage. `sync-check.mjs` diffs your subscription table against Stripe and flags access leaks. Both are zero-dependency Node.

### Versions

stripe-node 23.x (API `2026-09-30.endive`), Node.js 20+, Next.js 16, Postgres. Works with Claude Code, Codex, Gemini CLI and Cursor.

## Requires

- tsx
- Node.js

## Known limitations

Requires Node.js 20+ and stripe-node 23. Examples are tailored for Next.js 16 and Postgres/Supabase. Does not support legacy API versions prior to 2026-09-30.endive.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Stripe SaaS Billing Pack skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill differ from just asking a standard LLM to write Stripe code?

This skill provides a production-ready architectural framework for Stripe, specifically handling complex logic like idempotent webhook synchronization, database state locking, and modern API version pinning that generic prompts often get wrong.

### What specific tech stack and versions are required to use this skill effectively?

It is optimized for Node.js 20+, Next.js 16 (App Router), and Postgres/Supabase, and it requires the stripe-node v23 SDK to function as intended.

### Does this support advanced billing models like usage-based pricing or tax collection?

Yes, the skill includes specialized logic for usage-based meters, automatic tax collection, and dunning cycles to ensure your SaaS can scale beyond simple flat-rate subscriptions.

### What workflow does the skill follow to ensure a bug-free integration?

The skill provides a specialized router and a two-stage checklist system (pre-flight and go-live) to guide you through secure session creation and verified webhook implementation.

### What is included in the package to help with testing and deployment?

A test clock simulation script for renewals, trials and failed payments, test card scenarios, a stripe-mock setup for CI, a webhook probe that sends signed, forged, stale and duplicate deliveries, and a pre-launch matrix to run before switching to live keys.

### How does this skill prevent common issues like double-billing or orphaned subscriptions?

By using idempotent webhook handlers and advisory locks, the skill ensures your Postgres database accurately reflects the subscription state even if Stripe sends multiple events or if network latency occurs.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
