Overview
Contazen uses conventional HTTP response codes to indicate the success or failure of an API request.Error Response Format
All error responses follow a consistent structure:Error Types
Authentication Errors
Authentication Errors
Type:
authentication_errorThese errors occur when there’s a problem with your API key.Example:
Validation Errors
Validation Errors
Type:
validation_errorThese errors occur when request parameters fail validation.Example with field-specific errors:
Rate Limit Errors
Rate Limit Errors
Type: Check the response headers for rate limit information:
rate_limit_errorReturned when you exceed the allowed number of requests.Example:
X-RateLimit-Limit: Maximum requests allowedX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: Reset time (Unix timestamp)
Resource Errors
Resource Errors
Type:
resource_errorThese errors relate to specific resources.Example:
Server Errors
Server Errors
Type:
api_errorThese indicate problems on our servers.Example:
Handling Errors
Best Practices
1
Always check the response status
Don’t assume a request succeeded. Check the HTTP status code and
success field.2
Log error details
Store the full error response, especially the
request_id for debugging.3
Handle specific error types
Implement different handling for different error types.
4
Implement retry logic
For 5xx errors and rate limits, implement exponential backoff.
Example Error Handling
Common Error Scenarios
Invalid CUI Format
Duplicate Invoice Number
Missing Required Fields
Invalid Date Format
e-Factura Not Configured
Invoice Already Sent to SPV
Cannot Delete Used Product
Getting Help
If you encounter an error you can’t resolve:- Check the error message and code - They provide specific information about what went wrong
- Review the API documentation - Ensure you’re using the correct parameters
- Include the request ID - Found in error responses for server errors
- Contact support - Email contact@contazen.ro with details