Stripe webhook · Stripe Dashboard

307 / 308 / 301 redirect

what it looks like
Webhook delivery failed: HTTP status code 308 (Permanent Redirect)

What it means

Stripe does not follow redirects. Any 3xx counts as a failed delivery. Next.js and hosts redirect apex to www (or the reverse), http to https, and add or strip trailing slashes.

Common causes

  • Endpoint registered as https://example.com but the site redirects to https://www.example.com
  • trailingSlash: true in next.config adds a slash and redirects
  • http:// instead of https://
  • A locale or auth redirect in proxy.ts / middleware.ts

How to fix it

  1. Run curl -i -X POST https://your-url/api/stripe/webhook and look at the status and Location header
  2. Update the Dashboard endpoint to the final URL from Location, exactly
  3. Exclude /api/stripe/webhook from locale and auth redirects
terminal
curl -i -X POST https://example.com/api/stripe/webhook
# HTTP/2 308
# location: https://www.example.com/api/stripe/webhook   <- register THIS url

# A healthy endpoint answers 400 (missing signature), not 3xx/401/404.
verify the fix
curl -i -X POST https://<your-domain>/api/stripe/webhook
# expect 400 (missing signature) from your handler, not 3xx, 401, 403, 404 or 405
stripe events resend evt_... --webhook-endpoint=we_...
# we_... is the endpoint id in the Dashboard; add --live for a live-mode event

pass if curl gets 400 from your own handler, and the resent event shows a 200 delivery on the endpoint in the Dashboard.

works with stripe-node 23.0.0 · Next.js 16.4.3 App Routerlast verified CLI steps: Stripe CLI 1.55.2, Oct 27, 2026

prevent it · stripe-webhooks.mdc (free Cursor Rules Pack): Excludes the webhook path from auth, locale and trailing-slash redirects.

Prompt for Cursor or Claude Code

Stripe shows my webhook failing with a 307/308 redirect. Check next.config (trailingSlash, redirects), proxy.ts/middleware.ts and any locale or auth redirects, and tell me the exact final URL Stripe should call. Make sure /api/stripe/webhook is never redirected.

Not quite your error? Paste yours into the free VibeBoot Doctor or browse the Stripe webhook fixer.

next: skip the next one

Skip the setup. The VibeBoot SaaS Starter ships Stripe Checkout, the billing portal and a signature-verified webhook already wired, plus auth and a database on Next.js 16.4.3. $49, one-time.

14-day money-back guarantee · lifetime updates

$ fixed it? get the next one first

New fixes for what AI agents break, by email.

When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.

Subscribe free