# 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                  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.vatzen.com/api-errors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
