Order

Package: com.salesforce.marketingcloud.sfmcsdk.components.events

Platform: androidJvm

SDK Version: 11.0.0

Overview 

A data class representing an order in the Salesforce Marketing Cloud SDK. This class encapsulates order information including line items, total value, currency, and custom attributes.

Class Declaration 

1data class Order @JvmOverloads constructor(
2    val id: String,
3    val lineItems: List<LineItem> = listOf(),
4    val totalValue: Double? = null,
5    val currency: String? = null,
6    val attributes: Map<String, Any> = mapOf()
7)

Constructor 

Order 

1@JvmOverloads
2constructor(
3    id: String,
4    lineItems: List<LineItem> = listOf(),
5    totalValue: Double? = null,
6    currency: String? = null,
7    attributes: Map<String, Any> = mapOf()
8)

Creates an Order instance with the specified parameters. All parameters except id have default values.

Properties 

id 

1val id: String

A unique identifier representing the order. This is a required field.

lineItems 

1val lineItems: List<LineItem>

An list of Line Item Data values. Defaults to an empty list if not provided.

totalValue 

1val totalValue: Double?

The total value of the order. This is an optional nullable property.

currency 

1val currency: String?

The currency of the total value for the order. This is an optional nullable property.

attributes 

1val attributes: Map<String, Any>

A map of user-supplied values. Defaults to an empty map if not provided. This allows for custom key-value pairs to be associated with the order.

Related Classes 

  • LineItem - Represents individual items within the order