Purchase

class Purchase(purchaseItems: ArrayList<*>)

A purchase to log to the platform.

Constructors

Link copied to clipboard
constructor(purchaseItems: ArrayList<*>)

Properties

Link copied to clipboard

Whether the purchase is incomplete.

Link copied to clipboard

Set the message ID associated with the purchase. This is required to have revenue data matched to email sends in Marigold. Pass the identifying message_id of the email the user is coming from; this will be the value stored in the marigold_bid cookie for your domain.Note: In some client libraries message_id should be passed as a string. The message attribution will be displayed in your Campaign Summary, Transactional Report, Purchase Log, and in Lifecycle Optimizer Metrics.

Link copied to clipboard

Array of PurchaseAdjustments being applied to the purchase.

Link copied to clipboard

Array of PurchaseItems being purchased.

Link copied to clipboard

Any number of custom variables to attach to the order. These are commonly used with the Audience Builder “Purchase Order Var Is” query. For example, you could specify the shipping address, estimated delivery date given, credit card type used, whether a deal was used, the promo code used, etc. Note that a vars object may also exist at the item level. See the example code, and the items definition in this table.You may use any custom order variable name(s). Note that the following variable name is reserved at the order level, for a particular purpose: st_cost – The client’s cost for the items in the purchase, in cents. The value should be an integer, and is recommended if you are using Retention Analytics in order to report net revenue.

Functions

Link copied to clipboard
fun addVar(key: String, value: Any?)

Add a custom key value pair to the purchase item.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Converts Purchase to JSON.

Link copied to clipboard
open override fun toString(): String