> For the complete documentation index, see [llms.txt](https://documentation.vatzen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.vatzen.com/api-errors.md).

# API Errors

{% hint style="danger" %}
VatZen is Deprecated since January 2022 and API server will be shut down soon!
{% endhint %}

If you request fails for some reason, VatZen API will return non-200 HTTP code as well as JSON response which will contain details about the error occurred.

### Error Object

Here's the format of error object, which is returned by the API:

| Field           | Type      | Description                                                                                                                                                                                                     |
| --------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `statusCode`    | `Number`  | Equal to the HTTP status returned with this response. Status for errors is always non-200. For available HTTP errors, please [see the documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status). |
| `success`       | `Boolean` | Boolean value set to `false`, which can help you to identify request's status.                                                                                                                                  |
| `error`         | `Object`  | This object contains "readable" data about the error.                                                                                                                                                           |
| `error.code`    | `Number`  | Internal code of the error, you can find the entire errors' list below.                                                                                                                                         |
| `error.type`    | `String`  | The same as error code, but easier to understand.                                                                                                                                                               |
| `error.message` | `String`  | Long string, which will help you to understand what has happened and how to resolve this issue.                                                                                                                 |

### Error Example

Here's the example of the error object:

```javascript
{
  "status": 403,
  "success": false,
  "error": {
    "code": 101,
    "type": "missing_api_key",
    "message": "You did not provide proper API key, please check documentation"
  }
}
```

### Error Codes

In the table below, you can find all the possible errors that VatZen API can return:

| Code  | Type                   | Description                                             |
| ----- | ---------------------- | ------------------------------------------------------- |
| `101` | `missing_api_key`      | No API Key provided                                     |
| `102` | `invalid_api_key`      | Provided API Key is invalid                             |
| `103` | `usage_limit_reached`  | API Key has reached the daily or monthly requests limit |
| `400` | `invalid_input`        | Request contains invalid input                          |
| `106` | `invalid_ip_address`   | IP Address in the request is invalid                    |
| `107` | `could_not_resolve_ip` | We failed locating the supplied IP Address              |
| `108` | `invalid_country_code` | You provided an invalid Country Code                    |
| `109` | `invalid_amount`       | You provided an invalid "amount" value                  |
