DEV Community

Kilo Spark
Kilo Spark

Posted on

Debug Stripe Webhooks Without Guessing What Your Server Sends Back

You get a Stripe webhook. Your server processes it. Something breaks — maybe the charge succeeds but your database doesn't update, or the customer gets double-charged.

The problem isn't Stripe. It's that you can't see what your server is actually sending to Stripe during that webhook flow.

The Blind Spot

When a Stripe webhook fires, your handler probably:

  1. Verifies the signature
  2. Reads the event
  3. Makes API calls back to Stripe (update subscription, create invoice, refund, etc.)

Steps 1 and 2 are easy to log. Step 3? You're flying blind unless you dig through Stripe's dashboard and match timestamps manually.

One-Line Fix

toran.sh lets you see every outbound API call by swapping a base URL. Instead of:

stripe.api_base = "https://api.stripe.com"
Enter fullscreen mode Exit fullscreen mode

You use:

stripe.api_base = "https://stripe.toran.sh"
Enter fullscreen mode Exit fullscreen mode

That's it. No SDK. No middleware. No code beyond changing one string.

What You See

Every request your server makes to Stripe now shows up in real time at toran.sh:

  • Full request body — see exactly what parameters you're sending
  • Response — see what Stripe sent back (including error details)
  • Timing — spot slow calls that might be causing timeouts
  • Headers — verify you're sending the right API version, idempotency keys, etc.

Real Example: Debugging a Double-Charge

A user reported being charged twice. Here's how you'd debug it:

  1. Set stripe.api_base = "https://stripe.toran.sh" in your webhook handler
  2. Re-send the webhook from Stripe's dashboard (they have a "Resend" button)
  3. Watch toran.sh — you see your handler makes two POST /v1/charges calls
  4. The bug is obvious: your idempotency check runs after the first charge instead of before

Without seeing the outbound calls, you'd be reading logs and guessing for hours.

Works With Any API

Stripe is just one example. The pattern works with any API:

  • openai.toran.sh for OpenAI calls
  • api.anthropic.toran.sh for Anthropic
  • api.github.toran.sh for GitHub API

Swap the base URL, see what your code actually sends.

When to Use It

  • Webhook debugging — see what your handler sends back to the API
  • SDK debugging — see what the SDK actually sends vs. what the docs say
  • Integration testing — verify your code sends the right payloads before going to production
  • Teaching — show a junior dev exactly what happens when they call stripe.charges.create()

Try It

toran.sh is free — no signup required for basic usage. Swap a URL, see your API calls.


Built by Kilo Spark. We build dev tools that show you what's actually happening.

Top comments (0)