Skip to main content

Cart Item

Overview

Object representing a cart entry. Note that the cart item may represent multiple bought items. CartItem.quantity provides the number of bought items.

Properties

cartItemId

cartItemId: string

Globally unique identifier (GUID) of a cart item. This ID is unique between fresh impressions of a catalog item. As such it can change on subsequent visits to the upsell page where Rokt SDK presents items to a customer. As usual in the case of a change to cart item Rokt triggers Cart.onUpdateItem, however in this particular case an updated item and an old item may have a different CartItem.cartItemId. Be mindful of this behavior if you use CartItem.cartItemId value to correlate items in your cart to the ones provided in the Cart.onUpdateItem callback.


catalogItemId

catalogItemId: string

Unique identifier of a catalog item. The same catalog item is presented to different customers and unlike CartItem.cartItemId, its value does not change between fresh impression of a catalog item. This can also be thought of as a product SKU.


currency

currency: string

ISO 4217 compliant currency code.


description

description: string

Description of an item.


linkedProductId (optional)

linkedProductId: string | undefined

ID (SKU) of a product from partner's inventory linked to Rokt's cart item. If present, it signifies that the cart item is attached to the product on the partner's side and the Rokt item cannot be sold separately from the partner's product.

One example would be a customer using Rokt's services to purchase a warranty for an item sold on a partner's page. In this case CartItem.linkedProductId would represent ID of partner's item. If at any point in the transaction flow the customer chooses to remove the partner's item from their cart, the Rokt cart item should also be removed. The warranty cannot be purchased without the item it covers.


name

name: string

Name of an item.


quantityMustBeSynchronized (optional)

quantityMustBeSynchronized: boolean | undefined

The presence of the flag signifies the cart item CartItem.quantity is synchronized with the quantity of the partner's product represented by CartItem.linkedProductId.

One example would be a customer buying a warranty from Rokt for a product sold on partner's page. In case of multiple items of the same product being purchased, warranty would be represented by a single Rokt cart item with a quantity matching the number of products added to the cart by the customer at the time of selection. If at any point in the transaction flow the customer chooses to remove the partner's item from their cart, the Rokt cart item should also be removed. The warranty cannot be purchased without the item it covers.


providerData

providerData: string

A JSON string containing arbitrary information specified by the product or service provider.


quantity

quantity: number

Quantity of requested items.


totalPrice

totalPrice: number

Total price is equal to unit price times quantity.

If CartItem.quantityMustBeSynchronized is set to true, the value may not represent the final total price if the customer makes changes to the linked product quantity.


unitPrice

unitPrice: number

Price per item.

Was this article helpful?