Shopping types

Discover 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:

stage

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

items

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

currency(optional)

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

shippingPrice(optional)

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)

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

discount(optional)

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

costs

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.

taxes

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)

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.

total

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.

lastUpdate

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:

index

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

id

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

name

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

sku(optional)

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

category(optional)

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

brand(optional)

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

variant(optional)

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)

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

originalPrice(optional)

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)

The URL of the product page.

image(optional)

The URL of the product image.

quantity

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

price

The price of a single unit of this item.

coupon(optional)

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

discount(optional)

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

total

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.