# Partita IVA (VAT)

Validazione di una partita IVA all'interno dell'Unione Europea

## Controlla la validità di una partita IVA

<mark style="color:green;">`POST`</mark> `https://api.gsped.it/[ISTANZA]/validation/vat`

#### Headers

| Name                                        | Type   | Description             |
| ------------------------------------------- | ------ | ----------------------- |
| x-api-key<mark style="color:red;">\*</mark> | String | APIKEY fornita da Gsped |

#### Request Body

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| country<mark style="color:red;">\*</mark> | String | Nazione c.f. in ISO-2 code  |
| value<mark style="color:red;">\*</mark>   | String | Valore p.iva da controllare |

{% tabs %}
{% tab title="200: OK Chiamata corretta" %}
Chiamata effettuata, verificare se valido dalla risposta (campo isValid)

```json
{
    "result": {
        "isValid": true, // riepilogo se valido
        "infos": {
            "userError": "VALID",
            "name": "'GSPED SOCIETA' COOPERATIVA'",
            "address": "CORSO FELICE CAVALLOTTI 15 \n15121 ALESSANDRIA AL\n",
            "originalVatNumber": "02554360061",
            "vatNumber": "02554360061",
            "statusCode": 200 // codice risposta servizio interrogato
        }
    },
    "code": 200 // codice risposta Gsped ripetuto nel payload
}
```

{% endtab %}

{% tab title="400: Bad Request Dati non corretti" %}
Campo error con descrizione dell'errore

```json
{
    "error": "country: This value should have exactly 2 characters.",
    "code": 400
}
```

{% endtab %}

{% tab title="500: Internal Server Error Errore durante la validazione" %}

```json
{
    "error": "Errore durante il processo di validazione",
    "code": 500
}
```

{% endtab %}
{% endtabs %}


---

# 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://apidocs.gsped.com/validation/validation/partita-iva-vat.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.
