# Set the entity's VAT number

Source: https://amanucci.com/fr/docs/developers/api/settings/setEntityVatNumber

## POST /v1/entities/{entityId}/vat-number

Set the entity's VAT number

Set the entity's own VAT number, once — the declarant every return it files names and the seller's on every invoice, one number on its seller party: the organisation's owner or a firm accountant holding `settings.policy` (a member or a staffer meets 403 `authority-required`). A compare-and-set, like `setEntityIban`: the write applies only while the stored value is `expectedVatNumber` (409 `entity_vat_number_conflict` otherwise); the same number again is duplicate-ok (200, `duplicate: true`); a number already stored never moves or clears (409 `entity_identity_frozen`). The entity's pack set's identifier check judges the number (422 `entity_vat_number_invalid`); the stored shape is a database CHECK, and a number another contact of these books holds is 422 `party_vat_taken`. One company keeps one set of books: a VAT number another entity's seller holds while neither has an enterprise number is 409 `party_company_onboarded`, whose words name no other firm or entity. Not a signed act.

Operation ID: `setEntityVatNumber`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  }
]
```

### Request body

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SetEntityVatNumber"
      }
    }
  }
}
```

### Responses

#### 200 The VAT number now stored (or already stored: `duplicate: true`).

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/SetEntityVatNumberResult"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 409 The world is not in the state the request assumed: a stale `expectedSeq`, or a transition already made.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
