Vatly
Guides

Errors

This guide covers API error handling, including status codes and error types.

You can tell if your request was successful by checking the status code in the API response. If a response is unsuccessful, use the error type and message to understand what went wrong.


Status codes

Here is a list of the different categories of status codes returned by the Vatly API. Use these to understand if a request was successful.

StatusDescription
2xxA 2xx status code indicates a successful response.
4xxA 4xx status code indicates a client error. This means there's an issue with the request.
5xxA 5xx status code indicates a server error. This means the issue is on Vatly's end and we are automatically notified of the problem.

Common status codes

CodeMeaning
200OK - Request succeeded.
201Created - Resource was successfully created.
204No Content - Request succeeded with no response body (e.g., deletes).
400Bad Request - The request was malformed.
401Unauthorized - Invalid or missing API key.
403Forbidden - The API key doesn't have permission for this action.
404Not Found - The requested resource doesn't exist.
422Unprocessable Entity - Validation failed. Check the errors field for details.
429Too Many Requests - Rate limit exceeded. Slow down your requests.
500Internal Server Error - Something went wrong on Vatly's end.

Error types

Whenever a request is unsuccessful, the Vatly API will return an error response with an error type and message. You can use this information to understand better what has gone wrong and how to fix it. Most of the error messages are pretty helpful and actionable.

Error response
{
  "message": "Resource not found."
}

Validation errors

When a 422 status code is returned, the response includes field-specific error details:

Validation error response
{
  "message": "The given data was invalid.",
  "errors": {
    "email": [
      "The email field is required."
    ],
    "products.0.id": [
      "The selected products.0.id is invalid."
    ]
  }
}

The errors object uses dot notation for nested fields. Each key maps to an array of error messages for that field.

Copyright © 2026