A data class representing line items for Cart and Order events in the Salesforce Marketing Cloud Unified SDK. Line items describe purchasable catalog objects with quantity, pricing, and additional attributes.
Class Declaration
1data class LineItem @JvmOverloads constructor(2 val catalogObjectType: String,3 val catalogObjectId: String,4 val quantity: Int,5 var price: Double? = null,6 var currency: String? = null,7 var attributes: Map<String, Any> = mapOf()8)
Constructor
Primary Constructor
Parameter
Type
Required
Default
Description
catalogObjectType
String
Yes
-
Type name for the catalog object
catalogObjectId
String
Yes
-
Unique identifier for the catalog object
quantity
Int
Yes
-
Number of items in this line item
price
Double?
No
null
Price of the catalog object
currency
String?
No
null
Currency code for the price
attributes
Map<String, Any>
No
mapOf()
User-supplied attribute values
Properties
catalogObjectType
1val catalogObjectType: String
A type name representing the referenced catalog object.
catalogObjectId
1val catalogObjectId: String
A unique identifier for the catalog object.
quantity
1val quantity: Int
The count of catalog objects in this line item.
price
1var price: Double?
The price of the referenced catalog object (mutable, nullable).
currency
1var currency: String?
The currency code for the price field (mutable, nullable).