Error messages and error handling

The invoice API will respond with HTTP status codes if any error occurs. If the response is 200 – OK, the request was successful. If an error occurs, the answer will not be JSON, but plain text.

Some error codes

  • 400 – Bad Request: In the request sent, the parameter is not allowed, or cannot be processed. Also, this code will be the response when the API expects a parameter, but it’s not in the request.
  • 404 – Not Found: The requested URL is not in the system. (This is the most common error – mistyped or not existing url.)
  • 405 – Method Not Allowed: If the method is not allowed or simply not usable for an URL
  • 500 – Internal Server Error: Error occurs during the processing. (In most cases, when the data is sent in a wrong format, or not allowed data is sent. Also occurs when the field requested does not exist or is empty.)