Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.fype.dev/llms.txt

Use this file to discover all available pages before exploring further.

Rate Limiting & Performance

To ensure the stability and availability of the payment engine for all merchants, Fype enforces rate limits on API requests.

Rate Limiting Architecture

Fype uses an Atomic Token-Bucket algorithm powered by Redis. This ensures that limits are enforced consistently across all our API nodes.

Limits by Environment

EnvironmentLimit per MinuteStatus Code
Test Mode100 requests/min429 Too Many Requests
Live Mode500 requests/min429 Too Many Requests
Note: Limits are applied per merchant account per environment.

Handling Rate Limit Errors

When you exceed the limit, the Fype API returns a 429 Too Many Requests response with the following JSON body:
{
  "error": {
    "code": "TOO_MANY_REQUESTS",
    "message": "Rate limit exceeded. Please retry after a few seconds.",
    "limit_per_minute": 300
  }
}

Best Practices

  1. Implement Retries with Backoff: Use an exponential backoff strategy (e.g., 1s, 2s, 4s) when you receive a 429 error.
  2. Check the Retry-After Header: Fype includes a Retry-After header indicating the number of seconds to wait before retrying.
  3. Optimize Bulk Operations: If you need to fetch many payments, use the Paginated List API with a higher limit instead of making multiple single-payment requests.

Performance Tips

1. Persistent Connections

Our SDKs (Node.js and Python) use connection pooling. Reusing the Fype client instance across requests significantly reduces latency by avoiding repeated TLS handshakes.

2. Regional Latency

Fype’s core API is hosted in the Mumbai (India) region to provide the lowest possible latency for Indian payment gateways like Razorpay. For the best performance, host your backend in a nearby region.

3. Asynchronous Webhooks

Do not block your webhook listener with heavy processing.
  • Recommended: Receive the webhook, verify the signature, enqueue a background job in your system, and return 200 OK immediately.
  • Anti-pattern: Performing complex database migrations or sending multiple emails before responding to Fype. This can lead to timeouts and unnecessary retries from Fype’s worker.