Skip to content

ERR_STRIPE_INVALID_SIGNATURE β€” Stripe Invalid Signature

HTTP Status: 400 Retryable: No Automatic retry: None. Stripe will automatically retry failed webhook deliveries for up to 3 days with exponential backoff.

What the User Sees

Invalid payment webhook signature. (ERR_STRIPE_INVALID_SIGNATURE)

What Causes This Error

A Stripe webhook request arrived with an invalid signature. The stripe.webhooks.constructEvent() call in the webhook handler failed to verify the request’s signature against the STRIPE_WEBHOOK_SECRET.

This can happen when: the STRIPE_WEBHOOK_SECRET Worker secret does not match the signing secret shown in the Stripe Dashboard, the webhook endpoint URL changed and a new webhook was not configured, the request body was modified by a proxy or middleware before signature verification, or the request was tampered with by a malicious actor.

This is a critical error because failed webhooks mean that purchased credits will not be added to user accounts. Stripe retries failed webhooks automatically, so if the secret is corrected promptly, previously failed events will be reprocessed.

Resolution Steps

For Users

  1. If you purchased credits and they have not appeared in your account, contact support. The payment was processed by Stripe but the notification to our system may have failed.
  2. Your payment was not lost β€” Stripe has a record of the transaction and credits can be manually applied.

For Administrators

  1. Verify STRIPE_WEBHOOK_SECRET matches the signing secret in Stripe Dashboard > Developers > Webhooks > select the endpoint > Signing secret.
  2. If the endpoint URL changed (e.g., after a domain change or API restructure), create a new webhook endpoint in Stripe and update the STRIPE_WEBHOOK_SECRET:
    Terminal window
    cd workers/api && echo "NEW_SECRET" | npx wrangler secret put STRIPE_WEBHOOK_SECRET --env production
  3. Check Stripe Dashboard > Developers > Webhooks for failed delivery attempts. Each failed event shows the response code and can be manually retried.
  4. Do NOT ignore this error β€” failed webhooks mean purchased credits are not being applied. Check for any users who purchased credits during the outage and manually grant credits via Admin > Users > Grant Credits.
  5. After fixing, click β€œSend test webhook” in the Stripe Dashboard to verify the endpoint is working correctly.