Skip to content

UpdateCartItem ​

Type: schema

Description ​

Identify a line by SKU or by product and optional variant. A non-null variant requires product_id and cannot be combined with SKU. Use quantity 0 to remove it.

TypeScript Definition ​

typescript
UpdateCartItem: {{
            /**
             * @description The ID of the product to update in the cart.
             * @example 01H9XYZ12345ABCDE
             */
            product_id?: string;
            /** @description Omit or send null when identifying the line by SKU. */
            variant_id?: 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;
            sku: string;
            on_subscription?: boolean;
            subscription_plan?: string | null;
        } | {
            /**
             * @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;
            sku?: string;
            on_subscription?: boolean;
            subscription_plan?: string | null;
        };
        /**
         * UpdateCustomer
         * @description Names, email, phone, country code, group and tier IDs, status, and tag items, where supported, are trimmed of surrounding whitespace and reject blank or whitespace-only strings. When email, phone or country_code is supplied, the resulting stored contacts must retain at least one email or phone. Contact uniqueness is global across users and stores, including collisions with usernames.
         */
}

OpenAPI Schema ​

json
{
  "description": "Identify a line by SKU or by product and optional variant. A non-null variant requires product_id and cannot be combined with SKU. Use quantity 0 to remove it.",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "product_id": {
          "description": "The ID of the product to update in the cart.",
          "type": "string",
          "examples": [
            "01H9XYZ12345ABCDE"
          ],
          "minLength": 1,
          "pattern": "\\S"
        },
        "variant_id": {
          "description": "Omit or send null when identifying the line by SKU.",
          "type": "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
        },
        "sku": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "on_subscription": {
          "type": "boolean"
        },
        "subscription_plan": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "\\S"
        }
      },
      "required": [
        "quantity",
        "sku"
      ],
      "not": {
        "required": [
          "sku",
          "variant_id"
        ],
        "properties": {
          "variant_id": {
            "type": "string"
          }
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "product_id": {
          "description": "The ID of the product to update in the cart.",
          "type": "string",
          "examples": [
            "01H9XYZ12345ABCDE"
          ],
          "minLength": 1,
          "pattern": "\\S"
        },
        "variant_id": {
          "description": "The ID of the product variant, or null if the product has no variants.",
          "type": [
            "string",
            "null"
          ],
          "examples": [
            null
          ],
          "minLength": 1,
          "pattern": "\\S"
        },
        "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
        },
        "sku": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "on_subscription": {
          "type": "boolean"
        },
        "subscription_plan": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "pattern": "\\S"
        }
      },
      "required": [
        "quantity",
        "product_id"
      ],
      "not": {
        "required": [
          "sku",
          "variant_id"
        ],
        "properties": {
          "variant_id": {
            "type": "string"
          }
        }
      }
    }
  ],
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/admin-pos/schemas/UpdateCartItem"
  },
  "title": "UpdateCartItem"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: