Errors, limits and idempotency
Error format, HTTP codes, calls-per-minute limit and how the Idempotency-Key prevents double charges.
Error format
{ "success": false, "error": "INVALID_GB", "message": "Quantidade de GB inválida.", "field": "gb" }error: fixed code. Use this field in your program.message: text for people. It can change.field: shows up when the problem is a specific field.
Every response includes the x-correlation-id header. Send this value to support when you ask for help with a call.
HTTP codes
| HTTP | When it happens |
|---|---|
| 200 / 201 | It worked (201 when an order was created) |
| 400 | Some data is wrong. Fix it before trying again. |
| 401 | Key missing, invalid or expired |
| 403 | Missing permission, or the IP is not on the key's list |
| 404 | The proxy or order does not exist in this account |
| 409 | Conflict: location with no IP, order in progress, proxy unavailable |
| 422 | Idempotency-Key reused with a different order |
| 429 | Rate limit. Wait the time in the Retry-After header. |
| 500 / 502 / 503 | Our failure or a temporary one. Try again in a few seconds. |
Most common codes
| Code | What to do |
|---|---|
MISSING_API_KEY / INVALID_API_KEY | Check the header and the key. It may have been revoked. |
EXPIRED_API_KEY | Create a new key in the panel. |
IP_NOT_ALLOWED | Call from an IP on the key's list or edit the list. |
INSUFFICIENT_SCOPE | The key does not have the permission. Purchases require the Purchases permission. |
RATE_LIMITED | Wait and slow down. |
PROXY_NOT_FOUND | The id is not a proxy in your account. |
INVALID_PRODUCT / INVALID_GB / INVALID_PACKAGE | See the limits in GET /v1/products. |
INVALID_COUPON | Coupon does not exist, has expired or does not meet the rules. |
INVALID_DOCUMENT | Invalid CPF or CNPJ for the Pix. |
ACCOUNT_EMAIL_MISSING | Complete your account details in the panel. |
GEO_NOT_SUPPORTED | The product does not accept state or city. |
STATE_REQUIRED | To choose a city, also send the state. |
INVALID_SESSION | session_minutes must be from 1 to 120, or null. |
NO_PROXIES_FOR_LOCATION | Choose a larger area. Nothing changed. |
INVALID_IP | Send a valid IPv4. |
ORDER_STATUS_UNKNOWN | The order could not be confirmed. Check GET /v1/orders before trying to buy again. |
Rate limits
| Limit | Value |
|---|---|
| Per key | 60 calls per minute |
| Per IP, adding up all keys | 300 calls per minute |
| Active keys per account | 5 |
| GB per order | See max_gb_per_order in GET /v1/products |
When you go over the limit, the response is 429 with the Retry-After header (in seconds). To track orders, poll every 5 to 10 seconds.
Idempotency: never charge twice
Every purchase and every top-up requires the Idempotency-Key header. Generate a new code for each purchase (a UUID works) and store it with the order in your system.
Idempotency-Key: 6f1c2a90-3b7e-4f7a-9a51-2d0c8e6b1f44How it works:
- Same code and same order: the API returns the first response, with the
Idempotent-Replayed: trueheader. It does not create another order. - Same code with a different order:
422 IDEMPOTENCY_KEY_REUSED. Generate a new code. - Two identical calls at the same time: the second one gets
409 REQUEST_IN_PROGRESS. Wait 5 seconds and repeat. - Temporary error (429 or 5xx): the code is released and you can repeat the same call.
Code rule: 8 to 128 characters, with letters, numbers and _ - : ..
Example of a safe retry in Python:
import uuid, time, requests
key = str(uuid.uuid4()) # one per purchase
for tentativa in range(3):
r = requests.post(
"https://api.rh7proxys.com/v1/orders",
headers={"Authorization": "Bearer rh7k_your_key", "Idempotency-Key": key},
json={"product": "residential", "gb": 10},
timeout=60,
)
if r.status_code < 500 and r.status_code != 429:
break
time.sleep(5)
print(r.json())