How to allowlist Stripe's webhook IPs in Cloudflare

Stripe sends webhooks to your site from a published list of IP addresses. If your site is behind Cloudflare, Cloudflare's security rules can block or rate-limit those requests. When that happens, Leaky Paywall doesn't hear about renewals, cancellations or failed payments. The fix is a Cloudflare rule that lets Stripe's webhook IPs through.

1. Get Stripe's webhook IP addresses

Stripe lists them on docs.stripe.com/ips. You can also copy them from Stripe's ready-made lists: ips_webhooks.txt or ips_webhooks.json.

Stripe announces changes to these IPs in advance on its api-announce mailing list (linked from the same page). Subscribe so you know when to update your rule.

2. Create a Skip rule in Cloudflare

  1. In the Cloudflare dashboard, open your site's domain.
  2. Go to Security > Security rules, then click Create rule > Custom rules.
  3. Give the rule a name, for example "Stripe webhooks".
  4. Under If incoming requests match, choose Field IP Source Address, Operator is in, and add each of Stripe's webhook IPs.
  5. Under Then take action, choose Skip. (Custom rules don't have an "Allow" action. Skip is how you let traffic through.)
  6. Tick All remaining custom rules, All rate limiting rules, All managed rules and All Super Bot Fight Mode rules.
  7. Under Place at, choose First so this rule runs before any others.
  8. Click Deploy.

Another option: add each Stripe IP as an IP Access rule with the action Allow. This also lets Stripe's requests past the WAF.

Note: Cloudflare's free-plan Bot Fight Mode can't be skipped with a custom rule. If webhooks still fail and Bot Fight Mode is on, turn it off.

3. Check it's working

  1. In Stripe, go to Workbench > Webhooks, open your Leaky Paywall endpoint and check that recent event deliveries succeeded.
  2. In Cloudflare, check Security > Events for any blocked requests from Stripe's IPs.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us