Skip to main content

Rate Limiting

To ensure platform stability and fair usage, the NRS API applies request rate limits.

If your application exceeds the allowed request threshold, the API returns a 429 Too Many Requests response.


Rate Limit Response

{
"ok": false,
"error": "Rate limit exceeded"
}

HTTP Status Code

Status CodeMeaning
429Too many requests

Recommended Handling

When a 429 response is received:

  1. Pause additional requests temporarily.
  2. Retry the request after a short delay.
  3. Use exponential backoff for repeated retries.

Example retry intervals:

AttemptDelay
11 second
22 seconds
34 seconds
48 seconds

Best Practices

  • Cache responses where possible.
  • Avoid sending duplicate requests.
  • Queue bulk invoice operations.
  • Use retry logic with exponential backoff.
  • Monitor application request volume.

Example Retry Logic

async function requestWithRetry(fn, retries = 4) {
let delay = 1000;

for (let i = 0; i < retries; i++) {
try {
return await fn();
} catch (error) {
if (error.status !== 429) {
throw error;
}

await new Promise(resolve => setTimeout(resolve, delay));
delay *= 2;
}
}

throw new Error("Rate limit exceeded");
}

Notes

  • Excessive repeated failures may trigger temporary blocking.
  • Rate limits may vary between environments.
  • Bulk invoice submissions should be batched responsibly.