Error Handling
Understanding and handling errors is crucial for building robust integrations with the Billbora API. This guide covers all error types, response formats, and best practices.Error Response Format
All Billbora API errors follow a consistent JSON structure:HTTP Status Codes
2xx Success
2xx Success
- 200 OK: Request successful
- 201 Created: Resource created successfully
- 204 No Content: Resource deleted successfully
4xx Client Errors
4xx Client Errors
- 400 Bad Request: Invalid request parameters
- 401 Unauthorized: Authentication required
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Resource not found
- 409 Conflict: Resource conflict (duplicate data)
- 422 Unprocessable Entity: Validation failed
- 429 Too Many Requests: Rate limit exceeded
5xx Server Errors
5xx Server Errors
- 500 Internal Server Error: Unexpected server error
- 502 Bad Gateway: Upstream service error
- 503 Service Unavailable: Service temporarily unavailable
- 504 Gateway Timeout: Request timeout
Common Error Codes
Authentication Errors
Validation Errors
Resource Errors
Rate Limiting
rate_limit_exceeded
Error Handling Best Practices
1. Always Check Status Codes
2. Handle Specific Error Types
3. Implement Retry Logic
Rate Limiting
Understanding Rate Limits
Billbora implements rate limiting to ensure fair usage:- General API: 1,000 requests per hour per user
- Authentication: 10 requests per minute per IP
- Bulk operations: 100 requests per hour per user
Rate Limit Headers
Every API response includes rate limit information:Handling Rate Limits
Debugging API Errors
1. Use Request IDs
Every API response includes a request ID for debugging:2. Enable Request Logging
3. Validation Error Details
For validation errors, the API provides detailed field-level error messages:Error Recovery Strategies
1. Graceful Degradation
2. Offline Support
Getting Help
When you encounter errors that you can’t resolve:Check Status Page
See if there are any ongoing service issues
Search Documentation
Look up specific error codes and solutions
Community Forum
Ask questions and get help from other developers
Contact Support
Reach out to our support team with request IDs
Pro Tip: Always include the request ID when reporting issues. It helps our support team diagnose problems much faster.