# Update product

`PUT /v1/products/{id}`

Updates a product. Only provided fields are updated. Returns 409 when the product number is already used.

**Scopes:** any of `products:write`, `write:draft`, `write:ledger`

## Request

```bash
curl -X PUT https://api.numina.app/v1/products/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer numi_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "product_number": "1001",
    "description": "Consulting hour",
    "quantity": 1,
    "unit": "hour",
    "unit_price": 950,
    "sales_account_number": 1000,
    "use_account_vat": true,
    "vat_code": "U25"
  }'
```

## Path parameters

- `id` (string (uuid), required): Product ID

## Body (`application/json`)

- `product_number` (string, optional, nullable): Product number (varenummer). Must be unique within the company; null or empty clears it. (max 64 chars)
- `description` (string, optional): Product name (max 500 chars)
- `quantity` (number, optional): Default quantity (≥ 0)
- `unit` (string, optional): Unit One of: `unit`, `hour`, `day`, `kilometer`, `week`, `month`.
- `unit_price` (number, optional): Unit price (excl. VAT)
- `sales_account_number` (integer, optional): Account number of a sales account (from GET /v1/accounts)
- `use_account_vat` (boolean, optional): Use the sales account's default VAT code. Cannot be combined with vat_code.
- `vat_code` (string, optional, nullable): Sales VAT code (e.g. 'U25') from GET /v1/vat-codes, or null for no VAT. Setting it turns use_account_vat off.

## Response `200`

Product updated successfully

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "product_number": "1001",
  "description": "Consulting hour",
  "quantity": 1,
  "unit": "hour",
  "unit_price": 950,
  "sales_account_number": 1000,
  "use_account_vat": true,
  "vat_code": null
}
```

## Errors

- `400` Bad Request - Invalid input or validation failed
- `401` Unauthorized - Invalid or missing authentication
- `403` Forbidden - Missing scope, or the company is archived
- `404` Not Found - The resource does not exist in this company
- `409` Conflict - The product number is already used
- `429` Too Many Requests - Rate limit exceeded
- `500` Internal Server Error

See https://developers.numina.app/errors.md for the error format.
