CartLifecycleEvent
Type: schema
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.
TypeScript Definition
typescript
CartLifecycleEvent: {{
/**
* @description discriminator enum property added by openapi-typescript
* @enum {string}
*/
event: "Cart Created" | "Cart Deleted" | "Checkout Started";
/** @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` this event is about. */
cart_id: string;
};
/**
* 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.
*/
}OpenAPI Schema
json
{
"title": "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.",
"type": "object",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/schemas/CartLifecycleEvent",
"description": "API reference for the CartLifecycleEvent schema"
},
"required": [
"event",
"event_id",
"cart_id"
],
"properties": {
"event": {
"type": "string",
"enum": [
"Cart Created",
"Cart Deleted",
"Checkout Started"
]
},
"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` this event is about.",
"type": "string"
}
}
}Auto-generated from OpenAPI spec and TypeScript definitions