Class Purchase
-
- All Implemented Interfaces:
public final class PurchaseA purchase to log to the platform.
-
-
Field Summary
Fields Modifier and Type Field Description private final ArrayList<PurchaseItem>purchaseItemsprivate final ArrayList<PurchaseAdjustment>purchaseAdjustmentsprivate JSONObjectvarsprivate StringmessageId
-
Method Summary
Modifier and Type Method Description final ArrayList<PurchaseItem>getPurchaseItems()Array of PurchaseItems being purchased. final ArrayList<PurchaseAdjustment>getPurchaseAdjustments()Array of PurchaseAdjustments being applied to the purchase. final JSONObjectgetVars()Any number of custom variables to attach to the order. final UnitsetVars(JSONObject value)Any number of custom variables to attach to the order. final StringgetMessageId()Set the message ID associated with the purchase. final UnitsetMessageId(String value)Set the message ID associated with the purchase. final UnitaddVar(String key, Object value)Add a custom key value pair to the purchase item. Booleanequals(Object other)IntegerhashCode()StringtoString()final JSONObjecttoJSON()Converts Purchase to JSON. -
-
Constructor Detail
-
Purchase
Purchase(ArrayList<?> purchaseItems)
-
-
Method Detail
-
getPurchaseItems
final ArrayList<PurchaseItem> getPurchaseItems()
Array of PurchaseItems being purchased.
-
getPurchaseAdjustments
final ArrayList<PurchaseAdjustment> getPurchaseAdjustments()
Array of PurchaseAdjustments being applied to the purchase.
-
getVars
final JSONObject getVars()
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.
-
setVars
final Unit setVars(JSONObject value)
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.
-
getMessageId
final String getMessageId()
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.
-
setMessageId
final Unit setMessageId(String value)
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.
-
addVar
final Unit addVar(String key, Object value)
Add a custom key value pair to the purchase item.
- Parameters:
key- the custom value keyvalue- the custom value
-
toJSON
final JSONObject toJSON()
Converts Purchase to JSON.
- Returns:
JSON representation of a Purchase
-
-
-
-