integrating-stripe-webhooks

Verify Stripe webhook signatures using raw request bodies in Node.js and Python frameworks.

121|16|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/pr-pm/prpm --skill integrating-stripe-webhooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integrating-stripe-webhooks
Source: https://github.com/pr-pm/prpm/tree/main/.claude/skills/integrating-stripe-webhooks
Command: npx skills add https://github.com/pr-pm/prpm --skill integrating-stripe-webhooks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill resolves critical Stripe webhook implementation errors including "Raw body not available" warnings, signature verification failures, and subscription data access issues that break payment flows.

Core Features & Use Cases

  • Raw Body Configuration: Framework-specific solutions for accessing unparsed request bodies required for signature verification.
  • TypeScript Type Fixes: Workarounds for missing subscription period fields in Stripe's TypeScript definitions.
  • Use Case: When your Stripe webhooks fail with 400 errors due to signature verification issues, use this Skill to implement the correct raw body parsing middleware for your framework.

Quick Start

Use the integrating-stripe-webhooks skill to show me the Fastify configuration for handling raw Stripe webhook bodies.

Frequently Asked Questions about integrating-stripe-webhooks

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

FAQPage Schema
How do I fix Stripe webhook signature verification failures in Node.js?

Stripe webhook signature verification requires the raw request body before any middleware parses it. Configure your framework (Express, Fastify) to preserve the raw body, then pass it to stripe.webhooks.constructEvent() with your signing secret. This prevents 400 signature errors and ensures webhooks process correctly.

Why does my Stripe webhook get a 'raw body not available' error?

This error occurs when JSON parsing middleware runs before Stripe's signature verification, consuming the raw body. Move raw body parser middleware before any other parsers and before your webhook route handler. Framework-specific solutions differ: Fastify uses raw body options, Express uses body-parser with verify callbacks.

How do I access subscription period fields in Stripe webhook events with TypeScript?

Stripe's TypeScript definitions may omit subscription period fields like `current_period_start` and `current_period_end`. Access them via `subscription.items.data[0]` to retrieve billing cycle dates, or apply type workarounds to extend Stripe's type definitions with missing subscription attributes.

Can I handle Stripe webhooks in both Express and Fastify with the same approach?

Both frameworks support Stripe webhooks, but raw body handling differs. Express requires body-parser with a verify callback; Fastify uses rawBody plugin or request hooks. The core signature verification step with stripe.webhooks.constructEvent() remains identical across frameworks.

What's the correct route prefix for Stripe webhook endpoints in Node.js?

Register Stripe webhook routes under your API prefix—typically `/api/webhooks` or `/webhooks`—ensuring they're accessible to Stripe's servers. Verify the route matches your Stripe dashboard webhook URL exactly, including protocol and domain, to prevent event delivery failures.

How do I verify my Stripe webhook implementation handles subscription events correctly?

Test webhook handling by inspecting the parsed event object for subscription data, verifying `event.data.object.items.data[0]` contains period fields, and confirming signature verification passes. Use Stripe's webhook testing tools or event logs to simulate real subscription.updated and customer.subscription.updated events.