Skip to content

Product ​

Type: schema

TypeScript Definition ​

typescript
Product: {{
            /** @description The ID of the product */
            id: string;
            /** @description Stock Keeping Unit. `null` for products that only have variant-level SKUs. */
            sku: string | null;
            name: string;
            slug: string;
            short_description: string | null;
            /**
             * @example physical
             * @enum {string}
             */
            product_type: "physical" | "digital" | "bundle";
            active: $Read<boolean>;
            /** @description Indicates whether the product has stock available */
            stock_available: $Read<boolean>;
            /** @description Indicates whether the item is being fulfilled as a backorder. When true, the item is not currently in stock and will ship later once inventory is available. This may result in the order being split into multiple shipments, with delays for the backordered portion. */
            backorder?: boolean;
            /** @description Indicates whether the product has any subscription plans avaialble */
            on_subscription: $Read<boolean>;
            /** @description Indicates whether the product is currently on promotion. When true, the `ProductPromotion` object will contain details of the promotion */
            on_promotion: $Read<boolean>;
            /** @description Indicates whether the product has variants */
            has_variant: $Read<boolean>;
            /** @description Freeform tags for filtering and search. `null` if no tags are assigned. */
            tags: string[] | null;
            /** @description IDs of categories this product belongs to. */
            category_ids: string[];
            /** @description Expanded category objects for this product. */
            categories: components["schemas"]["Category"][];
            /**
             * Format: double
             * @description Sum of approved review ratings, preserving fractional ratings. Zero when there are no approved reviews. Divide by reviews_count when nonzero to compute the average.
             */
            reviews_rating_sum: number;
            /** @description Number of approved reviews; pending, rejected and archived reviews are excluded. */
            reviews_count: number;
            /** @description HSN/SAC tax classification code. `null` when not configured. */
            hsn_code: string | null;
            /** @description Custom product attributes (e.g., color, size, material) configured in the store. */
            attributes: components["schemas"]["ProductAttribute"][];
            /** @description Pricing for the applicable customer group. `null` for products with variants (pricing is per-variant) or when no pricing is configured. */
            pricing: components["schemas"]["ProductPricing"] | null;
            /** @description Available variant option axes (e.g., Size, Color) with their possible values. Present only when `has_variant` is `true`. */
            variant_options: components["schemas"]["VariantOption"][] | null;
            promotion: components["schemas"]["ProductPromotion"];
            /** @description Product images ordered by display priority. */
            images: components["schemas"]["ProductImage"][];
            videos?: components["schemas"]["ProductVideo"][];
            subscription: components["schemas"]["ProductSubscription"][];
            /** @description Product variants with individual pricing and inventory. Empty array when `has_variant` is `false`. */
            variants: components["schemas"]["Variant"][];
            /** @description Component products included in this bundle. Only present when `product_type` is `bundle`. */
            bundle_items: components["schemas"]["ProductBundleItem"];
            inventory?: components["schemas"]["LotBatchDetail"][];
        };
}

Component References ​

ReferenceResolves To
components["schemas"]["Category"]Category
components["schemas"]["ProductAttribute"]ProductAttribute
components["schemas"]["ProductPricing"]ProductPricing
components["schemas"]["VariantOption"]VariantOption
components["schemas"]["ProductPromotion"]ProductPromotion
components["schemas"]["ProductImage"]ProductImage
components["schemas"]["ProductVideo"]ProductVideo
components["schemas"]["ProductSubscription"]ProductSubscription
components["schemas"]["Variant"]Variant
components["schemas"]["ProductBundleItem"]ProductBundleItem
components["schemas"]["LotBatchDetail"]LotBatchDetail

OpenAPI Schema ​

json
{
  "title": "Product",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/Product",
    "description": "API reference for the Product schema"
  },
  "required": [
    "id",
    "sku",
    "name",
    "slug",
    "short_description",
    "product_type",
    "active",
    "stock_available",
    "on_subscription",
    "on_promotion",
    "has_variant",
    "tags",
    "category_ids",
    "categories",
    "reviews_rating_sum",
    "reviews_count",
    "hsn_code",
    "attributes",
    "pricing",
    "variant_options",
    "promotion",
    "images",
    "subscription",
    "variants",
    "bundle_items"
  ],
  "properties": {
    "id": {
      "description": "The ID of the product",
      "type": "string"
    },
    "sku": {
      "description": "Stock Keeping Unit. `null` for products that only have variant-level SKUs.",
      "type": [
        "string",
        "null"
      ]
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "short_description": {
      "type": [
        "string",
        "null"
      ]
    },
    "product_type": {
      "type": "string",
      "enum": [
        "physical",
        "digital",
        "bundle"
      ],
      "examples": [
        "physical"
      ]
    },
    "active": {
      "type": "boolean",
      "readOnly": true
    },
    "stock_available": {
      "description": "Indicates whether the product has stock available",
      "type": "boolean",
      "readOnly": true
    },
    "backorder": {
      "description": "Indicates whether the item is being fulfilled as a backorder. When true, the item is not currently in stock and will ship later once inventory is available. This may result in the order being split into multiple shipments, with delays for the backordered portion.",
      "type": "boolean"
    },
    "on_subscription": {
      "description": "Indicates whether the product has any subscription plans avaialble",
      "type": "boolean",
      "readOnly": true
    },
    "on_promotion": {
      "description": "Indicates whether the product is currently on promotion. When true, the `ProductPromotion` object will contain details of the promotion",
      "type": "boolean",
      "readOnly": true
    },
    "has_variant": {
      "description": "Indicates whether the product has variants",
      "type": "boolean",
      "readOnly": true
    },
    "tags": {
      "description": "Freeform tags for filtering and search. `null` if no tags are assigned.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "category_ids": {
      "description": "IDs of categories this product belongs to.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "categories": {
      "description": "Expanded category objects for this product.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Category"
      }
    },
    "reviews_rating_sum": {
      "description": "Sum of approved review ratings, preserving fractional ratings. Zero when there are no approved reviews. Divide by reviews_count when nonzero to compute the average.",
      "type": "number",
      "format": "double"
    },
    "reviews_count": {
      "description": "Number of approved reviews; pending, rejected and archived reviews are excluded.",
      "type": "integer"
    },
    "hsn_code": {
      "description": "HSN/SAC tax classification code. `null` when not configured.",
      "type": [
        "string",
        "null"
      ]
    },
    "attributes": {
      "description": "Custom product attributes (e.g., color, size, material) configured in the store.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ProductAttribute"
      }
    },
    "pricing": {
      "description": "Pricing for the applicable customer group. `null` for products with variants (pricing is per-variant) or when no pricing is configured.",
      "oneOf": [
        {
          "$ref": "#/components/schemas/ProductPricing"
        },
        {
          "type": "null"
        }
      ]
    },
    "variant_options": {
      "description": "Available variant option axes (e.g., Size, Color) with their possible values. Present only when `has_variant` is `true`.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/components/schemas/VariantOption"
      }
    },
    "promotion": {
      "$ref": "#/components/schemas/ProductPromotion"
    },
    "images": {
      "description": "Product images ordered by display priority.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ProductImage"
      }
    },
    "videos": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ProductVideo"
      }
    },
    "subscription": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ProductSubscription"
      }
    },
    "variants": {
      "description": "Product variants with individual pricing and inventory. Empty array when `has_variant` is `false`.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Variant"
      }
    },
    "bundle_items": {
      "description": "Component products included in this bundle. Only present when `product_type` is `bundle`.",
      "$ref": "#/components/schemas/ProductBundleItem"
    },
    "inventory": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/LotBatchDetail"
      }
    }
  },
  "examples": []
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: