Error Response Structure
All errors follow a consistent format:HTTP Status Codes
Common Error Codes
Authentication Errors (401)
Authentication Errors (401)
MISSING_ACCESS_TOKEN
- Message: Access token is required
- Cause: The
X-Access-Tokenheader is missing - Action: Include your API key in the header
INVALID_ACCESS_TOKEN / ERR_AUTH
- Message: The provided access token is invalid
- Cause: API key is incorrect, expired, or revoked
- Action:
- Verify API key is correct
- Generate a new key if needed
- Don’t log sensitive key values
- Contact support if issue persists
Validation Errors (400)
Validation Errors (400)
ERR_VALIDATION
- Message: Validation error
- Cause: Request parameters don’t meet requirements
- Common Issues: Missing fields, invalid data types, pattern mismatch
- Action:
- Validate input client-side first
- Check error.details for specific field issues
- Don’t retry without fixing the issue
ERR_PHONE
- Message: Invalid phone number
- Cause: Phone number is incorrect or doesn’t exist
- Action: Use
/v3/internet/check-numberto validate first
ERR_STOCK
- Message: Product out of stock
- Cause: Requested product/card value is not available
- Action:
- Check stock before ordering
- Offer alternative denominations
- Retry later
Not Found Errors (404)
Not Found Errors (404)
NOT_FOUND - Message: Resource not found - Cause: The requested
resource doesn’t exist - Common Cases: Invalid order ID, invalid reference, deleted resource - Action: - Verify the ID/reference is correct- Check for typos - Handle gracefully in UI
Rate Limit Errors (429)
Rate Limit Errors (429)
RATE_LIMIT_EXCEEDED
- Message: Too many requests
- Cause: Exceeded the rate limit
- Limits: Sandbox: 60 req/min, Production: 120 req/min
- Action: Implement exponential backoff with retry logic
Server Errors (500/503)
Server Errors (500/503)
INTERNAL_SERVER_ERROR / INTERNAL_ERROR
- Message: Developer was notified and will check shortly
- Cause: Unexpected error on our servers
- Action:
- Don’t refund immediately - wait 24 hours
- Save requestId for support
- Implement retry logic with backoff
- Contact support with details
- We’re automatically notified
ERR_SERVICE
- Message: Service temporarily unavailable
- Cause: Service maintenance or temporary issue
- Action:
- Show maintenance message
- Retry after delay
- Monitor for resolution
Implementation Best Practices
1. Always Check Success Field
2. Handle Specific Error Codes
3. Smart Retry Logic with Exponential Backoff
4. User-Friendly Error Messages
5. Log Request IDs
Advanced Patterns
Circuit Breaker Pattern
Prevent cascading failures by stopping requests when error rate is high:Error Monitoring
Track error patterns to identify issues early:Handling UNKNOWN_ERROR
Testing Error Scenarios
Use sandbox mode to test error handling:Quick Reference
Validate Early
Validate input client-side before API calls to catch errors early
Retry Smart
Use exponential backoff for 5xx errors, never retry 4xx errors
Log Context
Always include requestId and context in logs for debugging
User Feedback
Show clear, actionable error messages to users
Next Steps
Core Endpoints
Explore all endpoints
Response Format
Understanding API responses

