The WordPress WooCommerce REST API (/wp-json/wc/v3/) is the integration surface for ERPs, marketplaces, mobile apps, and middleware. WooCommerce ships consumer-key authentication, WordPress ships application passwords, and the wider ecosystem layers JWT and OAuth on top. The auth choice has real operational consequences — key rotation, rate-limit headers, and the ability to audit who-did-what after a data leak. Most stores we audit have one consumer key with read_write that nobody can identify the owner of.
What’s happening
WooCommerce REST API supports three authentication methods:
- Consumer key + consumer secret. Generated in WooCommerce → Settings → Advanced → REST API. The key has a description, a user owner, and a permission level (read, write, read_write). HMAC-signed for HTTP; Basic auth for HTTPS. This is the WooCommerce-specific method.
- Application passwords. Built into WordPress core 5.6+. Generated per user in the user profile. HTTPS only. The WordPress-wide method. Works for both
wp-json/wp/v2/andwp-json/wc/v3/endpoints. - JWT or OAuth via plugin.
wp-rest-api-jwt,oauth-server, orsimple-jwt-login. Useful when integrating with a mobile app or an SPA where you want short-lived tokens.
Rate limits — WooCommerce core does not impose application-level rate limits on the REST API. The store is protected by:
- The web server (nginx
limit_req_zone, Apachemod_evasive) - The CDN or WAF (Cloudflare rules, ModSecurity)
- PHP-FPM worker pool size (implicit limit — once exhausted, requests queue)
A misconfigured integration that polls /wp-json/wc/v3/products once per second per SKU will exhaust PHP-FPM long before any application-level rate limit fires.
The five common operational issues:
- One consumer key with read_write owned by “admin.” Nobody knows what uses it. Cannot rotate without breaking three integrations.
- Application passwords for the same admin user across multiple integrations. Same as above, less observable.
- No rate limit at any layer. An external system goes into a tight loop, takes down the store.
- HTTPS not enforced for
/wp-json. Application passwords sent over HTTP get intercepted. - WooCommerce REST API endpoints exposed publicly when they should not be.
wp-json/wc/v3/customersreturns PII if accessed with a read key.
How to verify
# List WooCommerce REST API consumer keys
wp wc rest_api_key list --format=table
# Per-key permissions
wp db query "SELECT key_id, user_id, description, permissions, last_access
FROM wp_woocommerce_api_keys"
# Application passwords (since WordPress 5.6)
wp eval 'foreach (get_users() as $u) {
$apps = get_user_meta($u->ID, "_application_passwords", true);
if ($apps) { echo $u->user_login . ": " . count($apps) . " app passwords\n"; }
}'
# Recent REST API access from nginx
grep "wp-json/wc/v3" /var/log/nginx/access_log | tail -30
grep "wp-json/wc/v3" /var/log/nginx/access_log | awk '{print $7}' | sort | uniq -c | sort -rn | head -20
# 401/403 attempts (failed auth)
grep "wp-json/wc/v3" /var/log/nginx/access_log | awk '$9==401 || $9==403' | tail -20
# 429 (rate-limited) responses, if rate limiting is in place
grep "wp-json/wc/v3" /var/log/nginx/access_log | awk '$9==429' | tail -20
# Active PHP-FPM workers — under load, what's actually using them?
ps aux | grep "php-fpm: pool" | grep -v grep | wc -l
# Check the HTTPS enforcement
curl -i 'http://example.com/wp-json/wc/v3/products' 2>&1 | head -5
# Expected: 301 redirect to https. A 200 means HTTPS is not enforced.
The single highest-signal command is the per-key access query — last_access tells you which keys are actually in use and which can be safely revoked.
The fix
- One consumer key per integration, named clearly. Description should match the integration: “ERP-NetSuite-prod-2026”, “AmazonMWS-prod”, “MobileApp-iOS-prod”. When you rotate, you know which integration to notify.
- Read permission unless write is justified. Most integrations only read. read_write should be reserved for the ERP and the marketplace integrations that actually write back stock or order updates.
- HTTPS enforced for
/wp-json/. In nginx:
Or simpler, redirect all HTTP to HTTPS at the server block level.location /wp-json/ { if ($scheme != "https") { return 301 https://$host$request_uri; } } - Rate limit at the edge. Cloudflare WAF rule:
For trusted partners, add an allowlist of their IPs to bypass.Field: URI Path Operator: contains Value: /wp-json/wc/v3/ Action: Rate limit: 60 requests per minute per IP - Audit access weekly. A cron job that emails the team a summary of which keys were used, how much, and from which IPs:
#!/bin/bash wp wc rest_api_key list --format=csv > /tmp/keys.csv awk -F, 'NR>1 {print $4, $5, $6}' /tmp/keys.csv | sort - Rotate keys on a schedule. Every 90 days for keys with write access, every 180 days for read-only. Coordinate with the integration owners — do not surprise-rotate a production ERP key.
For the broader WAF and security posture, the existing wp-waf-cloudflare-managed-rulesets article covers the rate-limit configuration. Pair with enterprise WordPress support for the integration-audit cadence.
Stack Harbor manages WordPress WooCommerce REST API access posture under enterprise WordPress support — key naming, permission scope, rotation cadence, and edge rate limits. If your store has API keys nobody can identify the owner of, we can audit and clean up.