# Set a vehicle's VAT use for a year

Source: https://amanucci.com/docs/developers/api/settings/appendVehicleVatUse

## POST /v1/entities/{entityId}/vehicles/{plate}/vat-use/{year}

Set a vehicle's VAT use for a year

Set a vehicle's VAT use for a year, or append its next version. The organisation's owner or a firm accountant holding `ledger.manage` (a member or a staffer meets 403 `authority-required`). `expectedSeq` is the pinned-row idempotency key: identical retry 200, stale head 409. The database judges it (422 `vehicle_vat_use_invalid`, each refusal by name): the method's inputs, a registered vehicle, a light truck on the trip log or business-only use, the formula not in the delivery year, the flat rate never beside the formula in a year and binding four calendar years.

Operation ID: `appendVehicleVatUse`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "minLength": 2,
      "maxLength": 20,
      "description": "The plate, as printed: separators and case are ignored (`1-abc-234` is `1ABC234`)."
    },
    "required": true,
    "description": "The plate, as printed: separators and case are ignored (`1-abc-234` is `1ABC234`).",
    "name": "plate",
    "in": "path"
  },
  {
    "schema": {
      "type": "integer",
      "minimum": 1971,
      "maximum": 9999,
      "description": "The calendar year."
    },
    "required": true,
    "description": "The calendar year.",
    "name": "year",
    "in": "path"
  }
]
```

### Request body

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

### Responses

#### 200 Duplicate-ok: this exact version was already the head.

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

#### 201 The new head.

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

#### 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"
    }
  }
}
```
