CartLineChangeEvent
Type: schema
Description
Emitted when a cart line's quantity changes. Product Added carries the units added and Product Removed the units removed, relative to the line's previous quantity. A change that nets to zero produces no event.
TypeScript Definition
typescript
CartLineChangeEvent: {{
/**
* @description discriminator enum property added by openapi-typescript
* @enum {string}
*/
event: "Product Added" | "Product Removed";
/** @description Server-issued event id (ULID). Send it with your client-side copy of this event so both copies dedupe. */
event_id: string;
/** @description The `Cart` the line belongs to. */
cart_id: string;
/** @description The product whose line changed. */
product_id: string;
/** @description The product variant, or `null` when the product has no variants. */
variant_id: string | null;
/** @description Units added (`Product Added`) or removed (`Product Removed`). */
quantity: number;
};
/**
* CartShipment
* @description Cart shipment model
*/
}OpenAPI Schema
json
{
"title": "CartLineChangeEvent",
"description": "Emitted when a cart line's quantity changes. `Product Added` carries the units added and `Product Removed` the units removed, relative to the line's previous quantity. A change that nets to zero produces no event.",
"type": "object",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/schemas/CartLineChangeEvent",
"description": "API reference for the CartLineChangeEvent schema"
},
"required": [
"event",
"event_id",
"cart_id",
"product_id",
"variant_id",
"quantity"
],
"properties": {
"event": {
"type": "string",
"enum": [
"Product Added",
"Product Removed"
]
},
"event_id": {
"description": "Server-issued event id (ULID). Send it with your client-side copy of this event so both copies dedupe.",
"type": "string",
"pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
},
"cart_id": {
"description": "The `Cart` the line belongs to.",
"type": "string"
},
"product_id": {
"description": "The product whose line changed.",
"type": "string"
},
"variant_id": {
"description": "The product variant, or `null` when the product has no variants.",
"type": [
"string",
"null"
]
},
"quantity": {
"description": "Units added (`Product Added`) or removed (`Product Removed`).",
"type": "integer",
"minimum": 1
}
}
}Auto-generated from OpenAPI spec and TypeScript definitions