Skip to content

UpdateCartItem

Type: schema

Description

Schema for updating a cart item, including adding, removing, or adjusting the quantity of a product or variant.

TypeScript Definition

typescript
UpdateCartItem: {{
            /**
             * @description The ID of the product to update in the cart.
             * @example 01H9XYZ12345ABCDE
             */
            product_id: string;
            /**
             * @description The ID of the product variant, or null if the product has no variants.
             * @example null
             */
            variant_id: string | null;
            /**
             * @description The quantity of the product to add to or update in the cart. Use `0` to remove the item from the cart.
             * @example 1
             */
            quantity: number;
        };
        /** UpdateCustomer */
}

OpenAPI Schema

json
{
  "title": "UpdateCartItem",
  "description": "Schema for updating a cart item, including adding, removing, or adjusting the quantity of a product or variant.",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/UpdateCartItem",
    "description": "API reference for the UpdateCartItem schema"
  },
  "required": [
    "product_id",
    "variant_id",
    "quantity"
  ],
  "properties": {
    "product_id": {
      "description": "The ID of the product to update in the cart.",
      "type": "string",
      "examples": [
        "01H9XYZ12345ABCDE"
      ]
    },
    "variant_id": {
      "description": "The ID of the product variant, or null if the product has no variants.",
      "type": [
        "string",
        "null"
      ],
      "examples": [
        null
      ]
    },
    "quantity": {
      "description": "The quantity of the product to add to or update in the cart. Use `0` to remove the item from the cart.",
      "type": "integer",
      "examples": [
        1
      ],
      "minimum": 0
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: