Skip to content

ItemStockTotals ​

Type: schema

Description ​

An item's stock as inventory.updated carries it for an item without stock settings, or a marketplace store's item: its quantities summed across warehouses and batches.

TypeScript Definition ​

typescript
ItemStockTotals: {{
            product_id: string;
            product_name: string;
            /** @description `null` for a product without variants. */
            variant_id: string | null;
            /** @description `null` for a product without variants. */
            variant_name: string | null;
            stock_quantity: number;
            reserved_quantity: number;
            received_quantity: number;
            sold_quantity: number;
            /** @description The quantity below which the item counts as low on stock; `null` when it has no stock settings. */
            low_stock_threshold: number | null;
            /** @description What the change did to the stock, each activity once, in order. */
            activities: components["schemas"]["StockActivity"][];
        };
        /** KycDocument */
}

Component References ​

ReferenceResolves To
components["schemas"]["StockActivity"]StockActivity

OpenAPI Schema ​

json
{
  "title": "ItemStockTotals",
  "description": "An item's stock as `inventory.updated` carries it for an item without stock settings, or a marketplace store's item: its quantities summed across warehouses and batches.",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/ItemStockTotals",
    "description": "API reference for the ItemStockTotals schema"
  },
  "required": [
    "product_id",
    "product_name",
    "variant_id",
    "variant_name",
    "stock_quantity",
    "reserved_quantity",
    "received_quantity",
    "sold_quantity",
    "low_stock_threshold",
    "activities"
  ],
  "properties": {
    "product_id": {
      "type": "string"
    },
    "product_name": {
      "type": "string"
    },
    "variant_id": {
      "description": "`null` for a product without variants.",
      "type": [
        "string",
        "null"
      ]
    },
    "variant_name": {
      "description": "`null` for a product without variants.",
      "type": [
        "string",
        "null"
      ]
    },
    "stock_quantity": {
      "type": "number"
    },
    "reserved_quantity": {
      "type": "number"
    },
    "received_quantity": {
      "type": "number"
    },
    "sold_quantity": {
      "type": "number"
    },
    "low_stock_threshold": {
      "description": "The quantity below which the item counts as low on stock; `null` when it has no stock settings.",
      "type": [
        "number",
        "null"
      ]
    },
    "activities": {
      "description": "What the change did to the stock, each activity once, in order.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StockActivity"
      }
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: