Rate Limiting
Lightning Enable rate-limits requests to keep the service stable. Every request passes the global limit, and most routes also pass one named policy.
Limits
Global limit
100 requests per minute, fixed window, per API key (per IP address for requests without an X-API-Key). The store API routes (/api/store-*, /api/community-submissions) have their own bucket of 600 a minute, so store traffic never spends this budget.
Named policies
| Policy | Limit | Scope | Applies to |
|---|---|---|---|
merchant-key | 600 / min (sliding) | Per API key | /api/merchant/* (including POST /api/merchant/webhook-secret/rotate), /api/l402/challenges*, /api/proxy/* (proxy and manifest management) |
payment-create | 10 / min | Per API key (per IP on public routes) | POST /api/payments, POST /api/refunds, /api/checkout/* |
read | 200 / min | Per API key (per IP on public routes, such as GET /api/payments/{invoiceId}/status) | GET /api/payments/*, POST /api/payments/{invoiceId}/sync, GET /api/refunds/* |
write | 20 / min | Per API key | POST /api/merchant/regenerate-key |
l402-endpoints | 20 / min | Per API key | GET /api/l402/endpoints |
l402-renewal | 5 / min to get a challenge, 60 / min to redeem | Per API key | POST /api/merchant/subscription/renew |
checkout | 10 / min per IP, 60 / min in total | Per IP, plus a ceiling shared by all callers | POST /api/bitcoin/create-subscription |
checkout-create | 5 / min per IP, 60 / min in total | Per IP, plus a ceiling shared by all callers | POST /api/stripe/create-checkout-session, POST /api/shopify/{slug}/checkout |
store | 600 / min (sliding) | Per API key | Store API routes |
webhook | 100 / min (sliding) | Shared | /api/webhooks/* (payment provider callbacks) |
admin | 30 / min | Per API key (there is one admin key, so all operators share it) | /api/admin/* |
| Signup and sign-in | 10 per 15 min (free signup, Fast Lane signup, magic link); 20 / min (dashboard API-key sign-in); 30 / min (Fast Lane quote) | Per IP | /api/signup/*, /dashboard/auth/* |
Per-key and per-IP policies refuse at once, and one merchant using up its budget never slows down another. The checkout ceilings exist because each of those requests creates an invoice or checkout session at a payment provider.
webhook is the one shared bucket: provider callbacks come from a few provider addresses and carry no merchant identifier, so it queues a few excess requests briefly instead of dropping a provider's burst. A 429 there doesn't always mean your own traffic was heavy.
/l402/proxy/* has only the global limit.
Rate limit exceeded
A refused request gets 429 Too Many Requests with a Retry-After header (whole seconds) and this body:
HTTP/1.1 429 Too Many Requests
Retry-After: 12
Content-Type: application/json
{
"error": "Too many requests",
"message": "Rate limit exceeded. Please try again later.",
"retryAfter": 12
}
retryAfter in the body carries the same wait. A browser navigation gets a small HTML page instead of JSON, and a dashboard form gets redirected back to its page with an error. The API doesn't send X-RateLimit-* headers.
Failed-authentication throttling
Separately, Lightning Enable counts failed authentications per IP address. More than 20 failures in a 60-second window blocks authenticated requests from that IP until the window ends:
HTTP/1.1 429 Too Many Requests
Retry-After: 42
Content-Type: application/json
{
"error": "Too many failed authentication attempts",
"message": "Slow down and try again in 42 seconds"
}
| Rate limit | Auth-failure throttle | |
|---|---|---|
| Trigger | Too many requests | Too many missing or invalid API keys |
| Scope | See the policy table | Per IP, whatever keys were tried |
error | "Too many requests" | "Too many failed authentication attempts" |
| What to do | Wait Retry-After, then retry | Fix your API key. Retrying with the same key re-arms the block |
Check your key at Dashboard → Settings. See Authentication.
Handling 429s
Wait for Retry-After, and stop on the auth throttle:
async function requestWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
const response = await fetch(url, options);
if (response.status !== 429) return response;
const body = await response.json();
if (body.error === 'Too many failed authentication attempts') {
throw new Error('Authentication throttled. Check your API key.');
}
const seconds = Number(response.headers.get('Retry-After')) || body.retryAfter || 60;
await new Promise(r => setTimeout(r, seconds * 1000));
}
throw new Error('Max retries exceeded');
}
import time
import requests
def request_with_retry(method, url, max_retries=3, **kwargs):
for _ in range(max_retries):
response = requests.request(method, url, **kwargs)
if response.status_code != 429:
return response
body = response.json()
if body.get('error') == 'Too many failed authentication attempts':
raise RuntimeError('Authentication throttled. Check your API key.')
time.sleep(int(response.headers.get('Retry-After', body.get('retryAfter', 60))))
raise RuntimeError('Max retries exceeded')
Stay under the limits
- Use webhooks instead of polling. Your callback URL is told when a payment changes state; see Webhooks. For browser-side polling, use the public
GET /api/payments/{invoiceId}/status. - Send an idempotency key on payment and challenge creation, so a retry after a
429can't create a second invoice. See Request Headers. - Cap your concurrency when backfilling, for example 5 requests in flight at a time.
Need higher limits? Email support@lightningenable.com.
Next steps
- Errors - Error handling
- Authentication - API key setup
- Webhooks - Avoid polling with webhooks