Rate Limiting
SwiftPay implements rate limiting to ensure fair usage and protect our infrastructure. Rate limits are applied per API key.Rate Limits
| Tier | Requests per Minute | Requests per Hour |
|---|---|---|
| Standard | 100 | 1,000 |
| Premium | 500 | 5,000 |
| Enterprise | Custom | Custom |
Your rate limit tier is based on your account plan. Contact support to
upgrade.
Rate Limit Headers
Every API response includes headers indicating your current rate limit status:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the rate limit resets |
Rate Limit Exceeded
When you exceed your rate limit, you’ll receive a429 Too Many Requests response:
Retry-After header indicates how many seconds to wait before retrying.
Handling Rate Limits
Best Practices
Implement Exponential Backoff
Implement Exponential Backoff
When retrying after rate limits, use exponential backoff to gradually
increase wait times:
javascript const delay = Math.min(1000 * Math.pow(2, attempt), 30000); Cache Responses
Cache Responses
Cache API responses where appropriate to reduce the number of requests: -
Balance information (cache for 30-60 seconds) - Session details (cache until
status changes) - Webhook endpoint lists (cache for several minutes)
Batch Operations
Batch Operations
Where possible, batch multiple operations into a single request to reduce API
calls.
Monitor Usage
Monitor Usage
Monitor your API usage in the dashboard to understand your patterns and
avoid hitting limits.
Rate Limit Exceptions
Certain endpoints have different rate limits:| Endpoint | Limit |
|---|---|
POST /api/checkout/:id/pay | 10 per minute per session |
GET /api/balance | 30 per minute |
Need Higher Limits?
If you need higher rate limits, contact our sales team to discuss Enterprise pricing:Contact Sales
Get custom rate limits for your business needs