Sets a product's stock at a storage location. You pass the final stock, not the change: Controlata creates an adjustment for the difference between the current and the new stock.

```
v1/products/update_stock.php
```

## Parameters

| Field | Type | Required | Description |
|---|---|---|---|
| product_id | int | Yes | Product ID |
| storage_id | int | Yes | Storage location ID |
| stock | float | Yes | New stock |
| notes | string | No | Notes for the adjustment |

If stock sync with Shopify is connected in Controlata, the new stock is sent to Shopify per its settings, like any other stock change.

## Example request

```
{
    "product_id": 3120,
    "storage_id": 3999,
    "stock": 12,
    "notes": "Stocktake at the storage location"
}
```

## Example response

```
{
    "success": true
}
```

## Errors

| Error | Reason |
|---|---|
| No stock in input | A required field is missing (instead of stock, the field's name) |
| Invalid stock value. Must be a number | The stock is not a number, e.g. "" or "4,2" |
| Storage ID not found | Storage location not found or deleted |
| Product not found or access denied | Product not found or deleted |
