# `catalog.stock.set` Set stock of a product (prd_) or variant (var_). null = untracked (always available). - **scope**: `catalog:write` - **storefront-visible** (bumps the catalog generation): no - **destructive**: no ## Payload | field | type | required | notes | |---|---|---|---| | `id` | string (/^prd_[a-zA-Z0-9]{1,32}$/) \| string (/^var_[a-zA-Z0-9]{1,32}$/) | yes | | | `stock` | integer (0..9007199254740991) \| null | yes | | ### JSON Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "anyOf": [ { "type": "string", "pattern": "^prd_[a-zA-Z0-9]{1,32}$" }, { "type": "string", "pattern": "^var_[a-zA-Z0-9]{1,32}$" } ] }, "stock": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "null" } ] } }, "required": [ "id", "stock" ], "additionalProperties": false } ```