PreorderEvent

Overview 

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

Inheritance Hierarchy: EventEngagementEventOrderEventPreorderEvent

Platform: androidJvm

SDK Version: SFMC SDK v3.1.0

API Version: 11.0.0

Description 

An E-commerce event for when a user places a preorder. This class represents a specific type of order event within the Salesforce Marketing Cloud Unified SDK, designed to track when users place preorders in an e-commerce context.

Class Declaration 

1class PreorderEvent : OrderEvent

Properties 

Inherited from OrderEvent 

order 

1val order: Order

The order associated with this event.

Inherited from EngagementEvent 

category 

1open override var category: Event.Category

The event category name. Category contains a list of allowed values.

priority 

1open override val priority: Priority

The priority level for this event.

Methods 

Inherited from EngagementEvent 

attributes() 

1open override fun attributes(): Map<String, Any>

Returns the event attributes for this event as a map of string keys to any values.

Returns: Map<String, Any> - The event attributes

name() 

1open override fun name(): String

Returns the name for the event.

Returns: String - The event name

Note: This value must match the Event Name used when creating the event in the Marketing Cloud UI for any action to result from tracking this event.

Order Class Reference 

The order property contains an instance of the Order class with the following structure:

Order Constructor 

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)

Parameters:

  • id (String, required) - A unique identifier representing the order
  • lineItems (List, optional) - A list of Line Item Data values (defaults to empty list)
  • totalValue (Double?, optional) - The total value of the order (nullable, defaults to null)
  • currency (String?, optional) - The currency of the total value for the order (nullable, defaults to null)
  • attributes (Map<String, Any>, optional) - A map of user-supplied values (defaults to empty map)

Order Properties 

  • id: String - A unique identifier representing the order
  • lineItems: List<LineItem> - A list of Line Item Data values
  • totalValue: Double? - The total value of the order
  • currency: String? - The currency of the total value for the order
  • attributes: Map<String, Any> - A map of user-supplied values

Related Classes 

Other OrderEvent Subclasses 

  • PurchaseOrderEvent - For completed purchases
  • CancelOrderEvent - For canceled orders
  • ShipOrderEvent - For shipped orders
  • DeliverOrderEvent - For delivered orders
  • ReturnOrderEvent - For returned orders
  • ExchangeOrderEvent - For exchanged orders

Notes 

  • PreorderEvent is part of a sealed class hierarchy, where OrderEvent is a sealed class
  • All direct subclasses of OrderEvent must be defined in the same file or compilation unit
  • The event name returned by name() must match the Event Name configured in the Marketing Cloud UI for proper event tracking