08 errors
Stablix uses conventional HTTP status codes and returns consistent error responses.
HTTP Status Codes
200
Success
201
Created
400
Bad Request — Invalid parameters
401
Unauthorized — Invalid or missing authentication
403
Forbidden — Valid auth but insufficient permissions
404
Not Found — Resource doesn't exist
409
Conflict — Resource state conflict
422
Unprocessable — Validation failed
429
Too Many Requests — Rate limit exceeded
500
Internal Server Error
503
Service Unavailable
Error Response Format
All errors follow this structure:
{
"success": false,
"message": "Human-readable error message",
"error": {
"code": "ERROR_CODE",
"details": { }
}
}Example
Error Codes
Authentication Errors
INVALID_API_KEY
API key is invalid or expired
MISSING_API_KEY
No API key provided
INVALID_TOKEN
JWT token is invalid or expired
TOKEN_EXPIRED
JWT token has expired
2FA_REQUIRED
Two-factor authentication required
INVALID_2FA_CODE
Invalid 2FA code
SESSION_EXPIRED
Session has expired
Validation Errors
VALIDATION_ERROR
Request validation failed
INVALID_AMOUNT
Amount is invalid or out of range
INVALID_CURRENCY
Currency not supported
INVALID_CHAIN
Chain not supported
INVALID_ADDRESS
Wallet address is invalid
INVALID_EMAIL
Email format is invalid
Resource Errors
NOT_FOUND
Resource not found
ALREADY_EXISTS
Resource already exists
CONFLICT
Resource state conflict
Business Logic Errors
INVOICE_EXPIRED
Invoice has expired
INVOICE_ALREADY_PAID
Invoice is already paid
INVOICE_NOT_PAID
Invoice is not in paid status
INSUFFICIENT_BALANCE
Wallet has insufficient balance
VOLUME_LIMIT_EXCEEDED
Monthly volume limit exceeded
TRANSACTION_LIMIT_EXCEEDED
Single transaction limit exceeded
KYC_REQUIRED
KYC verification required
WALLET_LIMIT_EXCEEDED
Maximum wallets reached for tier
DISPUTE_EXISTS
Dispute already exists for invoice
BUFFER_EXPIRED
Escrow buffer period has ended
Rate Limiting
RATE_LIMIT_EXCEEDED
Too many requests
Validation Error Details
Validation errors include field-level details:
Rate Limiting
API requests are rate limited per API key:
General API
100 requests/15 min
Authentication
10 requests/15 min
Webhooks
1000 requests/15 min
Rate Limit Headers
Rate Limit Response
Handling Errors
JavaScript Example
Python Example
Best Practices
Always check
successfield — Don't assume requests succeed.Handle specific error codes — Different errors need different handling.
Implement retry logic — For rate limits and transient errors.
Log errors — Keep records for debugging.
Show user-friendly messages — Don't expose raw error messages to end users.
Validate before sending — Catch obvious validation errors client-side.
Getting Help
If you encounter unexpected errors:
Check the error code and message
Review the API reference for endpoint requirements
Search our FAQ for common issues
Contact [email protected] with:
Error code and message
Request details (endpoint, parameters)
Timestamp
Your merchant ID