Blog
A 307 Redirect Killed My Stripe Webhooks

A 307 Redirect Killed My Stripe Webhooks for 4 Days

I pointed a Stripe webhook at https://townofharmony.org/api/webhooks/stripe. Vercel redirects the apex domain to www.townofharmony.org with a 307. Stripe won't follow redirects. Four days of failed deliveries and I had no idea.

If you're on Vercel with both apex and www configured, go check your webhook URLs. Seriously.

Why nobody noticed

When a webhook fails because of a redirect, nothing shows up on your end. The request just never arrives. No log entry, no error, no alert. From my app's perspective, Stripe went quiet. From Stripe's perspective, every attempt came back 307 and got marked as failed.

This was for a sandbox environment. I'm building a payment portal for a small town's sewer system (small-town government software is a whole thing). Nobody's monitoring test transactions closely enough to catch this. It just sat there, broken.

An agent caught it

I have AI agents that keep an eye on infrastructure across my projects. One of them noticed the Stripe delivery failures on August 17th, four days in. It traced the redirect chain, found the apex-to-www 307, and filed a fix.

Without that, Stripe would've burned through its retry window by August 22nd and given up entirely. The sandbox would've just been quietly broken with no obvious reason why.

The fix

Change the webhook URL from:

https://townofharmony.org/api/webhooks/stripe

to:

https://www.townofharmony.org/api/webhooks/stripe

Point at the canonical domain. The one that doesn't redirect.

This isn't just a Stripe thing

GitHub webhooks do this too. Most payment providers, really anything sending POST requests to your URL, will treat a 3xx as a failure. Makes sense when you think about it. Following a redirect means re-sending a payload to a different URL, and most providers won't do that for security reasons.

If you're on Vercel with a redirect between apex and www, grep your Stripe dashboard, your GitHub webhook settings, whatever third-party integrations you've got. Anything registered against the non-canonical domain is failing right now and you won't know until you look.