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 <Error class: unknown class><PurchaseItem>purchaseItemsprivate final <Error class: unknown class><PurchaseAdjustment>purchaseAdjustmentsprivate JSONObjectvarsprivate final Booleanincompleteprivate StringmessageId
-
Constructor Summary
Constructors Constructor Description Purchase(<Error class: unknown class><out <Error class: unknown class>> purchaseItems)
-
Method Summary
Modifier and Type Method Description final <Error class: unknown class><PurchaseItem>getPurchaseItems()Array of PurchaseItems being purchased. final <Error class: unknown class><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 vars)Any number of custom variables to attach to the order. final BooleangetIncomplete()Whether the purchase is incomplete. final StringgetMessageId()Set the message ID associated with the purchase. final UnitsetMessageId(String messageId)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. -
-
Method Detail
-
getPurchaseItems
final <Error class: unknown class><PurchaseItem> getPurchaseItems()
Array of PurchaseItems being purchased.
-
getPurchaseAdjustments
final <Error class: unknown class><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 vars)
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.
-
getIncomplete
final Boolean getIncomplete()
Whether the purchase is incomplete.
-
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 messageId)
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
-
-
-
-