Which WooCommerce requests the WAF breaks
The classic checkout does its work in AJAX calls to ?wc-ajax=…. The Blocks cart and checkout use the Store API under /wp-json/wc/store/v1/. All of them are POSTs sent by JavaScript, and all of them expect JSON back.
| Request | What it does | Symptom when challenged |
|---|---|---|
?wc-ajax=update_order_review | Recalculates shipping, tax and totals when the address changes | Totals and shipping methods never load |
?wc-ajax=apply_coupon | Applies a coupon code | Coupon spinner, no message |
?wc-ajax=checkout | Places the order | Generic error on Place order |
?wc-ajax=get_refreshed_fragments | Updates the mini cart | Cart count stuck |
/wp-json/wc/store/v1/cart/apply-coupon | Coupon on the Blocks cart | Coupon fails silently |
/wp-json/wc/store/v1/checkout | Places the order on the Blocks checkout | Order not placed |
A browser can solve a challenge on a full page. It cannot solve one inside an AJAX call: the script receives an HTML challenge page with status 403, fails to parse it as JSON and shows a spinner or a generic error.
Confirm the firewall is the cause
- Open the browser network tab. Reproduce the problem and find the failing
wc-ajaxorwc/storerequest. A Cloudflare challenge answers 403 with an HTML body and acf-mitigated: challengeresponse header. - Note the Ray ID. It is in the
cf-rayresponse header and at the bottom of the challenge page. - Find the event. In the Cloudflare dashboard, Security → Events, filter by that Ray ID or by the path. The event names the service that acted: custom rule, managed rules, rate limiting, or bot protection.
You can check from a terminal too. The header only appears when Cloudflare itself challenged the request:
curl -s -o /dev/null -D - -X POST "https://example.com/?wc-ajax=update_order_review" \
| grep -i -E "^HTTP|cf-mitigated|cf-ray"-1 is WooCommerce rejecting the missing nonce, not Cloudflare.Firewall blocks often hit only some buyers: one country, a mobile network, a VPN, or a carrier NAT that shares one IP among thousands. "It works for me" does not rule out the WAF.
The skip rule for wc-ajax and the Store API
In Security → WAF → Custom rules, create a rule with the Skip action, placed first, with this expression:
(http.request.uri.query contains "wc-ajax=")
or starts_with(http.request.uri.path, "/wp-json/wc/store/")Under "WAF components to skip", pick what is actually blocking, as named in the event: the remaining custom rules (for a challenge rule or a country rule), and Super Bot Fight Mode on paid plans. Keep the managed rules running if you can; for a managed-rule false positive, use an exception scoped to the path and rule ID instead (next section).
The free plan's Bot Fight Mode ignores custom rules, so no skip rule helps. If the events show Bot Fight Mode on checkout requests, turn it off (Security → Bots) or move to Super Bot Fight Mode on a paid plan, which a skip rule can bypass.
Rate limiting rules on wc-ajax are a common cause of coupon failures: a limit sized for one visitor trips for a shared IP. Scope coupon limits to repeated failures, not every call, and see card testing attacks for protection that does not hurt buyers.
Managed rules that fire on customer data
OWASP-style signatures match ordinary input: an apostrophe in O'Brien, a street name with SQL keywords, long order notes, a coupon code with special characters. Cloudflare logs the rule ID in the event. Add a managed rules exception for that rule ID on the checkout path only, rather than switching the ruleset off.
In ModSecurity the same applies: find the rule id in the audit log and exclude that parameter on that path. Wordfence and similar plugins can rate-limit AJAX calls when many buyers share one IP; raise the limits for the checkout endpoints. More in security plugins blocking checkout.
Payment callbacks and Magento
Gateways confirm payments with server-to-server calls to your store. A country block, bot rule or rate limit on that call leaves the customer charged and the order in pending payment. Allow the exact callback path or the provider's published IP ranges. See WooCommerce orders stuck in pending payment and Magento orders stuck in pending payment.
On Magento the paths to exempt are /rest/*/V1/carts/*, /rest/*/V1/guest-carts/*, /checkout/*, /customer/section/load and each payment module's callback URL.
Caching and Rocket Loader cause a different set of checkout failures behind Cloudflare; they are covered in Cloudflare and CDNs breaking WooCommerce checkout.
Test from outside after every rule change
Firewall changes are invisible from the admin, and your own IP is often allowlisted. After each change, run a full checkout with a coupon from a clean browser on another network, or let an external check do it. The free WooCommerce checkout checker and Magento checkout test run from outside your network and show the step where a block hits.
Find out your checkout broke before your customers do.
Real checkout checks for Magento and WooCommerce · free plan · no card required