Skip to content
HisarPay

API conventions

Rate limits

Each API key can make 300 requests per minute. The quota resets at the start of every minute, and the response to every request that is processed tells you how much is left (a 400 for an invalid body is not counted and carries no headers).

Limit and headers

HeaderMeaning
RateLimit-LimitRequests allowed in the window (300).
RateLimit-RemainingRequests left in this window.
RateLimit-ResetSeconds until the window resets.
200 OK
HTTP/1.1 200 OK
RateLimit-Limit: 300
RateLimit-Remaining: 287
RateLimit-Reset: 41

The limit is per key; your live and test keys have independent quotas.

Limits per IP address

On top of the per-key quota, every IP address has a ceiling:

RequestsPer minute
All /v1 requests from one IP address (all keys together)1200
Requests without an API key60
Requests with an invalid or revoked key30

If one server uses several keys, they share the 1200 ceiling. Requests without a key carry the quota headers too.

When you hit the limit

Once the quota is used up, requests are rejected with 429 rate_limited. Wait for the number of seconds in Retry-After and try again. The official SDKs do this for you.

429 Too Many Requests
HTTP/1.1 429 Too Many Requests
RateLimit-Limit: 300
RateLimit-Remaining: 0
RateLimit-Reset: 12
Retry-After: 12

{
  "error": {
    "code": "rate_limited",
    "message": "rate limit exceeded for this key",
    "request_id": "req_0f1e2d3c4b5a69788796a5b4c3d2e1f0"
  }
}

Using the quota well

  • Listen for webhooks instead of polling payment status.
  • Cache /v1/rates and /v1/tokens briefly; they do not change from one second to the next.
  • Use limit=100 when walking lists; you get the same data with fewer requests.
  • Use exponential backoff with jitter when retrying, so bursts of retries spread out.