catalog.stock.set

Set stock of a product (prd_) or variant (var_). null = untracked (always available).

Payload

fieldtyperequirednotes
idstring (/^prd_[a-zA-Z0-9]{1,32}$/) | string (/^var_[a-zA-Z0-9]{1,32}$/)yes
stockinteger (0..9007199254740991) | nullyes

JSON Schema

{
  "$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
}
Generated from the live platform registries at build time โ€” reference pages cannot go stale. Markdown variant: /reference/commands/catalog.stock.set.md