How to Debug Stripe Webhooks

Stripe uses webhooks to notify your application when events happen in your account, such as successful payments, subscription changes, disputes, and payouts. Stripe webhooks are critical for building reliable payment flows.

What are Stripe Webhooks?

Stripe webhooks are HTTP POST requests that Stripe sends to your server when specific events occur in your account. Rather than continuously polling the Stripe API for updates, webhooks deliver real-time notifications the moment something happens — a payment completes, a user signs up, a deployment finishes, or any other tracked event.

Debugging these webhooks can be challenging because they originate from Stripe's servers, not your browser. You can't simply open DevTools to inspect them. That's where WebhookVault comes in — capture every Stripe webhook, inspect the full payload and headers, and replay them to your local development server.

Common Stripe Webhook Events

EventDescription
checkout.session.completedFired when a customer completes a Checkout Session payment
payment_intent.succeededFired when a PaymentIntent successfully completes a payment
invoice.payment_failedFired when a subscription invoice payment attempt fails
customer.subscription.deletedFired when a customer's subscription is canceled

Setting Up Stripe Webhooks with WebhookVault

Follow these steps to start capturing and debugging Stripe webhooks using WebhookVault.

1Create a WebhookVault endpoint

Sign up for a free WebhookVault API key and create an endpoint to capture Stripe webhooks.

curl -X POST https://webhookvault.anethoth.com/api/v1/endpoints \
  -H "Authorization: Bearer wv_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Stripe Webhooks"}'

# Response:
# {"url": "https://webhookvault.anethoth.com/hook/abc123", "inspect_url": "https://webhookvault.anethoth.com/inspect/abc123"}

2Configure Stripe to send webhooks

Go to the Stripe Dashboard > Developers > Webhooks Click 'Add endpoint' and paste your WebhookVault URL Select the events you want to receive (e.g., checkout.session.completed) Save the webhook signing secret for signature verification

3Inspect captured requests

Once Stripe sends a webhook, you can inspect every detail through the WebhookVault API or web inspector.

curl https://webhookvault.anethoth.com/api/v1/endpoints/abc123/requests \
  -H "Authorization: Bearer wv_your_key"

# Returns all captured Stripe webhook requests with full headers, body, and metadata

4Replay to your local server

Replay any captured Stripe webhook to your local development server for testing.

curl -X POST https://webhookvault.anethoth.com/api/v1/endpoints/abc123/requests/1/replay \
  -H "Authorization: Bearer wv_your_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "http://localhost:3000/webhook"}'

# The original Stripe webhook is replayed to your local server

Sample Stripe Webhook Payload

Here is an example of a typical Stripe webhook payload. Use WebhookVault to capture real payloads from your Stripe account for accurate testing.

{
  "id": "evt_1OqGkR2eZvKYlo2C8V1n7eZ5",
  "object": "event",
  "type": "checkout.session.completed",
  "data": {
    "object": {
      "id": "cs_test_a1b2c3",
      "object": "checkout.session",
      "amount_total": 2000,
      "currency": "usd",
      "customer": "cus_P1a2b3c4",
      "payment_status": "paid",
      "status": "complete"
    }
  },
  "livemode": false,
  "created": 1706000000
}

Common Stripe Webhook Issues

Here are the most common issues developers encounter when working with Stripe webhooks, and how to resolve them.

Signature verification fails

Stripe signs every webhook with a secret. Make sure you're using the correct webhook signing secret (whsec_...) from your Stripe dashboard, not your API key.

Events arrive out of order

Stripe does not guarantee event ordering. Always fetch the latest object state from the API rather than relying solely on webhook data.

Duplicate events received

Stripe may send the same event multiple times. Implement idempotency by tracking the event ID and skipping duplicates.

Webhook endpoint returns 5xx

Stripe retries failed deliveries for up to 3 days with exponential backoff. Check your handler for unhandled exceptions.

Frequently Asked Questions

What are Stripe webhooks?

Stripe webhooks are HTTP callbacks that Stripe sends to your server when specific events occur. Instead of polling the Stripe API for changes, webhooks push real-time notifications to your application, making your integration more efficient and responsive.

How do I test Stripe webhooks locally?

Use WebhookVault to capture Stripe webhooks in the cloud, then replay them to your localhost. Create a WebhookVault endpoint, configure Stripe to send webhooks to it, and use the replay API to forward captured requests to http://localhost:3000/webhook (or your local port).

How do I verify Stripe webhook signatures?

Most webhook providers, including Stripe, sign their webhook payloads to prove authenticity. Check the Stripe documentation for the specific signature header and verification algorithm. Use WebhookVault to capture and inspect the raw headers to debug signature verification issues.

Why is WebhookVault better than ngrok for Stripe webhook testing?

Unlike ngrok, WebhookVault captures and stores every webhook request with full headers and payloads. You can replay any Stripe webhook to your local server as many times as needed, inspect historical requests, and share webhook data with your team. No tunnel to maintain or port to expose.

Start debugging Stripe webhooks now

Create a free WebhookVault endpoint in seconds. Capture, inspect, and replay Stripe webhooks with zero configuration.

Get Free API Key