subscription-billing

Reconcile Stripe webhook events to maintain authoritative subscription state.

19|2|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/bonnguyenitc/antigravity-superpowers --skill subscription-billing-bonnguyenitc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: subscription-billing
Source: https://github.com/bonnguyenitc/antigravity-superpowers/tree/main/.agent/skills/subscription-billing
Command: npx skills add https://github.com/bonnguyenitc/antigravity-superpowers --skill subscription-billing-bonnguyenitc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Billing systems commonly suffer from inconsistent subscription state, revenue loss, and fragile retry logic because servers trust API responses instead of webhook confirmations, lack idempotency, and mishandle failed payments. This Skill provides patterns and guardrails to prevent incorrect charges, accidental access revocation, and billing-related outages.

Core Features & Use Cases

  • Webhook-first architecture: treat Stripe webhooks as the source of truth and update the database only after webhook confirmation.
  • Idempotent handlers & signature verification: persist processed event IDs, verify signatures, and tolerate retries without double-processing.
  • Trial, proration, and dunning flows: implement trial conversion rules, mid-cycle upgrades/downgrades, and staged failed-payment recovery with grace periods.
  • Operational best practices: use event.created for timestamps, avoid storing card data, and keep price IDs configurable via env or DB.

Quick Start

Use the subscription-billing skill to implement idempotent Stripe webhook handlers, verify webhook signatures, and build a dunning flow that preserves access while recovering failed payments.

Frequently Asked Questions about subscription-billing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make Stripe webhook handlers idempotent to prevent duplicate subscription updates?

Idempotent webhook processing requires persisting processed event IDs and verifying Stripe webhook signatures to tolerate retries without double-processing. This prevents duplicate subscription state updates and incorrect charges.

Why should subscription billing systems trust Stripe webhooks over API responses?

Subscription billing systems should treat Stripe webhooks as the source of truth because API responses can be premature or inconsistent. Updating your database only after webhook confirmation ensures authoritative subscription state and prevents revenue loss from failed payment dunning flows.

How do I handle proration and trials during mid-cycle subscription upgrades and downgrades?

Handling proration and trials during mid-cycle subscription upgrades and downgrades requires tracking webhook events for invoice changes and trial conversion rules. Your SaaS backend updates subscription state only after receiving these webhook confirmations to maintain accurate billing.

What is the best way to build a dunning flow for failed subscription payments?

The best way to build a dunning flow for failed subscription payments is to implement staged failed-payment recovery with grace periods. This approach preserves user access while attempting to recover failed charges through automated retry logic triggered by webhook events.

Does subscription billing with webhooks require storing customer card data?

Subscription billing with Stripe webhooks does not require storing customer card data. You should avoid storing card data entirely and instead rely on Stripe's secure tokenization, using event-created timestamps for clocking and database-driven state updates triggered by webhook confirmations.

When processing Stripe webhooks, why use event.created timestamps instead of received time?

Using event.created timestamps instead of received time when processing Stripe webhooks ensures accurate clocking for subscription billing events. This prevents timing discrepancies during upgrades, downgrades, and proration calculations, maintaining authoritative subscription state in your database.