PurchaseOrderEvent

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

SDK Version: SFMC SDK v3.1.0 (Salesforce Marketing Cloud Unified SDK 11.0.0)

Platform: androidJvm

Description 

An E-commerce event for when a user makes a purchase.

Declaration 

1class PurchaseOrderEvent : OrderEvent

Inheritance Hierarchy 

1Event (interface)
2  └── EngagementEvent (sealed class)
3        └── OrderEvent (sealed class)
4              └── PurchaseOrderEvent (class)

Inherited Properties 

From OrderEvent 

order 

1val order: Order

Contains the order information associated with this event.

From EngagementEvent 

category 

1open override var category: Event.Category

The Event category Name. Category contains list of allowed values.

priority 

1open override val priority: Priority

Defines the priority level for the engagement event.

Inherited Methods 

From EngagementEvent 

attributes() 

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

The Event attributes for this event.

Returns: A map containing string keys and any-type values representing event attributes.

name() 

1open override fun name(): String

The name for the event. 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.

Returns: The event name as a string.

Related Classes 

Order 

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

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)

Order Properties:

PropertyTypeDefaultDescription
idStringrequiredA unique identifier for the order
lineItemsList<LineItem>listOf()A list of line item data values
totalValueDouble?nullThe total monetary value of the order
currencyString?nullThe currency code for the order’s total value
attributesMap<String, Any>mapOf()User-supplied custom attribute map

Related Events 

Other OrderEvent subclasses in the same package:

  • PreorderEvent - Represents a preorder event
  • CancelOrderEvent - Represents an order cancellation event
  • ShipOrderEvent - Represents an order shipment event
  • DeliverOrderEvent - Represents an order delivery event
  • ReturnOrderEvent - Represents an order return event
  • ExchangeOrderEvent - Represents an order exchange event

Usage Notes 

  • PurchaseOrderEvent is part of the sealed OrderEvent class hierarchy, providing type-safe handling of order-related events
  • This event should be tracked when a user completes a purchase transaction
  • The event name must match the Event Name configured in the Marketing Cloud UI for proper tracking and triggering of actions
  • Uses the Order data class to encapsulate order details including line items, total value, and currency