CartItem
Type: schema
Description
This Cart Item model captures the attributes of a cart item, including product details, pricing information, subscription details, and other relevant information related to Cart Item.
TypeScript Definition
typescript
CartItem: {{
/** @description Unique identifier for the product. */
product_id: string;
/** @description The product variant identifier. `null` if the product has no variants. */
variant_id: string | null;
/**
* @description Stock Keeping Unit, a unique identifier for the product within inventory.
* @example SKU1254
*/
sku: string | null;
/** @description Name of the product. */
product_name: string;
/** @description Name of the variant. */
variant_name: string | null;
product_slug: string | null;
variant_slug: string | null;
/**
* @example physical
* @enum {string}
*/
product_type: "physical" | "digital" | "bundle";
/** @description URL pointing to the product image. `null` when the product has no images. */
product_image_url: string | null;
/** @description Indicates whether the product is currently in stock. */
stock_available: 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 is currently on a subscription. */
on_subscription: boolean;
/** @description Indicates whether the product is part of a promotion. */
on_promotion: boolean;
/** @description The quantity of the product in the cart. */
quantity: number;
/** @description Indicates if the product is offered for free. */
is_free_item: boolean;
/** @description Quantity of the product that is free. */
free_quantity: number;
/**
* Format: double
* @description Discount amount due to promotions.
*/
promotion_discount_amount: number;
/**
* Format: double
* @description Discount amount due to applied coupons.
*/
coupon_discount_amount: number;
/**
* @description Indicates whether the item price is inclusive of taxes.
* @example false
*/
price_including_tax: boolean;
/**
* Format: double
* @example 200
*/
listing_price: number;
/**
* Format: double
* @example 199
*/
selling_price: number;
/** Format: double */
selling_price_excluding_tax: number;
/** @default 1 */
min_order_quantity: number;
max_order_quantity: number | null;
/** @default 1 */
incremental_quantity: number;
/** @description Additional cost for shipping associated with the product. */
handling_charge_excluding_tax: $Read<number>;
/** @description Additional cost for shipping associated with the product. */
handling_charge_tax_rate: $Read<number>;
/** @description Additional cost for shipping associated with the product. */
handling_charge_including_tax: $Read<number>;
/**
* @description Type of tax applied (e.g., GST).
* @default GST
* @constant
*/
tax_type: "GST";
/**
* Format: double
* @description The rate of tax applied to the product.
*/
tax_rate: number;
/**
* Format: double
* @description The total tax amount for the product.
*/
tax_amount: number;
associated_options: components["schemas"]["AssociatedOption"] | null;
/** @description The product's attributes. `null` or empty when the product has none. */
attributes: components["schemas"]["ProductAttribute"][] | null;
subscriptions: components["schemas"]["ProductSubscription"][] | null;
/** @description Seller ID. This field is relevant for marketplace type stores only. Will return null for b2b and b2c type stores. */
seller_id?: string | null;
/** @description Seller detail information. This field is relevant for marketplace type stores only. Will return null for b2b and b2c type stores. */
seller_detail?: components["schemas"]["SellerInfo"] | null;
/** @description Selling price before item-level discounts. */
original_selling_price?: number;
/** @description Total discount amount applied to the line. */
discount_amount?: number;
subscription_plan?: string | null;
/** @description Interval of the line's subscription plan. `null` when the line is not on a subscription. */
subscription_interval?: number | null;
subscription_frequency?: string | null;
subscription_eligibility?: boolean;
/** @description Available subscription plans for the line (same data as `subscriptions`). */
available_subscription_plans?: unknown[] | null;
/** @description Seller's product ID. Relevant for marketplace stores; `null` otherwise. */
seller_product_id?: string | null;
/** @description Seller's variant ID. Relevant for marketplace stores; `null` otherwise. */
seller_variant_id?: string | null;
};
/**
* CartLifecycleEvent
* @description Emitted when a cart is created or deleted, or when checkout begins. `Checkout Started` is sent each time an address is set on the cart, even an unchanged one, matching Commerce Engine's own server-side copy.
*/
}Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["AssociatedOption"] | AssociatedOption |
components["schemas"]["ProductAttribute"] | ProductAttribute |
components["schemas"]["ProductSubscription"] | ProductSubscription |
components["schemas"]["SellerInfo"] | SellerInfo |
OpenAPI Schema
json
{
"description": "This Cart Item model captures the attributes of a cart item, including product details, pricing information, subscription details, and other relevant information related to Cart Item.",
"type": "object",
"properties": {
"product_id": {
"description": "Unique identifier for the product.",
"type": "string",
"pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$"
},
"variant_id": {
"description": "The product variant identifier. `null` if the product has no variants.",
"type": [
"string",
"null"
],
"pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$"
},
"sku": {
"description": "Stock Keeping Unit, a unique identifier for the product within inventory.",
"type": [
"string",
"null"
],
"examples": [
"SKU1254"
]
},
"product_name": {
"description": "Name of the product.",
"type": "string"
},
"variant_name": {
"description": "Name of the variant.",
"type": [
"string",
"null"
]
},
"product_slug": {
"type": [
"string",
"null"
]
},
"variant_slug": {
"type": [
"string",
"null"
]
},
"product_type": {
"type": "string",
"enum": [
"physical",
"digital",
"bundle"
],
"examples": [
"physical"
]
},
"product_image_url": {
"description": "URL pointing to the product image. `null` when the product has no images.",
"type": [
"string",
"null"
]
},
"stock_available": {
"description": "Indicates whether the product is currently in stock.",
"type": "boolean"
},
"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 is currently on a subscription.",
"type": "boolean"
},
"on_promotion": {
"description": "Indicates whether the product is part of a promotion.",
"type": "boolean"
},
"quantity": {
"description": "The quantity of the product in the cart.",
"type": "integer"
},
"is_free_item": {
"description": "Indicates if the product is offered for free.",
"type": "boolean"
},
"free_quantity": {
"description": "Quantity of the product that is free.",
"type": "integer"
},
"promotion_discount_amount": {
"description": "Discount amount due to promotions.",
"type": "number",
"format": "double"
},
"coupon_discount_amount": {
"description": "Discount amount due to applied coupons.",
"type": "number",
"format": "double"
},
"price_including_tax": {
"description": "Indicates whether the item price is inclusive of taxes.",
"type": "boolean",
"examples": [
false
]
},
"listing_price": {
"type": "number",
"format": "double",
"example": 200
},
"selling_price": {
"type": "number",
"format": "double",
"example": 199
},
"selling_price_excluding_tax": {
"type": "number",
"format": "double"
},
"min_order_quantity": {
"type": "integer",
"default": 1
},
"max_order_quantity": {
"type": [
"integer",
"null"
]
},
"incremental_quantity": {
"type": "integer",
"default": 1
},
"handling_charge_excluding_tax": {
"description": "Additional cost for shipping associated with the product.",
"type": "number",
"minimum": 0,
"readOnly": true
},
"handling_charge_tax_rate": {
"description": "Additional cost for shipping associated with the product.",
"type": "number",
"minimum": 0,
"readOnly": true
},
"handling_charge_including_tax": {
"description": "Additional cost for shipping associated with the product.",
"type": "number",
"minimum": 0,
"readOnly": true
},
"tax_type": {
"description": "Type of tax applied (e.g., GST).",
"type": "string",
"default": "GST",
"const": "GST"
},
"tax_rate": {
"description": "The rate of tax applied to the product.",
"type": "number",
"format": "double"
},
"tax_amount": {
"description": "The total tax amount for the product.",
"type": "number",
"format": "double"
},
"associated_options": {
"oneOf": [
{
"$ref": "#/components/schemas/AssociatedOption",
"description": "Used when `variant_id` is not null."
},
{
"type": "null",
"description": "Null when `variant_id` is null."
}
]
},
"attributes": {
"description": "The product's attributes. `null` or empty when the product has none.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/components/schemas/ProductAttribute"
}
},
"subscriptions": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/components/schemas/ProductSubscription"
}
},
"seller_id": {
"description": "Seller ID. This field is relevant for marketplace type stores only. Will return null for b2b and b2c type stores.",
"type": [
"string",
"null"
]
},
"seller_detail": {
"description": "Seller detail information. This field is relevant for marketplace type stores only. Will return null for b2b and b2c type stores.",
"oneOf": [
{
"$ref": "#/components/schemas/SellerInfo"
},
{
"type": "null"
}
]
},
"original_selling_price": {
"description": "Selling price before item-level discounts.",
"type": "number"
},
"discount_amount": {
"description": "Total discount amount applied to the line.",
"type": "number"
},
"subscription_plan": {
"type": [
"string",
"null"
]
},
"subscription_interval": {
"description": "Interval of the line's subscription plan. `null` when the line is not on a subscription.",
"type": [
"integer",
"null"
]
},
"subscription_frequency": {
"type": [
"string",
"null"
]
},
"subscription_eligibility": {
"type": "boolean"
},
"available_subscription_plans": {
"description": "Available subscription plans for the line (same data as `subscriptions`).",
"type": [
"array",
"null"
]
},
"seller_product_id": {
"description": "Seller's product ID. Relevant for marketplace stores; `null` otherwise.",
"type": [
"string",
"null"
]
},
"seller_variant_id": {
"description": "Seller's variant ID. Relevant for marketplace stores; `null` otherwise.",
"type": [
"string",
"null"
]
}
},
"examples": [],
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/schemas/CartItem",
"description": "API reference for the CartItem schema"
},
"required": [
"product_id",
"variant_id",
"sku",
"product_slug",
"variant_slug",
"product_name",
"variant_name",
"product_type",
"product_image_url",
"stock_available",
"backorder",
"on_subscription",
"on_promotion",
"quantity",
"is_free_item",
"free_quantity",
"promotion_discount_amount",
"coupon_discount_amount",
"price_including_tax",
"listing_price",
"selling_price",
"selling_price_excluding_tax",
"min_order_quantity",
"max_order_quantity",
"incremental_quantity",
"handling_charge_excluding_tax",
"handling_charge_tax_rate",
"handling_charge_including_tax",
"tax_type",
"tax_rate",
"tax_amount",
"associated_options",
"attributes",
"subscriptions"
],
"title": "CartItem"
}Auto-generated from OpenAPI spec and TypeScript definitions