This documentation was last updated on 23-11-21.
Introduction
As the Hub2 API is their main project, a solid quality of service is required. In order to keep an appropriate latency and a reliable service, rate limits must be enforced on the most cost-heavy endpoints. This limit is applied per IP address, so it is relative to each of the API users and the usage of one won’t impact the usage of the other. That is why we enforce those limits.API limits
Here is a table of rate limits. The global limit is for all other endpoints.GET | /transfers | 1 req / 30 sec | 2 req / min | |
---|---|---|---|---|
POST | /transfers | 75 req / 10 sec | 400 req / min | |
GET | /transfers/:id | 1 req / 5 sec | 12 req / min | *per :id |
GET | /transfers/:id/balance | 1 req / 10 sec | 6 req / min | |
GET | /transfers/:id/status | 5 req / 5 sec | 60 req / min | *per :id |
GET | /payments | 1 req / 30 sec | 2 req / min | |
GET | /payments_intents | 1 req / 30 sec | 2 req / min | |
POST | /payments_intents | 75 req / 10 sec | 400 req / min | |
GET | /payments_intents/:id | 1 req / 5 sec | 12 req / min | *per :id |
POST | /payments_intents/:id/authentication | 30 req / 5 sec | 360 req / min | |
POST | /payments_intents/:id/payments | 75 req / 10 sec | 400 req / min | |
POST | /payments_intents/:id/payments/sync | 75 req / 10 sec | 400 req / min | |
GET | /payments_intents/:id/payment-fees | 75 req / 10 sec | 450 req / min | |
GET | /payments/:id/status | 5 req / 5 sec | 60 req / min | *per :id |
GET | /payments_intents/:id/status | 5 req / 5 sec | 60 req / min | *per :id |
POST | /terminal/payments | 5 req / 10 sec | 30 req / min | |
GET | /terminal/payments/:id | 5 req / 10 sec | 30 req / min | |
GET | /balance | 75 req / 10 sec | 450 req / min | |
* | * | 50 req / 5 sec | 600 req / min | Global limit |
Actual limit is how the code handles it in termes of requests / seconds.
Rationalized limit ease understanding and helps compare the different values on a same scale.
Rationalized limit ease understanding and helps compare the different values on a same scale.
This limit applies both to mode
Remember to stop sandbox traffic if the transaction stream is getting heavy.
sandbox
and mode live
.Remember to stop sandbox traffic if the transaction stream is getting heavy.
How to handle limits
Whenever a request is received by the API beyond the limit of the endpoint, an errorToo Many Requests
with HTTP status 429
will be returned.
Please checkout MDN documentation about this.
Header name | Description |
---|---|
Retry-After | In case the limit is reached, this header tells how long to wait before a new request will be allowed |
X-RateLimit-Limit | The current limit on the endpoint |
X-RateLimit-Remaining | Number of remaining requests before reaching the limit |
X-RateLimit-Reset | Time before a spot is free in the queue for a new request |