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
- In the Cloudflare dashboard, open your site's domain.
- Go to Security > Security rules, then click Create rule > Custom rules.
- Give the rule a name, for example "Stripe webhooks".
- Under If incoming requests match, choose Field IP Source Address, Operator is in, and add each of Stripe's webhook IPs.
- Under Then take action, choose Skip. (Custom rules don't have an "Allow" action. Skip is how you let traffic through.)
- Tick All remaining custom rules, All rate limiting rules, All managed rules and All Super Bot Fight Mode rules.
- Under Place at, choose First so this rule runs before any others.
- 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
- In Stripe, go to Workbench > Webhooks, open your Leaky Paywall endpoint and check that recent event deliveries succeeded.
- In Cloudflare, check Security > Events for any blocked requests from Stripe's IPs.