Error Taxonomy & HTTP Status Codes
Every error returned by GpkeysBot follows one uniform JSON envelope:
{
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Insufficient balance",
"details": {
"available": "4.000000",
"required": "12.000000"
}
}
}
Complete Code Matrix
| HTTP | error.code | Cause | Example Response Body | Recommended Client Action |
|---|---|---|---|---|
400 | VALIDATION_ERROR | Missing required fields, malformed query params, unknown JSON properties (.strict()), or requesting file download on non-FILE item | {"error":{"code":"VALIDATION_ERROR","message":"Invalid input","details":{"issues":[{"path":"quantity","message":"Must be >= 1"}]}}} | Fix payload schema; do not retry without modifying request. |
401 | UNAUTHORIZED | Missing/malformed x-api-key, unknown key hash, permanently revoked key, or expired key | {"error":{"code":"UNAUTHORIZED","message":"API key has been revoked"}} | Alert ops, stop retrying with this key, rotate to a valid active key. |
402 | INSUFFICIENT_BALANCE | Owning account's balance is below zero or below purchase/action price; zero funds taken | {"error":{"code":"INSUFFICIENT_BALANCE","message":"Insufficient balance","details":{"available":"4.000000","required":"12.000000","shortfall":"8.000000"}}} | Halt purchase immediately, do not fulfill downstream customer order, alert billing/top-up balance. |
403 | FORBIDDEN | Disabled API key (KEY_DISABLED), suspended user account, or cross-user idempotencyKey / keyId access | {"error":{"code":"FORBIDDEN","message":"API key is currently disabled"}} | Pause integration; check key status or contact support (@Etkeys) if suspended. |
403 | API_KEY_CAP_EXCEEDED | Charge exceeds key perRequestCap or UTC monthlySpendCap | {"error":{"code":"API_KEY_CAP_EXCEEDED","message":"Amount exceeds API key monthly spend cap","details":{"capType":"monthlySpendCap","cap":"50.000000","spentThisMonth":"42.000000","requested":"12.000000"}}} | Split large order only if policy allows, or review/adjust key spend caps. |
403 | FRAUD_DETECTED | IP auth-failure block, multi-IP anomaly, rapid repeat purchases, or spend spike | {"error":{"code":"FRAUD_DETECTED","message":"Suspicious purchase velocity detected; key temporarily blocked","details":{"type":"RAPID_REPEAT_PURCHASE"}}} | Stop requests immediately; inspect GET /api/v1/audit for anomalies and wait out block. |
404 | NOT_FOUND | Unknown endpoint, missing order/file, or order owned by another user | {"error":{"code":"NOT_FOUND","message":"Order not found"}} | Verify ID belongs to your account; do not retry blindly. |
409 | PRODUCT_UNAVAILABLE | Product missing, archived, or draft (GET /api/v1/catalog/products/{id} or purchase) | {"error":{"code":"PRODUCT_UNAVAILABLE","message":"That product is no longer available"}} | Sync catalog via GET /api/v1/catalog/products and disable SKU on storefront. |
409 | OUT_OF_STOCK | Requested quantity exceeds remaining live units | {"error":{"code":"OUT_OF_STOCK","message":"This product has just sold out. No payment was taken."}} | Mark item out-of-stock on your storefront; no funds were charged. |
409 | CONFLICT | Uniqueness/reference conflict (e.g., key limit reached or mutating a revoked key) | {"error":{"code":"CONFLICT","message":"That record already exists"}} | Refresh resource state before taking next action. |
429 | RATE_LIMITED | Per-key (60/min general, 10/min purchase) or per-user (120/min / 20/min) quota exceeded | {"error":{"code":"RATE_LIMITED","message":"API key rate limit exceeded. Please slow down.","details":{"bucket":"per_key_purchase","limit":10,"retryAfterSeconds":60}}} | Back off cleanly using retryAfterSeconds + exponential backoff with jitter; reuse idempotencyKey. |
500 | INTERNAL_ERROR | Unexpected server failure (stack trace never exposed) | {"error":{"code":"INTERNAL_ERROR","message":"Something went wrong. Please try again."}} | Retry with exponential backoff; reuse exact idempotencyKey for safe purchase recovery. |