> For the complete documentation index, see [llms.txt](https://kollect.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kollect.gitbook.io/docs/reference/rate-limits.md). Agents can also search and read this documentation through its [MCP server](https://kollect.gitbook.io/docs/~gitbook/mcp).

# Rate limits

Multiple layers of rate limiting protect the S2S create-payment flow.

***

## Invalid authentication

Failed or missing credentials consume budget from an **invalid-auth** limiter (keyed by client IP):

| Setting                 | Environment variable                  | Default (if unset) |
| ----------------------- | ------------------------------------- | ------------------ |
| Max events per window   | `KOLLECT_S2S_INVALID_AUTH_MAX`        | `30`               |
| Window length (seconds) | `KOLLECT_S2S_INVALID_AUTH_WINDOW_SEC` | `900` (15 minutes) |

Exceeding the limit returns **`429`** with code `RATE_LIMIT_EXCEEDED`.

***

## Per-merchant (API key)

After successful authentication, requests consume budget from a **per-API-key** limiter:

| Setting                 | Environment variable                   | Default           |
| ----------------------- | -------------------------------------- | ----------------- |
| Max requests per window | Access token `limit` field (minimum 1) | `1000` if missing |
| Window length (seconds) | `KOLLECT_S2S_MERCHANT_WINDOW_SEC`      | `60`              |

Exceeding the limit returns **`429`** with code `RATE_LIMIT_EXCEEDED` and may include **`details`** (limit, window).

***

## Payment links per hour (your plan)

Your Kollect plan sets how many payment links you can create through the API each hour. These count together:

* `POST /sdk/server/create-payment`
* `POST /sdk/invoice/invoiceWithPayment` (browser SDK)
* `POST /sdk/fiat/create-invoice`

Status checks, sessions and other calls don't count, and a request that fails doesn't use up your allowance. A replayed request with the same `X-Idempotency-Key` is not counted again.

The count resets at the start of each clock hour. Going over returns **`429`** with code `PLAN_LIMIT_REACHED` and a **`Retry-After`** header (seconds until the next hour). Contact Kollect support to change your plan.

***

## Redis dependency

In **production**, if **Redis** is unavailable and memory fallback is not explicitly allowed, rate limiting may fail with **`503`**. Set `KOLLECT_S2S_ALLOW_MEMORY_FALLBACK=true` only when your operations team approves dev/staging behavior.
