---
title: "Save and check the company's VAT ID"
description: "Other routes API"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.certinvo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Save and check the company's VAT ID

{/* Generated by apps/docs/scripts/generate.ts from contracts/api/openapi.yaml. Do not edit. */}
<div class="cvo-op">
<div class="cvo-op-main">

<div class="cvo-op-header">
<div class="cvo-op-path-row">
<span class="cvo-method" data-method="put">PUT</span>
<code class="cvo-op-path-code">/v1/company/vat-id</code>
</div>
</div>

Saves the VAT ID of the company's Head office and asks VIES whether it is valid. A company with no Head office yet gets one, in the company's country. Spaces and dots are removed and letters are made capitals. The VAT ID must start with the prefix of an EU member state (Greece is `EL`), followed by 2 to 12 letters or digits with at least one digit; anything else is refused before VIES is asked. VIES's answer is stored as the Head office's next version that names the person, and returned. `unavailable` means VIES could not answer, never that the number is invalid. Nothing is blocked by the answer. Only a signed-in person can save it. An API key is refused with 401 `session_required`.

## Request body

`application/json`, required

## Response

A `200` answer carries these fields.

## Status codes

| Status | Meaning |
|---|---|
| `200` | The saved VAT ID with VIES's answer. |
| `400` | The body is not `{"vatId": "..."}`, or the VAT ID cannot be an EU VAT ID (`invalid_vat_id`). VIES was not asked and nothing was saved. |
| `401` | No usable credential was sent (`invalid_credentials`), or an API key was used (`session_required`). |
| `501` | This deployment has no database, so it keeps no VAT ID (`no_database`). Sending the same request again will not help. |

</div>
<div class="cvo-op-aside">

</div>
</div>

Source: https://docs.certinvo.com/reference/api/other/save-and-check-the-company-s-vat-id/index.mdx
