> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.crisscross.money/rate-limiting/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.crisscross.money/_mcp/server. # Rate Limiting > Understand how CrissCross enforces rate limits to maintain system stability and how merchants can manage their API usage efficiently. ### Overview Rate limiting is used to control the number of API requests a merchant can make within a specific period. This ensures system stability, prevents abuse, and maintains high performance across the CrissCross platform. It is essential for merchants to **monitor their API usage** and implement strategies to manage rate limits effectively. --- ### How Rate Limiting Works * **Rate Limit Threshold**: * Exceeding the threshold will result in `429 Too Many Requests` responses. * **Rate Limit Scope**: * Limits may vary between **sandbox and production environments**. --- ### Example Rate Limit Error Response If your requests exceed the rate limit, you will receive a `429 Too Many Requests` response. Use the `Retry-After` header to determine when to retry. ```json { "error": { "code": "429", "message": "Too Many Requests", "details": "You have exceeded the allowed rate limit. Please wait before making further requests." } } ``` --- ### Handling Rate Limits in Your Integration 1. **Monitor API Usage**: * Use the CrissCross **dashboard** to track your API request volume in real-time. 2. **Implement Exponential Backoff**: * Use exponential backoff when retrying requests to avoid further rate limit violations. 3. **Handle 429 Responses Gracefully**: * If you encounter a `429 Too Many Requests` response, use the `Retry-After` header to determine when it is safe to retry the request. --- ### Example of Exponential Backoff in JavaScript ```javascript function makeApiCallWithBackoff(url, attempt = 1) { fetch(url) .then(response => { if (response.status === 429) { const retryAfter = response.headers.get('Retry-After') || 1; const waitTime = Math.pow(2, attempt) * 1000; // Exponential backoff console.log(`Rate limit hit. Retrying in ${waitTime / 1000} seconds...`); setTimeout(() => makeApiCallWithBackoff(url, attempt + 1), waitTime); } else { return response.json(); } }) .then(data => console.log(data)) .catch(err => console.error('API call failed:', err)); } ``` --- ### Best Practices for Managing Rate Limits * **Batch Requests**: * Where possible, batch multiple API calls into a single request to minimize usage. * **Use Caching**: * Cache responses from the CrissCross API to avoid redundant requests. * **Monitor Usage Trends**: * Regularly review your API usage patterns and adjust your implementation to stay within limits. --- ### Conclusion Rate limiting ensures that CrissCross remains stable and responsive for all merchants. By following best practices, merchants can efficiently manage their API usage, avoid disruptions, and maintain smooth operations across their payment systems. > Managing API usage with CrissCross rate limits