Shopping types

Learn about the shopping-related types available in CQL.

Shopping types refer to data types representing different aspects of the customer's online shopping experience, the stage of the purchase process, shopping cart details, and specific items in the shopping cart.

This summary provides an overview of the shopping-related types:

TypeDescription
CartAn e-commerce shopping cart.
Cart stageAn enumeration of stages in the shopping process.
Cart itemA single item in a shopping cart.

Cart

This type represents a customer's shopping cart in an e-commerce application. It contains several properties that provide information about the state of the cart, such as the total cost, the stage of the purchase process, and details about the products.

Properties

These are the available properties:

stageCartStage

The current stage of the shopping process. For example, "browsing" or "checkout."

itemslist<CartItem>

The list of items in the cart in the order they were added.

currency(optional)string

The currency in which the monetary values are expressed in the shopping cart.

shippingPrice(optional)number

The total shipping price for the items in the shopping cart, including any handling fees. If not specified, it indicates that the shipping price is not yet calculated.

coupon(optional)string

The coupon code applied to the purchase for a discount. For example, "SUMMER20".

discount(optional)number

The total discount applied to the purchase, as an absolute value. For example, 20.00 for a $20 discount.

costsmap<string,string>

The additional costs associated with the purchase as a map of key-value pairs. The key is the name of the cost, and the value is the amount of the cost.

taxesmap<string,number>

The tax amount added to the purchase as a map of key-value pairs. The key is the tax name, and the value is the tax amount.

subtotal(optional)number

The total cost of the items before any additional charges or discounts are applied. If not specified, it indicates that the subtotal is not yet calculated.

totalnumber

The total revenue or grand total associated with the transaction. It includes shipping, tax, and any other adjustment. If the cart is empty, the total is $0.

lastUpdateDateTime

The time when the cart was last updated. Updates refer to any interaction with the shopping cart, such as adding or removing items, changing quantities, or applying discounts.

If the cart is empty, the last update is always the current time.

Cart stage

This type is an enumeration of stages in the shopping process.

These are the possible values and what they represent:

StageDescription
browsingThe user is browsing the store, but the cart is still empty.
shoppingThe user has added items to the cart.
checkoutThe user has started the checkout process.

Cart item

This type represents a single item in a shopping cart. It includes product details such as price, quantity, total cost, and order-specific information like applied coupons and discounts.

Properties

These are the available properties:

indexinteger

The order in which the item was added to the cart, starting at 0.

idstring

The unique identifier of the product. For example, "1234" or "a9b2745f".

namestring

The name of the product. For example, "Running shoes" or "Smartphone".

sku(optional)string

The merchant's internal identifier for a product. For example, "CS-987-BLACK".

category(optional)string

The category of the product. For example, "Shoes" or "Electronics".

brand(optional)string

The brand of the product. For example, "Nike" or "Apple".

variant(optional)string

The variation of the product, such as color or size. For example, "Red" for a red shirt or "XL" for an extra-large shirt.

displayPrice(optional)number

The price of the product as displayed to the user. It usually refers to the price after any discounts are applied.

originalPrice(optional)number

The original price of a product, also known as list price or full price. It usually refers to the price before any discounts are applied.

url(optional)URI

The URL of the product page.

image(optional)URI

The URL of the product image.

quantityinteger

The number of units of this item in the cart, as a positive integer.

pricenumber

The price of a single unit of this item.

coupon(optional)string

The coupon code applied specifically to this item for a discount. For example, "SUMMER20".

discount(optional)number

Any discounts applied to this item, as an absolute value. For example, 10.00 for a $10 discount.

totalnumber

The total cost for this item, including any discounts and any other adjustment. It is usually the quantity multiplied by the price minus any discounts.