# `catalog.stock.adjust` Adjust stock by a ± delta (receiving, stocktake, connector sync). Fails on untracked items; expectedStock = compare-and-set. - **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 | | | `delta` | integer (-1000000..1000000) | yes | | | `reason` | "adjust" \| "correction" \| "return" \| "import" \| "sync" | no | | | `channel` | string (/^[a-z0-9_]{2,24}$/, default "storefront") | no | | | `refType` | string (≤32 chars) | no | | | `refId` | string (≤64 chars) | no | | | `note` | string (≤200 chars) | no | | | `expectedStock` | integer (0..9007199254740991) | no | | | `allowNegative` | boolean (default false) | no | | ### 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}$" } ] }, "delta": { "type": "integer", "minimum": -1000000, "maximum": 1000000 }, "reason": { "default": "adjust", "type": "string", "enum": [ "adjust", "correction", "return", "import", "sync" ] }, "channel": { "default": "storefront", "type": "string", "pattern": "^[a-z0-9_]{2,24}$" }, "refType": { "type": "string", "maxLength": 32 }, "refId": { "type": "string", "maxLength": 64 }, "note": { "type": "string", "minLength": 1, "maxLength": 200 }, "expectedStock": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "allowNegative": { "default": false, "type": "boolean" } }, "required": [ "id", "delta" ], "additionalProperties": false } ```