# Introduction

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

VatZen provides *various tools to help you build VAT-compliant business. We provide tools to obtain VAT rates by country, properly geolocate you customers, validate business VAT numbers, and more. To see all the services, please* [*check our website*](https://vatzen.com/)*.*

Our API is built in accordance with [REST principles](https://en.wikipedia.org/wiki/Representational_state_transfer). All API results are delivered in JSON format through HTTP methods (endpoints mostly support GET and POST operations). The JSON format ensures maximum compatibility with industry-standard web application frameworks and programming languages.

VatZen also providers libraries for different programming languages and framework, including NodeJS, Ruby and Python. See documentation below.

## API Description

### API Endpoints

Current API version is `v1` and you can access the API via this endpoint:

```
https://api.vatzen.com/v1/
```

### Authorization

You can read more about Authorization in the [special documentation section](/authorization).

Every user has a uniq API key, which is assigned during the registration process and always available from the [VatZen Dashboard](https://dashboard.vatzen.com). You can also reset you API key at any time if you feel it could have been compromised.

Each API route is protected via api key, so it's required for you to provide it with every request.

### API Responses

Every endpoint returns the response in JSON format which can be easily read by your application.

Every successful response has HTTP status code `200` and also has `success: true` field inside. Is the response code is not 200 and `success: false`, it means you got an error. Read more about our API errors below.

&#x20;Here's the simple response from the `/rate` endpoint.

```javascript
{
  "success": true,
  "standart_rate": 20,
  "categories": {
    "audiobook": 10,
    "broadcasting": 10,
    "ebook": 10,
    "eperiodical": 10,
    "eservice": 10,
    "telecommunication": 20
  },
  "currency": "EUR",
  "country": {
    "code": "AT",
    "name": "Austria",
    "local_name": "Austria",
    "member_state": true
  }
}
```

### API Errors

*For details about API errors, please* [*see the dedicated page*](/api-errors)*.*

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. Below you can see an example of the error returned:

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

## Available Endpoints

A list of available endpoints (more coming soon!):

* `/rates` to get all actual VAT rates, supports pagination.
* `/rate` to get the rate for the specific country based on different inputs, such as country code, ip address, etc.
* `/validate` to validate a VAT number.
* `/customerLocation` to get a customer location and VAT rate.
* `/price` for VAT price calculation.
* `/businessInfo` for obtaining business information.
* `/invoice` for generating VAT compliant invoices&#x20;


# Getting Started

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

In this example we'll go through implementing several Rates endpoint's capabilities in different programming languages. You'll also see that some languages already have pre-built libraries which you can install for faster application development.

Note that the API key in each code block must be replaced with the unique public key found in your dashboard.

### Plain JavaScript

In this section, we'll implement rates API on plain JavaScript without using provided npm module.

```javascript
const apiKey = 'aea3661794add2e8e799ab005c2bd607';

// This function will return all available
// rates, for all EU countries
async function fetchAllRates() {
  const ratesResponse = await fetch('https://api.vatzen.com/v1/rates', {
    method: 'GET',
    headers: {
      apiKey, 
    }
  });
  
  if (ratesResponse.code === 200) {
    return (await ratesResponse.json()).rates;
  } else {
    return [];
  }
}

async function fetchRateByCountryCode(countryCode) {
  const ratesResponse = await fetch(`https://api.vatzen.com/v1/rate?country_code=${countryCode}`, {
    method: 'GET',
    headers: {
      apiKey, 
    }
  });
  
  if (ratesResponse.code === 200) {
    return (await ratesResponse.json()).rate;
  } else {
    return [];
  }
}
```


# Authorization

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

In order to use the service, you have to attach your personal api key to each request you make. You can find, create and regenerate your personal api key in your dashboard at <https://dashboard.vatzen.com>.

VatZen API Authorization is based on your personal api key, which you can obtain from the dashboard. You're required to pass this api key along with every request you make to the API. You can pass it in 2 ways: via `x-api-key` header in HTTP headers, or in the request query as an `api_key` parameter.

Below, 2 examples of how you can provide your api key.

**1) Provide a token in the request's query**

Simple example of how to use your token inside the request's query to fetch all the actual API rates:

```
https://api.vatzen.com/v1/rates?api_key=aea3661794add2e8e799ab005c2bd607
```

**2) Provide a token in the request's header**

You can also provide a token in your request's header. For example, if you are writing JavaScript code and using `fetch` to send requests:

```javascript
fetch('https://api.vatzen.com/rates', {
  mathod: 'GET',
  headers: {
    'x-api-key': 'aea3661794add2e8e799ab005c2bd607',
  },
});
```

Sometimes it can be useful and can help you define the general authorization strategy for all the calls you make to VatZen API.

### Public Key

For some use cases, you'd want to fetch certain information from public spaces, like your frontend application and it's a bad practice to expose your api key that way.

To solve this problem, VatZen provides you with a public key, which you can find in the dashboard and which can be used to access selected endpoints (see documentation).

Public key can only be provided via query param as `public_key`, for example, if you want to get previously saved price object, you can make the following request:

```
https://api.vatzen.com/v1/prices/123?public_key=pk_aea36sddd2e8e799ab005c2bd607
```

### Reseting API key

You can reset your api key anytime from your dashboard if you think that your token has been compromised. In order to to that, you can navigate to the "API Key" section of the dashboard and click regenerate button.


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


# OpenAPI & Swagger UI

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

We have most up-to-date and generated API available in Swagger UI, where you can also play with API and see responses.

You can access OpenAPI resources on the following URLs:

* Swagger UI: <https://api.vatzen.com/openapi>
* JSON OpenAPI specification: <https://api.vatzen.com/openapi-json>
* YAML OpenAPI specification: <https://api.vatzen.com/openapi-yml>

### Using Swagger UI

We'll walk you through the basics of the Swagger UI and how you can use it to test and play with our API.

First, make sure you have your `apiKey`, which you can get from the [VatZen Dashboard](https://dashboard.vatzen.com).

### Authorization

Before making any requests, you will need to authorize yourself with the token. In order to do that, click "Authorize" button.

You will be presented with 2 possible options, enter your api key either via query param, or header. Feel free to choose any of them. Enter your token and click "Authorize"

![Authorization Options](https://1203434254-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmoF_LNimRBH9rdeZ3E%2F-MFL34fgqANEyz4Y-SWD%2F-MFL55hpvlHit9uFfc1I%2Fimage.png?alt=media\&token=3fa31403-234b-4817-af54-92c78dceb5ce)

### Making Requests

After you authorized yourself, it's very simple to make the request. Let's take Rate endpoint as an example. Let's imagine, we want to fetch all the VAT rates for France. All you need to do is to expand "Rate", enter "FR" and click execute:

![](https://1203434254-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmoF_LNimRBH9rdeZ3E%2F-MFL34fgqANEyz4Y-SWD%2F-MFL5j0wn-JLSF-_LRaq%2Fimage.png?alt=media\&token=da60644e-ca2f-46e2-b6e9-86fb4afcd0c9)

After you performed the request, you can see the response below.

![](https://1203434254-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LmoF_LNimRBH9rdeZ3E%2F-MFL34fgqANEyz4Y-SWD%2F-MFL5uJQVA8PsW0IkWqh%2Fimage.png?alt=media\&token=6c150600-4a5d-440a-b0ed-c0ef9439abfd)


# VAT Rates

Obtain official EU VAT rates, full and reduced, for different categories.

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

Keep the rates of your application up-to-date with a regular VAT rate lookup. This ensures that your invoice states the correct VAT across EU Member States. We have also started to add countries outside the EU and will keep them updated.

VAT rates can change irregularly as governments adapt to new circumstances. We track such announcements closely and store scheduled changes in our database. Any such change will take effect at exactly midnight local time of the respective country.

## Rate Entity

Base of the rate endpoint is the `Rate` entity, which is returned from all rates endpoint. You can find the description of the `Rate` entity below:

| Key                            | Type      | Example       | Description                                                                                                              |
| ------------------------------ | --------- | ------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `standard_rate`                | `Number`  | 20            | Standard rate used in the country.                                                                                       |
| `currency`                     | `String`  | `EUR`         | 3-letter ISO 4217 local currency code.                                                                                   |
| `country`                      | `Object`  | N/A           | Contains information about the country                                                                                   |
| `country.code`                 | `String`  | `DE`          | 2-letter ISO country code.                                                                                               |
| `country.name`                 | `String`  | `Germany`     | Corresponding English name of country\_code.                                                                             |
| `country.local_name`           | `String`  | `Deutschland` | Corresponding name of country\_code on local language (in case of multiple national languages, English will be returned) |
| `country.member_state`         | `Boolean` | `false`       | Identifies if the country is a member state or not                                                                       |
| `categories`                   | `Object`  | N/A           | Contains rates for different categories relevant for digital products.                                                   |
| `categories.audiobook`         | `Number`  | `20`          | Rate for audiobooks. Defaults to `standard_rate`                                                                         |
| `categories.broadcasting`      | `Number`  | `10`          | Rate for broadcasting services. Defaults to `standard_rate`                                                              |
| `categories.ebook`             | `Number`  | `10`          | Rate for electronic books. Defaults to `standard_rate`                                                                   |
| `categories.eperiodical`       | `Number`  | `4`           | Rate for electronic periodical. Defaults to `standard_rate`                                                              |
| `categories.eservice`          | `Number`  | `20`          | Rate for electronic services. Defaults to `standard_rate`                                                                |
| `categories.telecommunication` | `Number`  | `30`          | Rate for telecommunication                                                                                               |

## Get All VAT Rates

<mark style="color:blue;">`GET`</mark> `https://api.vatzen.com/v1/rates`

This endpoint allows you fetch all the rates from our system. Before reading this article, familiarize yourself with Authorization and Rate Entity.&#x20;

#### Query Parameters

| Name          | Type    | Description                                                  |
| ------------- | ------- | ------------------------------------------------------------ |
| limit         | integer | Pagination option to limit the page length. Defaults to 100. |
| page          | integer | Page number, defaults to 1.                                  |
| member\_state | boolean | Filter response to include only EU member states.            |

{% tabs %}
{% tab title="200 Rates fetched successfully" %}

```javascript
{
  "success": true,
  "pagination": {
    "has_more": false,
    "total_count": 28
  },
  "rates": [
    {
      "standart_rate": 20,
      "currency": "EUR",
      "country": {
        "code": "AT",
        "name": "Austria",
        "local_name": "Austria",
        "member_state": true
      },
      "categories": {
        "audiobook": 5,
        "broadcasting": 5,
        "ebook": 5,
        "eperiodical": 5,
        "eservice": 20,
        "telecommunication": 20
      }
    }
    // ...
  ]
}
```

{% endtab %}

{% tab title="400 General error. For details, see API Errors page." %}

```javascript
{
  "status": 400,
  "success": false,
  "error": {
    "code": 101,
    "type": "missing_api_key",
    "message": "No API Key provided"
  }
}
```

{% endtab %}
{% endtabs %}

### Response Params

| Key                      | Type          | Value                                                                                          |
| ------------------------ | ------------- | ---------------------------------------------------------------------------------------------- |
| `pagination`             | `Object`      | Information about the pagination                                                               |
| `pagination.has_more`    | `Boolean`     | Identifies if we have more data after this request (e.g. if you need to fetch additional page) |
| `pagination.total_count` | `Number`      | Total items count for your request                                                             |
| `rates`                  | `Array<Rate>` | Array of [Rate Entities.](/api/vat-rates#rate-entity)                                          |

## VAT Rate by Country Code

<mark style="color:blue;">`GET`</mark> `https://api.vatzen.com/v1/rate/:country_code`

Returns country's VAT rate by country code provided in path parameter.

#### Path Parameters

| Name          | Type   | Description                                  |
| ------------- | ------ | -------------------------------------------- |
| country\_code | string | 2-letter ISO country code. For example "DE". |

{% tabs %}
{% tab title="200 Returns the Rate entity for the country by the county code." %}

```javascript
{
  "success": true,
  "standart_rate": 20,
  "currency": "EUR",
  "country": {
    "code": "AT",
    "name": "Austria",
    "local_name": "Austria",
    "member_state": true
  },
  "categories": {
    "audiobook": 5,
    "broadcasting": 5,
    "ebook": 5,
    "eperiodical": 5,
    "eservice": 20,
    "telecommunication": 20
  }
}
```

{% endtab %}

{% tab title="400 General error, for details see API Errors section" %}

```javascript
{
  "success": false,
  "status": 400,
  "error": {
    "code": 101,
    "type": "missing_api_key",
    "message": "No API Key provided"
  }
}
```

{% endtab %}

{% tab title="404 We were unable to fetch the country by the country code." %}

```javascript
{
  "success": false,
  "status": 404,
  "error": {
    "code": 108,
    "type": "invalid_country_code",
    "message": "You provided invalid count"
  }
}
```

{% endtab %}
{% endtabs %}

## VAT Rate Lookup

<mark style="color:blue;">`GET`</mark> `https://api.vatzen.com/v1/rate`

This method allows you to lookup the VAT rate using different parameters, such as country name, country code, ip address, etc.

#### Query Parameters

| Name            | Type   | Description                                                                                                                         |
| --------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| country\_code   | string | 2-digits ISO Country Code. For example "DE"                                                                                         |
| country\_name   | string | English or local country name. For example "Germany"                                                                                |
| ip\_address     | string | IP address of the customer. For example "8.8.8.8". We support both IP v4 and v6 and use extended databases to get the best results. |
| use\_client\_ip | string | We will use IP address coming from the request. This might be helpful is you're making the request from the browser.                |

{% tabs %}
{% tab title="200 Response in case if we've found the correct rate." %}

```javascript
{
  "success": true,
  "standart_rate": 20,
  "currency": "EUR",
  "country": {
    "code": "CH",
    "name": "Switzerland",
    "local_name": "Switzerland",
    "member_state": false
  },
  "categories": {
    "audiobook": 3,
    "broadcasting": 8,
    "ebook": 3,
    "eperiodical": 3,
    "eservice": 8,
    "telecommunication": 8
  }
}
```

{% endtab %}

{% tab title="400 Something went wrong, see API Errors section for error details." %}

```javascript
{
  "success": false,
  "statusCode": 400,
  "error": {
    "code": 107,
    "type": "could_not_resolve_ip",
    "message": "We failed locating the supplied IP Address"
  }
}
```

{% endtab %}

{% tab title="404 We were unable to find the requested country." %}

```javascript
{
  "success": false,
  "statusCode": 404,
  "error": {
    "code": 109,
    "type": "country_not_found",
    "message": "We were unable to find requested country"
  }
}

```

{% endtab %}
{% endtabs %}


# VAT Number Validations

Highly-secured, real-time EU VAT number validation that allows you to check the VAT number for a business. It's helpful when you sell to business customer and do not need to add VAT.

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

We obtain company's informations directly from different official sources, such as EU commissions DB and local countries databases. All subscription plans are allowed to perform real-time VAT ID validations and company information lookups through the `validate` and `validations` API endpoints.

### Hot and Cold Validations

At VatZen we have a concept of 2 validations types: Hot and Cold.

* **Cold** validation works in fire and forget way. Meaning that you simply call our endpoint and we return you the data, which is never stored afterwards.
* **Hot** validation is different from the cold one in the way that all the requests you make has id's assigned and stored in our DB. And you can always fetch this validations (fetch them all of fetch by id).

Cold validations are performed via `validate` endpoint, end hot validation use `validations` CRUD endpoint. You can get more details below.

### Using Requester Data

When validating VAT number, EU commission database can return you reference id, which you can then use in your reports or during the audit process. In order to obtain this reference number, you have to provide requested VAT number, meaning the number of your company.

In order to do that, simply go to VatZen's dashboard and fill the VAT Number option on the settings page: <https://dashboard.vatzen.com/settings>

Consultation number is used  if you want to be able to prove to a Tax Administration of a Member State that you have checked a given VAT number at a given time, and obtained a given validation reply.

### Validation Entity

Base of the validations endpoints is the `Validation` entity, which is returned from all validations-related endpoint. You can find the description of the `Validation` entity below:

| Key                      | Type               | Example                                         | Description                                                                                                                                                              |
| ------------------------ | ------------------ | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id`                     | `String` or `null` | `1234`                                          | Uniq ID of the validation. Only applies to Hot validations. You can use it afterwards to obtain validation information.                                                  |
| `consultation_number`    | `String`           | `WAPIAAAAXQ6Sc`                                 | Consultation number returned by VIES system.                                                                                                                             |
| `valid`                  | `Boolean or null`  | `true`                                          | Represents the validity of VAT number in the query. `true` only when it's valid. Null if we were unable to check the validity due to the government services being down. |
| `requested`              | `String`           | `2020-08-29+02:00`                              | Requested date returned from VIES system                                                                                                                                 |
| `query`                  | `String`           | `LU26375245`                                    | Original query from the request.                                                                                                                                         |
| `country`                | `Object or null`   | ---                                             | Information about the country of the company.                                                                                                                            |
| `country.code`           | `String`           | `LU`                                            | ISO country code                                                                                                                                                         |
| `country.name`           | `String`           | `Luxembourg`                                    | Name of the country                                                                                                                                                      |
| `country.local_name`     | `String`           | `Luxembourg`                                    | Local name of the country, falls back to English                                                                                                                         |
| `country.member_state`   | `Boolean`          | `true`                                          | If the country member state or not                                                                                                                                       |
| `company`                | `Object` or `null` | ---                                             | Information about the company. Sometimes this information is private, so we'll show `null`                                                                               |
| `company.name`           | `String`           | `AMAZON EUROPE CORE S.A R.L.`                   | Company's name                                                                                                                                                           |
| `company.address`        | `String`           | `38, AVENUE JOHN F. KENNEDY, L-1855 LUXEMBOURG` | Company's address                                                                                                                                                        |
| `pending`                | `Boolean`          | `false`                                         | If the government service is down, we return pending request, which we'll fullfill later. You can get the result by fetching validation by id.                           |
| `valid_format`           | `Boolean`          | `true`                                          | If the VAT format from the query valid                                                                                                                                   |
| `requester`              | `Object` or `null` | ---                                             | Information about your company - requester                                                                                                                               |
| `requester.country_code` | `String`           | `LU`                                            | Country code                                                                                                                                                             |
| `requester.vat_number`   | `String`           | `26375245`                                      | VAT Number                                                                                                                                                               |

## Validate VAT Number

<mark style="color:blue;">`GET`</mark> `https://api.vatzen.com/v1/validate/:number`

#### Path Parameters

| Name   | Type   | Description                                 |
| ------ | ------ | ------------------------------------------- |
| number | string | VAT Number of business you want to validate |

{% tabs %}
{% tab title="200 Successfully validated" %}

```javascript
{
  "success": true,
  "consultation_number": "WAPIAAAAXQ6S",
  "valid": true,
  "requested": "2020-08-29+02:00",
  "query": "LU26375245",
  "country": {
    "code": "LU",
    "name": "Luxembourg",
    "local_name": "Luxembourg",
    "member_state": true
  },
  "company": {
    "name": "AMAZON EUROPE CORE S.A R.L.",
    "address": "38, AVENUE JOHN F. KENNEDY, L-1855  LUXEMBOURG"
  },
  "pending": false,
  "valid_format": true,
  "requester": {
    "country_code": "LU",
    "vat_number": "26375245"
  }
}
```

{% endtab %}
{% endtabs %}

## Response

[Validation Entity](/api/validate-vat-number#validation-entity) or [API Error](/api-errors) will be returned.

## Create Validation

<mark style="color:green;">`POST`</mark> `https://api.vatzen.com/v1/validations`

Creates a new hot validation and stores it in our db. ID is assigned to every validation.

#### Query Parameters

| Name        | Type   | Description                     |
| ----------- | ------ | ------------------------------- |
| vat\_number | string | VAT Number you want to validate |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "id": "string",
  "consultation_number": "string",
  "requested": "string",
  "created": "string",
  "valid": true,
  "query": "string",
  "country": {
    "code": "DE",
    "name": "Germany",
    "local_name": "Deutschland",
    "member_state": true
  },
  "company": {},
  "pending": true,
  "valid_format": true,
  "requester": {}
}
```

{% endtab %}
{% endtabs %}

## Get All Validations

<mark style="color:blue;">`GET`</mark> `https://api.vatzen.com/v1/validations`

Returns all the validation you performed with your token, paginated. Can be useful for exporting your activity.

#### Query Parameters

| Name  | Type    | Description                                |
| ----- | ------- | ------------------------------------------ |
| page  | integer | Page number. Default to 1.                 |
| limit | integer | Limit used for pagination. Default to 100. |

{% tabs %}
{% tab title="200 All the validation returned" %}

```javascript
{
  "success": true,
  "pagination": {
    "has_more": false,
    "total_count": 3
  },
  "validations": [
    {
      "id": "5f45015c04725a4f76e07d",
      "valid": true,
      "requested": "2020-08-25+02:00",
      "created": "2020-08-25T12:17:32.370Z",
      "query": "NL852071589B01",
      "country": {
        "code": "NL",
        "name": "Netherlands",
        "local_name": "Netherlands",
        "member_state": true
      },
      "company": {
        "name": "UBER B.V.",
        "address": ", MR. TREUBLAAN 00007, 1097DP AMSTERDAM, "
      },
      "pending": false,
      "valid_format": true,
      "requester": null
    }
    //....
  ]
}
```

{% endtab %}
{% endtabs %}

## Get Validation By ID

<mark style="color:blue;">`GET`</mark> `https://api.vatzen.com/v1/validations/:id`

Returns the single validation by id. You can use it to retrieve information about pending validation, of for the validation for the specific transaction.

#### Path Parameters

| Name | Type   | Description                                        |
| ---- | ------ | -------------------------------------------------- |
| id   | string | Validation ID you want to obtain information about |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "id": "5f45015c04725a4f76e07",
  "valid": true,
  "requested": "2020-08-25+02:00",
  "created": "2020-08-25T12:17:32.370Z",
  "query": "NL852071589B01",
  "country": {
    "code": "NL",
    "name": "Netherlands",
    "local_name": "Netherlands",
    "member_state": true
  },
  "company": {
    "name": "UBER B.V.",
    "address": ", MR. TREUBLAAN 00007, 1097DP AMSTERDAM, "
  },
  "pending": false,
  "valid_format": true,
  "requester": null
}
```

{% endtab %}
{% endtabs %}


# VAT Prices Calculations

Using our price endpoints, you may request the API to calculate VAT compliant prices for you.

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

### Hot and Cold Price Calculations

Just as with validations, at VatZen we have a concept of 2 price types: Hot and Cold.

* **Cold** prices works in fire-and-forget way. Meaning that you simply call our endpoint and we return you the data, which is never stored afterwards.
* **Hot** prices endpoint is different from the cold one in the way that all the requests you make has id's assigned and stored in our DB. And you can always fetch this prices (fetch them all of fetch by id). For example, you can create them on the server side and then retrieve on the client.

Cold validations are performed via `price` endpoint, end hot validation use `prices` CRUD endpoints. You can get more details below.

### Price Entity

Base of our prices endpoints is the `Price` entity, which is returned from all pricing-related endpoints. You can find the description of the `Pricing` entity below:

| Field                   | Type               | Example       | Description                                                                                             |
| ----------------------- | ------------------ | ------------- | ------------------------------------------------------------------------------------------------------- |
| `id`                    | `String` or `null` | `abc123cba`   | Uniq id assigned only for hot price calculations. You can use this id to retrieve the price info later. |
| `amount`                | `Object`           | `---`         | Object, which represents the calculation results.                                                       |
| `amount.total_incl_vat` | `Number`           | `12000`       | Total amount in cents, including VAT.                                                                   |
| `amount.total_excl_vat` | `Number`           | `10000`       | Total amount in cents, excluding VAT.                                                                   |
| `amount.vat_amount`     | `Number`           | `2000`        | VAT amount in cents.                                                                                    |
| `category`              | `String` or `null` | `ebook`       | Category used for calculating the vat rate.                                                             |
| `vat_rate`              | `Number`           | `20`          | VAT Value in percents                                                                                   |
| `country`               | `Object`           | `---`         | Information about the country, which was the target for your calculations                               |
| `country.code`          | `String`           | `DE`          | 2 symbol ISO country code                                                                               |
| `country.name`          | `String`           | `Germany`     | English name of the country                                                                             |
| `country.local_name`    | `String`           | `Deutschland` | Local name of the country, defaults to English                                                          |
| `country.member_state`  | `Boolean`          | `true`        | Identifies if the requested country a member state or not                                               |

## Calculate Price (Cold Price endpoint)

<mark style="color:blue;">`GET`</mark> `https://api.vatzen.com/v1/price`

*This endpoint is accessible with public key.*\
\
This method is used for price calculations, without storing them in the data base. You just get your result and that's it. If you want to later retrieve you pricing object, please use Hot endpoints (see the description below).

#### Query Parameters

| Name            | Type    | Description                                                                                                                                             |
| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amount          | number  | Amount in cents to modify by needed rate                                                                                                                |
| vat\_included   | boolean | If VAT already included in the amount you provide. We will do reverse calculation in this case                                                          |
| category        | string  | Product category (supported are audiobook, broadcasting, ebook, eperiodical, eservice, telecommunication). If not provided, standard rate would be used |
| country\_code   | string  | 2-digits ISO country code to lookup for the rate                                                                                                        |
| country\_name   | string  | Country name to lookup for the rate                                                                                                                     |
| ip\_address     | string  | Customer's IP address to lookup for the VAT rate                                                                                                        |
| use\_client\_ip | boolean | If we should use IP address from the request to obtain the proper VAT rate                                                                              |

{% tabs %}
{% tab title="200 Price entity returned with the calculation details" %}

```javascript
{
  "success": true,
  "amount": {
    "total_excl_vat": 10000,
    "total_incl_vat": 10500,
    "vat_amount": 500
  },
  "requested": {
    "amount": 10000,
    "vat_included": false
  },
  "category": "audiobook",
  "vat_rate": 5,
  "country": {
    "code": "DE",
    "name": "Germany",
    "local_name": "Germany",
    "member_state": true
  }
}
```

{% endtab %}
{% endtabs %}

## Calculate Price and store in the DB

<mark style="color:green;">`POST`</mark> `https://api.vatzen.com/v1/prices`

Calculates the price, just like the Cold price endpoint, but also stores the price object in our DB, so you can always retrieve it from there.

#### Query Parameters

| Name            | Type    | Description                                                                                                                                             |
| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amount          | number  | Amount in cents to modify by needed rate                                                                                                                |
| vat\_included   | boolean | If VAT already included in the amount you provide. We will do reverse calculation in this case                                                          |
| category        | string  | Product category (supported are audiobook, broadcasting, ebook, eperiodical, eservice, telecommunication). If not provided, standard rate would be used |
| country\_code   | string  | 2-digits ISO country code to lookup for the rate                                                                                                        |
| country\_name   | string  | Country name to lookup for the rate                                                                                                                     |
| ip\_address     | string  | Customer's IP address to lookup for the VAT rate                                                                                                        |
| use\_client\_ip | boolean | If we should use IP address from the request to obtain the proper VAT rate                                                                              |

{% tabs %}
{% tab title="200 Price entity returned with the calculation details, also id is assigned, which you can use later." %}

```javascript
{
  "success": true,
  "id": "ab123ba",
  "amount": {
    "total_excl_vat": 10000,
    "total_incl_vat": 10500,
    "vat_amount": 500
  },
  "requested": {
    "amount": 10000,
    "vat_included": false
  },
  "category": "audiobook",
  "vat_rate": 5,
  "country": {
    "code": "DE",
    "name": "Germany",
    "local_name": "Germany",
    "member_state": true
  }
}
```

{% endtab %}
{% endtabs %}

## Get Price by ID

<mark style="color:blue;">`GET`</mark> `https://api.vatzen.com/v1/prices/:price_id`

\
Returns information about the price by id, which you've got when doing POST request.

#### Path Parameters

| Name      | Type   | Description                                       |
| --------- | ------ | ------------------------------------------------- |
| price\_id | string | Price object id, retrieved from the POST endpoint |

{% tabs %}
{% tab title="200 Price object returned." %}

```javascript
{
  "success": true,
  "id": "ab123ba",
  "amount": {
    "total_excl_vat": 10000,
    "total_incl_vat": 10500,
    "vat_amount": 500
  },
  "requested": {
    "amount": 10000,
    "vat_included": false
  },
  "category": "audiobook",
  "vat_rate": 5,
  "country": {
    "code": "DE",
    "name": "Germany",
    "local_name": "Germany",
    "member_state": true
  }
}
```

{% endtab %}
{% endtabs %}

## Get All Prices

<mark style="color:blue;">`GET`</mark> `https://api.vatzen.com/v1/prices`

Returns all the prices, paginated

#### Query Parameters

| Name  | Type    | Description                                |
| ----- | ------- | ------------------------------------------ |
| limit | integer | Limit used for pagination, defaults to 100 |
| page  | integer | Page, defaults to 1                        |

{% tabs %}
{% tab title="200 Returns stored prices" %}

```javascript
{
  "success": true,
  "pagination": {
    "has_more": true,
    "total_count": 10
  },
  "prices": [
    {
      "id": "ab123ba",
      "amount": {
        "total_excl_vat": 10000,
        "total_incl_vat": 10500,
        "vat_amount": 500
      },
      "requested": {
        "amount": 10000,
        "vat_included": false
      },
      "category": "audiobook",
      "vat_rate": 5,
      "country": {
        "code": "DE",
        "name": "Germany",
        "local_name": "Germany",
        "member_state": true
      }
    },
    // ...
  ]
}
```

{% endtab %}
{% endtabs %}


# Generate Invoce

We created an invoicing service strictly in accordance with the requirements for VAT compliant invoicing published by the EU tax authorities. You can easily issue invoices VIA our API or dashboard.

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

Released Soon!


# NodeJS

Documentation for VatZen's NPM module

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

Source code is available on [GitHub](https://github.com/vatzen/vatzen-node).

NodeJS helper to connect your backend with VatZen <https://vatzen.com>. Before using the module, we highly encourage you to check out [our official documentation](https://documentation.vatzen.com/) before using this module.

### Installation

Module is published in NPM register and can be installed via npm or yarn as showed below:

```
npm install vatzen
```

or

```
yarn add vatzen
```

## Documentation

For more extensive documentation, please visit our official docs at <https://documentation.vatzen.com>

### General

Once you obtained your API key from [VatZen Dashboard](https://dashboard.vatzen.com), you can start using the module. To get started quickly, simply import the module and pass the API Key. After initialization, you can already start calling endpoints:

```typescript
import VatZen from 'vatzen';

const vatzenClient = new VatZen({ apiKey: 'YOUR_API_KEY' });

vatzenClient.rates
    .getByCountryCode('DE')
    .then(germanyVatRates => {
      console.log(germanyVatRates);
    })
    .catch((e: ErrorEntity) => {
      console.log('Something went wrong: ', e.errors.message);
    });
```

VatZen NPM module is TS-first and have a complete type-coverage, which is supported out-of-the-box.

#### General TypeScript Entities

```typescript
// Available VAT Categories
enum VatCategory {
  'audiobook' = 'audiobook',
  'broadcasting' = 'broadcasting',
  'ebook' = 'ebook',
  'eperiodical' = 'eperiodical',
  'eservice' = 'eservice',
  'telecommunication' = 'telecommunication',
}

// Interface which describes country
interface CountryEntity {
  code: string;
  name: string;
  local_name: string;
  member_state: boolean;
}

// Pagination information
interface PaginationEntity {
  total: number;
  has_more: boolean;
}

// Available error types
enum ErrorTypes {
  missing_api_key = 'missing_api_key',
  invalid_api_key = 'invalid_api_key',
  usage_limit_reached = 'usage_limit_reached',
  invalid_input = 'invalid_input',
  invalid_ip_address = 'invalid_ip_address',
  could_not_resolve_ip = 'could_not_resolve_ip',
  invalid_country_code = 'invalid_country_code',
  invalid_amount = 'invalid_amount',
}

// Error returned fomr the server
export interface ErrorEntity {
  statusCode: number;
  success: false;
  error: {
    code: number;
    type: ErrorTypes;
    message: string;
  };
}
```

### Rates

Before using the endpoint, you can familiarize yourself with our [Rates endpoint documentation](https://documentation.vatzen.com/api/vat-rates).

All the rates function are available inside `VatZen` object inside `rates` parameter. For example `vatzen.rates.find`.

#### Rate TypeScript Entity

```typescript
interface RateEntity {
  standard_rate: number;
  currency: string;
  country: CountryEntity;
  categories: {
    [categoryName in VatCategory]: number | undefined;
  };
}
```

#### All Rates

In order to obtain all the rates, you can use `rates.getAll()` function, which accepts optional `options` object with the following (also optional) keys:

| key           | type      | description                                     |
| ------------- | --------- | ----------------------------------------------- |
| `limit`       | `number`  | Limit for pagination                            |
| `page`        | `number`  | Page number, starting from 1                    |
| `memberState` | `boolean` | Response will be filtered by member states only |

`getAll` usage example:

```typescript
try {
  const allRates = await vatzen.rates.getAll({ memberState: true }).rates;
  console.log('Rates': allRates);
} catch (e: ErrorEntity) {
  // getAll will throw an error if something went wrong
}
```

Returns:

```typescript
interface GetAllRatesResponse {
  pagination: PaginationEntity;
  rates: RateEntity[];
}
```

#### Rate by Country Code

If you want to obtain the rate by known ISO Country Code, you can use `rates.getByCountryCode` function, which accepts country code string as a parameter. For example:

```typescript
try {
  const deVatRates = await vatzen.rates.getByCountryCode('DE');
  console.log('Germany VAT Rates': deVatRates);
} catch (e: ErrorEntity) {
  // getByCountryCode will throw an error if something went wrong
}
```

Returns `RateEntity`.

#### Find Rate

You can use VatZen to lookup country rate using different parameters, such as country name, country code or ip address. In order to do that, you can use `rates.find` function, which accepts options object with the following properties:

| key           | type      | description                                                          |
| ------------- | --------- | -------------------------------------------------------------------- |
| `countryCode` | `string`  | 2 characters ISO country code                                        |
| `countryName` | `string`  | Country name, for example `Germany`                                  |
| `ipAddress`   | `string`  | IP Address of your client which will be used to identify the country |
| `useClientIp` | `boolean` | If set to true, VatZen will extract ip address from the request      |

Example for using this function:

```typescript
try {
  const deVatRates = await vatzen.rates.find({ countryName: 'Germany' });
  console.log('Germany VAT Rates': deVatRates);
} catch (e: ErrorEntity) {
  // find will throw an error if something went wrong
}
```

Returns `RateEntity`.

### VAT Number Validation

Before using the endpoint, you can familiarize yourself with our [Validations endpoint documentation](https://documentation.vatzen.com/api/validate-vat-number).

All the rates function are available inside `VatZen` object inside `validations` parameter. For example `vatzen.validations.validate`.

#### Validation TypeScript Entity

```typescript
export interface ValidationEntity {
  id?: string;
  consultation_number?: string;
  requested: string;
  created: string;
  valid: boolean | null;
  query: string;
  country: CountryEntity;
  company: null | {
    name: string | null;
    address: string | null;
  };
  pending: boolean;
  valid_format: boolean;
  requester: null | {
    country_code: string;
    vat_number: string;
  };
}
```

#### Validate VAT Number

VAT number validation is implemented inside `validate` function, which accepts only 1 parameter - vat number string. As the response, it returns the complete `Validations` entity.

Example:

```typescript
try {
  const validationResult = await vatzen.validations.validate('LU123455');
  if (validationResult.valid) {
    console.log('Validated company: ': validationResult.company.name);
  }
} catch (e: ErrorEntity) {}
```

Returns `ValidationEntity`.

#### Create Validation

If you want to validate VAT number and store the validation, you can use `createValidation` function, which accepts VAT number as a parameter and returns VAT Entity.

Example:

```typescript
try {
  const validationResult = await vatzen.validations.createValidation('LU123455');
  if (validationResult.valid) {
    console.log('Validated company: ': validationResult.company.name);
  }
} catch (e: ErrorEntity) {}
```

Returns `ValidationEntity`.

#### Get validation by id

Returns stored validation object by id. Implemented in `getValidationById` function.

```typescript
try {
  const validation = await vatzen.validations.getValidationById('dgy13wjbhbj342');
  console.log('Fetched Validation:': validation);
} catch (e: ErrorEntity) {}
```

Returns `ValidationEntity`.

#### Get all validation

If you want to fetch all validations, you can use `getAll` function, which accepts optional options object with the following optional parameters:

| key     | type     | description                  |
| ------- | -------- | ---------------------------- |
| `limit` | `number` | Limit for pagination         |
| `page`  | `number` | Page number, starting from 1 |

Returns:

```typescript
interface GetAllValidationsResponse {
  pagination: PaginationEntity;
  validations: ValidationEntity[];
}
```

### Prices Calculations

VAT prices calculations are implemented inside `prices` module in vatzen client, which you can access via `vatzen.prices`. Before using this endpoint, make sure to read our [Official Prices Documentation](https://documentation.vatzen.com/api/calculate-price).

#### Price TypeScript Entity

```typescript
export interface PriceEntity {
  id?: string;
  amount: {
    total_incl_vat: 0;
    total_excl_vat: 0;
    vat_amount: 0;
  };
  category: VatCategory;
  vat_rate: 0;
  country: CountryEntity;
  requested: PriceCalculationRequest;
  success: true;
}
```

#### Calculate Price

Implemented via `vatzen.prices.calculate` function. Using this function, you can perform price calculation based on different parameters. If accepts options object, with 1 required fields: amount, and various option fields, which will be used to identify VAT rate.

| key           | type          | description                                                          |
| ------------- | ------------- | -------------------------------------------------------------------- |
| `amount`      | `number`      | Amount for VAT calculation in cents                                  |
| `vatIncluded` | `boolean`     | Identifies if VAT already included in amount                         |
| `category`    | `VatCategory` | VAT Category used for price calculations                             |
| `countryCode` | `string`      | 2 characters ISO country code                                        |
| `countryName` | `string`      | Country name, for example `Germany`                                  |
| `ipAddress`   | `string`      | IP Address of your client which will be used to identify the country |
| `useClientIp` | `boolean`     | If set to true, VatZen will extract ip address from the request      |

Example:

```typescript
const calculatePriceForGermany = await vatzenClient.prices.calculate({
  amount: 10000,
  countryCode: 'DE',
  category: VatCategory.audiobook,
});
console.log(
  '100 EUR with VAT for AudioBooks in Germany: ',
  Math.round(calculatePriceForGermany.amount.total_incl_vat / 100),
);
```

Returns `PriceEntity`.

#### Create Price Calculation

If you want to calculate price and store the calculation, you can use `createPriceCalculation` function, which accepts the same parameters as `calculate` function.

Example:

```typescript
const createdPriceForSpain = await vatzenClient.prices.createPriceCalculation(
  {
    amount: 10000,
    countryCode: 'ES',
  },
);
console.log('Created price ID: ', createdPriceForSpain.id);
```

Returns `PriceEntity`.

#### Get Price Calculation by id

Returns stored price calculation object by id. Implemented in `getPriceCalculationById` function.

```typescript
const retrievedPrice = await vatzenClient.prices.getPriceCalculationById(
  createdPriceForSpain.id,
);
console.log('Retrieved price: ', retrievedPrice);
```

Returns `PriceEntity`.

#### Get all price calculations

If you want to fetch all calculations you performed, you can use `getAll` function, which accepts optional options object with the following optional parameters:

| key     | type     | description                  |
| ------- | -------- | ---------------------------- |
| `limit` | `number` | Limit for pagination         |
| `page`  | `number` | Page number, starting from 1 |

Returns:

```typescript
interface GetAllPriceCalculationsResponse {
  pagination: PaginationEntity;
  validations: PriceEntity[];
}
```


# Ruby

Ruby helper to connect your backend with VatZen.

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

### Installation

Gem is published in RubyGems register and can be installed by following commands:

```
gem install vatzen
```

or

```
bundle add vatzen
```

## Documentation

For more extensive documentation, please visit our official docs at <https://documentation.vatzen.com>

### General

Once you obtained your API key from [VatZen Dashboard](https://dashboard.vatzen.com), you can start using the module. To get started quickly, simply import the module and pass the API Key. After initialization, you can already start calling endpoints:

```ruby
require 'vatzen'

vatzen = Vatzen.new('your api key')

rates = vatzen.rates.get_rates(member_state: true)
```

### Rates

Before using the endpoint, you can familiarize yourself with our [Rates endpoint documentation](https://documentation.vatzen.com/api/vat-rates).

All the rates function are available inside `VatZen` object inside `rates` parameter. For example `vatzen.rates.get_rates`.

#### All Rates

In order to obtain all the rates, you can use `rates.get_rates()` function, which accepts optional `options` object with the following (also optional) keys:

| key            | type      | description                                     |
| -------------- | --------- | ----------------------------------------------- |
| `limit`        | `number`  | Limit for pagination                            |
| `page`         | `number`  | Page number, starting from 1                    |
| `member_state` | `boolean` | Response will be filtered by member states only |

`getAll` usage example:

```ruby
vatzen.rates.get_rates(member_state: true)
```

#### Rate by Country Code

If you want to obtain the rate by known ISO Country Code, you can use `rates.get_rate_by_country_code` function, which accepts country code string as a parameter. For example:

```ruby
vatzen.rates.get_rate_by_country_code('FR')
```

#### Find Rate

You can use VatZen to lookup country rate using different parameters, such as country name, country code or ip address. In order to do that, you can use `rates.find` function, which accepts options object with the following properties:

| key             | type      | description                                                          |
| --------------- | --------- | -------------------------------------------------------------------- |
| `country_code`  | `string`  | 2 characters ISO country code                                        |
| `country_name`  | `string`  | Country name, for example `Germany`                                  |
| `ip_address`    | `string`  | IP Address of your client which will be used to identify the country |
| `use_client_ip` | `boolean` | If set to true, VatZen will extract ip address from the request      |

Example for using this function:

```ruby
vatzen.rates.get_rate(country_name: 'Germany')
```

### VAT Number Validation

Before using the endpoint, you can familiarize yourself with our [Validations endpoint documentation](https://documentation.vatzen.com/api/validate-vat-number).

All the rates function are available inside `VatZen` object inside `validation` parameter. For example `vatzen.validations.validate`.

#### Validate VAT Number

VAT number validation is implemented inside `validate` function, which accepts only 1 parameter - vat number string. As the response, it returns the complete `Validations` entity.

Example:

```ruby
vatzen.validation.validate('LU123455');
```

#### Create Validation

If you want to validate VAT number and store the validation, you can use `create_validation` function, which accepts VAT number as a parameter and returns VAT Entity.

Example:

```ruby
vatzen.validation.create_validation('LU123455');
```

#### Get validation by id

Returns stored validation object by id. Implemented in `get_validation_by_id` function.

```ruby
vatzen.validation.get_validation_by_id('dgy13wjbhbj342');
```

#### Get all validation

If you want to fetch all validations, you can use `get_validations` function, which accepts optional options object with the following optional parameters:

| key     | type     | description                  |
| ------- | -------- | ---------------------------- |
| `limit` | `number` | Limit for pagination         |
| `page`  | `number` | Page number, starting from 1 |

```ruby
vatzen.validation.get_validations(page: 2)
```

### Prices Calculations

VAT prices calculations are implemented inside `prices` module in vatzen client, which you can access via `vatzen.prices`. Before using this endpoint, make sure to read our [Official Prices Documentation](https://documentation.vatzen.com/api/calculate-price).

#### Calculate Price

Implemented via `vatzen.prices.calculate` function. Using this function, you can perform price calculation based on different parameters. If accepts options object, with 1 required fields: amount, and various option fields, which will be used to identify VAT rate.

| key             | type          | description                                                          |
| --------------- | ------------- | -------------------------------------------------------------------- |
| `amount`        | `number`      | Amount for VAT calculation in cents                                  |
| `vat_included`  | `boolean`     | Identifies if VAT already included in amount                         |
| `category`      | `VatCategory` | VAT Category used for price calculations                             |
| `country_code`  | `string`      | 2 characters ISO country code                                        |
| `country_name`  | `string`      | Country name, for example `Germany`                                  |
| `ip_address`    | `string`      | IP Address of your client which will be used to identify the country |
| `use_client_ip` | `boolean`     | If set to true, VatZen will extract ip address from the request      |

Example:

```ruby
calculate_price_for_germany = vatzen.prices.calculate(
  amount: 10000,
  country_code: 'DE',
  category: 'audiobook',
)

print '100 EUR with VAT for AudioBooks in Germany: ' + (calculate_price_for_germany['amount']['total_incl_vat'] / 100).to_s
```

#### Create Price Calculation

If you want to calculate price and store the calculation, you can use `create_price_calculation` function, which accepts the same parameters as `calculate` function.

Example:

```ruby
created_price_for_spain = vatzen.prices.create_price_calculation(
  amount: 10000,
  country_code: 'ES',
)

print 'Created price ID: ' + created_price_for_spain['id']
```

#### Get Price Calculation by id

Returns stored price calculation object by id. Implemented in `get_calculation_by_id` function.

```ruby
vatzen.prices.get_calculation_by_id(createdPriceForSpain['id'])
```

#### Get all price calculations

If you want to fetch all calculations you performed, you can use `get_prices` function, which accepts optional options object with the following optional parameters:

| key     | type     | description                  |
| ------- | -------- | ---------------------------- |
| `limit` | `number` | Limit for pagination         |
| `page`  | `number` | Page number, starting from 1 |


# Python

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

Coming soon...


