Errors

Error Responses

The Fenerum API uses standard HTTP response codes to indicate the success or failure of an API request.

HTTP Status Codes

  • 2xx - Success: The request was successful
  • 4xx - Client Error: There was an error with the request (e.g., missing parameters, authentication failure)
  • 5xx - Server Error: Something went wrong on Fenerum's servers

Common Status Codes

Status CodeMeaning
200OK - Request succeeded
201Created - Resource was successfully created
204No Content - Request succeeded with no response body
400Bad Request - Invalid request parameters
401Unauthorized - Authentication failed or missing
403Forbidden - Authenticated but not authorized
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end

Error Response Format

When an error occurs, the API returns a JSON object with details:

{
  "detail": "Error description",
  "field_name": ["Specific field error messages"]
}

Field-Specific Errors

For validation errors, the response includes field-specific error messages:

{
  "email": ["This field is required."],
  "amount": ["Ensure this value is greater than or equal to 0."]
}

Best Practices

  • Always check the HTTP status code before parsing the response
  • Log error responses for debugging
  • Handle rate limiting errors with exponential backoff
  • Display user-friendly messages for validation errors
background logo

We invoice 2 billion DKK annually for our customers. Let's put your invoicing on autopilot today!