ExchangeOrderEvent

An E-commerce event to manage details of exchanging an order. This class is part of the Salesforce Marketing Cloud Unified SDK and is used to track order exchange activities in your Android application.

  • Target: androidJvm
  • SDK Version: 11.0.0 (also available in 10.0.0)
  • SFMC SDK: v3.1.0

Based on the OrderEvent pattern, the constructor accepts:

  • order: Order - An Order object containing the details of the order being exchanged

Contains order information associated with the event.

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

Priority level for the event.

Event identifier.

The Event Producer Name. Producer contains list of allowed values.

Returns the name for the event. This value must match the Event Name used when creating the event in the Marketing Cloud UI for tracking functionality.

Returns: Event name as a String

The Event attributes for this event.

Returns: A map of attribute names to values

Method to track this Event via EventManager to subscriber EventSubscriber.

Converts the event to JSON format.

Returns: JSONObject representation of the event

  • id: String (required) - A unique identifier representing the order
  • lineItems: List<LineItem> (default: empty list) - A list of Line Item Data values
  • totalValue: Double? (default: null) - The total value of the order
  • currency: String? (default: null) - The currency of the total value for the order
  • attributes: Map<String, Any> (default: empty map) - A map of user-supplied values
  • catalogObjectType: String (required) - A type name representing the catalog object referenced in the line item
  • catalogObjectId: String (required) - A unique identifier representing the catalog object referenced in the line item
  • quantity: Int (required) - The number of catalog objects in this line item
  • price: Double? (optional) - The price of the catalog object referenced in the line item
  • currency: String? (optional) - The currency for the price field
  • attributes: Map<String, Any> (default: empty map) - A map of user-supplied values

List of possible Category values for sending Events:

  • APPLICATION
  • ENGAGEMENT
  • IDENTITY
  • SYSTEM
  • BILLING
  • CUSTOM

List of possible Producer values for sending Events:

  • CUSTOMER_APP - Represents events from the customer’s application
  • UNIFIED_SDK - Represents events from the unified SDK
  • MCE_MODULE - Represents events from the MCE module
  • DC_MODULE - Represents events from the DC module
  • MAM_MODULE - Represents events from the MAM module
  • PUSH_FEATURE_MODULE - Represents events from the push feature module
  • IAM_FEATURE_MODULE - Represents events from the in-app messaging feature module

Other OrderEvent subclasses for tracking different order lifecycle events:

  • PurchaseOrderEvent - An E-commerce event for when a user makes a purchase
  • PreorderEvent - An E-commerce event for when a user places a preorder
  • CancelOrderEvent - An E-commerce event for when a user cancels an order
  • ShipOrderEvent - An E-commerce event to manage details of an order shipment
  • DeliverOrderEvent - An E-commerce event to manage details of an order delivery
  • ReturnOrderEvent - An E-commerce event to manage details of returning an order
  • This is a concrete implementation of the sealed class OrderEvent
  • The @JvmOverloads annotation on Order and LineItem constructors provides Java interoperability with multiple constructor overloads
  • The event name must match the Event Name configured in the Marketing Cloud UI for proper tracking
  • Use the track() method to send the event to the Marketing Cloud SDK for processing