API Response Errors

HTTP Status Codes

The Venddor API uses standard HTTP status codes to indicate the success or failure of your API requests. When an error occurs, the response will include both the HTTP status code and a descriptive message to help you troubleshoot the issue.

Best Practice: Always check the HTTP status code in your API client implementations to properly handle errors.
Code Description
400 Bad Request The request is invalid. This can occur when required parameters are missing, parameters have invalid formats, or there's a syntax error in the request.
401 Unauthorized Authentication credentials are missing or invalid. Check your API key and email combination.
403 Forbidden Authentication succeeded, but the authenticated user doesn't have permission to access the requested resource or perform the requested operation.
404 Not Found The requested resource does not exist on the server.
405 Method Not Allowed The HTTP method used is not supported for the requested endpoint. For example, trying to use POST on an endpoint that only supports GET.
406 Not Acceptable The resource cannot generate a response in the format specified in the request. Check your accept header for valid content types.
409 Conflict The request couldn't be completed due to a conflict with the current state of the resource. This often occurs with concurrent updates or version conflicts.
413 Request Entity Too Large The request exceeds the maximum allowed size, or you're requesting more objects than the allowed maximum.
415 Unsupported Media Type The server doesn't support the media type specified in the content-type header.
500 Internal Server Error An unexpected error occurred on the server. If this persists, please contact Venddor support.
501 Not Implemented The request method is not supported by the API.
503 Service Unavailable The service is temporarily unavailable, which may occur during maintenance or when the store is closed or being upgraded.
507 Insufficient Storage The server is unable to store the data needed to complete the request due to storage limitations.
509 Bandwidth Limit Exceeded You've exceeded the rate limits for API requests. Please reduce your request frequency.

Error Response Format

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

{
  "error": {
    "code": "validation_error",
    "message": "The request parameters are invalid.",
    "details": [
      {
        "field": "name",
        "message": "Name is required and cannot be empty."
      },
      {
        "field": "price",
        "message": "Price must be a positive number."
      }
    ]
  }
}

Tips for Error Handling

Implement Proper Error Handling: Your applications should handle API errors gracefully by: