Concepts
Rate limits
How many requests you can send, and what to do on a 429.
Limits protect your balance and keep the API fast for everyone. When you reach one, the request fails with 429, type rate_limit_error, code rate_limited, and a Retry-After header: the number of seconds until the window resets (at least 1).
Limits
| Limit | Counted per | Value |
|---|---|---|
| All requests | API key (test and live keys separately) | 100 requests per 10 seconds |
| Collections, payouts and settlements created | Business, test and live together | 300 per hour |
| Cardholders created | Business | 60 per hour |
| Identity verifications submitted | Cardholder | 5 per 24 hours |
| Event redeliveries | Event | 10 per hour |
List operators and List banks are cached for up to 10 minutes: calling them more often returns the same answer.
Quotas
| Quota | Value |
|---|---|
| Active API keys | 20 per business |
| Webhook endpoints | 10 per business, test and live together (400 limit_reached) |
| Request body | 12 MB (413 body_too_large) |
| Identity document image | 4 MB each |
| Objects per list page | 100 |
Handle a 429
Wait for Retry-After seconds, then send the same request again with the same Idempotency-Key. Spread out batch jobs instead of sending everything at once.
async function monerail(path, init = {}, attempts = 5) {
for (let i = 0; ; i++) {
const res = await fetch('https://api.monerail.com/v1' + path, {
...init,
headers: { Authorization: `Bearer ${process.env.MONERAIL_KEY}`, ...init.headers },
});
if (res.status !== 429 || i + 1 >= attempts) return res;
const wait = Number(res.headers.get('Retry-After')) || 1;
await new Promise((resolve) => setTimeout(resolve, wait * 1000));
}
}import os
import time
import requests
def monerail(method, path, attempts=5, **kwargs):
headers = {"Authorization": f"Bearer {os.environ['MONERAIL_KEY']}", **kwargs.pop("headers", {})}
for i in range(attempts):
res = requests.request(method, "https://api.monerail.com/v1" + path, headers=headers, timeout=30, **kwargs)
if res.status_code != 429 or i + 1 == attempts:
return res
time.sleep(int(res.headers.get("Retry-After", "1")))Contact support@monerail.com if your volume needs higher limits.