Stripe Integration Expert
Production-grade Stripe integrations: subscriptions with trials and proration, one-time payments, usage-based billing, checkout sessions, idempotent webhook handlers, customer portal, and invoicing.
Before & after
Same prompt, same agent — the only difference is the skill.
Stripe subscriptions are well-documented. You'll need to create a subscription, handle the trial period, and then track usage for metering. Do you have a specific framework you're using – Next.js, Express? What does your usage look like – per API call, per user seat? I can point you to the Stripe documentation, but implementing it involves several pieces and the details matter a lot for getting billing right. What are your specific requirements?
STRIPE INTEGRATION: Subscriptions + Trials + Usage-Based Billing
→ CORE COMPONENTS (build in this order)
1. Create customer (idempotent key: customer_id from your DB)
2. Create subscription (trial 14 days, plan ID from config)
3. Meter usage (track daily API calls via /v1/meter_events)
4. Invoice on usage (monthly, calculated from meter events)
5. Webhook handler (idempotent: check event ID before processing)
→ SUBSCRIPTION FLOW CODE SKELETON
const subscription = await stripe.subscriptions.create({
customer: customer_id,
items: [{ price: 'price_standard_monthly' }],
trial_period_days: 14,
trial_settings: { end_behavior: { missing_payment_method: 'cancel' } }
});
Trap: Always include trial_end_behavior (auto-cancel on failed payment, not force-bill)
Trap: Store subscription_id in your DB immediately (webhook may fire before create() returns)
→ USAGE METERING (per-customer API calls)
POST /v1/billing.meter_events
Payload: { event_name: 'api_calls', customer_id: cust_xxx, quantity: 47, timestamp: now }
Schedule: Aggregate daily, send once per day (avoid 1000s of small events)
Idempotence: Use idempotency_key = md5(customer_id + date) (prevents double-counting)
→ WEBHOOK HANDLER (production-critical)
Events to handle:
customer.subscription.trial_will_end (14 days in – remind to update payment method)
invoice.payment_failed (charge failed – mark account, 3-retry window)
charge.dispute.created (customer dispute – alert team immediately)
Trap: Process webhooks exactly once – check DB for event_id before acting
Retry logic: Webhook delivery retry window 24 hours; queue failed webhooks for manual review
→ CUSTOMER PORTAL (self-service)
Redirect from your app: stripe.billingPortal.sessions.create({ customer_id })
Users can: Update payment method, view invoices, download receipts, cancel subscription
Configure: Set cancellation reason categories (allows feedback)
→ DEPLOYMENT CHECKLIST
✓ Webhook signing key validated (stripe.webhooks.constructEvent with secret)
✓ Idempotent customer creation tested (same email on retry = same customer_id)
✓ Trial end edge case: Verify no charge if trial ends without payment method
✓ Usage metering: Backfill test customer with dummy events, verify invoice generated
✓ Live mode: Start with 5 test customers, verify end-to-end before launch
✓ Monitoring: Track webhook latency + failure rate per event type
Go-live: Start with 10% of signups for 1 week, then 100%About this skill
name: stripe-integration-expert description: Use when Production-grade Stripe integrations: subscriptions with trials and proration, one-time payments, usage-based billing, checkout sessions, idempotent webhook handlers, customer portal, and invoicing.
Stripe Integration Expert
Production-grade Stripe integrations: subscriptions with trials and proration, one-time payments, usage-based billing, checkout sessions, idempotent webhook handlers, customer portal, and invoicing. Covers Next.js, Express, and Django patterns. Use when integrating Stripe for the first time, debugging webhook reliability issues, migrating from a different payment provider, or adding usage-based billing to an existing subscription product.
What you get
- Public GitHub repo (alirezarezvani/claude-skills)
- the stripe-integration-expert skill folder with SKILL.md. Part of a 337-skill / 30-agent / 70-command install.
Customize your output
- Fork the repo and adapt the skill's instructions and references to your workflow.
Example output
Activates automatically when your request matches Stripe Integration Expert; chains with the other skills, agents, and commands in the collection.
Best for
Creators, builders, and teams using Claude Code.
SKILL.md preview
---
name: stripe-integration-expert
description: Use when integrating Stripe for the first time, debugging webhook reliability, migrating from another payment provider, or adding usage-based billing to an existing subscription product.
version: 1.0.0
category: Development / Engineering
author: AgentVolt
license: proprietary
tags:
- development
- engineering
---
# Stripe Integration Expert
Covers production-grade Stripe patterns: subscriptions, one-time payments, usage-based billing, checkout, webhooks, customer portal, and invoicing.
## When to use
- Setting up subscriptions with trials and proration for the first time
… (sign up to view the full skill)More development skills
View all Development skills →Generate
Scaffold code, tests, and boilerplate from a short spec.
Performance Profiler
Systematic performance profiling for Node.js, Python, and Go applications.
Threat Detection
Use when hunting for threats in an environment, analyzing IOCs, or detecting behavioral anomalies in telemetry.
Agent Harness
Turns a domain folder of skills into a bounded agentic loop: compile a goal into a task plan, execute with the domain's tools, verify every task, retry within a budget.