Class PurchaseItem
-
- All Implemented Interfaces:
public final class PurchaseItemAn item being purchased.
-
-
Method Summary
Modifier and Type Method Description final IntegergetQuantity()Quantity of the item purchased. final IntegergetPrice()Price of one item, in cents (e.g. final StringgetID()Your unique identifier (for example, SKU) for the item. final StringgetTitle()Short user-readable name/title of the item purchased. final URIgetUrl()The URL of the item. final ArrayList<String>getTags()A list of tags applicable to the product. final UnitsetTags(ArrayList<String> tags)A list of tags applicable to the product. final JSONObjectgetVars()Vars can be any number of custom fields and values to attach to each item for later retrieval in templates or use in Audience Builder or Lifecycle Optimizer. final UnitsetVars(JSONObject vars)Vars can be any number of custom fields and values to attach to each item for later retrieval in templates or use in Audience Builder or Lifecycle Optimizer. final JSONObjectgetImages()Set a map of image types full and/or thumb to objects specifying the URL for each image. final UnitsetImages(JSONObject images)Set a map of image types full and/or thumb to objects specifying the URL for each image. final UnitaddTag(String tag)Add a tag to the purchase item. final UnitaddVar(String key, Object value)Add a custom key value pair to the purchase item. final UnitsetFullImageUrl(URI url)Sets the URL string to use for the full item image. final UnitsetThumbImageUrl(URI url)Sets the URL string to use for the thumb item image. Booleanequals(Object other)IntegerhashCode()StringtoString()final JSONObjecttoJSON()Converts PurchaseItem to JSON. -
-
Method Detail
-
getQuantity
final Integer getQuantity()
Quantity of the item purchased.
-
getUrl
final URI getUrl()
The URL of the item. Note: The domain and scheme are case sensitive but paths are not. For example, if the stored URL is https://sailthru.com/Product, then Https://Sailthru.com/product would fail to match the product, but https://sailthru.com/product would.
-
getVars
final JSONObject getVars()
Vars can be any number of custom fields and values to attach to each item for later retrieval in templates or use in Audience Builder or Lifecycle Optimizer. For example, you may want to specify item attributes such as color, size, material, or an item-specific coupon code that was used.
-
setVars
final Unit setVars(JSONObject vars)
Vars can be any number of custom fields and values to attach to each item for later retrieval in templates or use in Audience Builder or Lifecycle Optimizer. For example, you may want to specify item attributes such as color, size, material, or an item-specific coupon code that was used.
-
getImages
final JSONObject getImages()
Set a map of image types full and/or thumb to objects specifying the URL for each image. Use the name “full” to denote the full-sized image, and “thumb” to denote the thumbnail-sized image. For example, the value of images might be: { “full” : { “url” : “http://example.com/f.jpg” }, “thumb” : { “url” : “http://example.com/t.jpg” } } This allows you to easily include product images when messaging users with order confirmations and abandoned-cart reminders.
-
setImages
final Unit setImages(JSONObject images)
Set a map of image types full and/or thumb to objects specifying the URL for each image. Use the name “full” to denote the full-sized image, and “thumb” to denote the thumbnail-sized image. For example, the value of images might be: { “full” : { “url” : “http://example.com/f.jpg” }, “thumb” : { “url” : “http://example.com/t.jpg” } } This allows you to easily include product images when messaging users with order confirmations and abandoned-cart reminders.
-
addTag
final Unit addTag(String tag)
Add a tag to the purchase item.
- Parameters:
tag- the tag to add.
-
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
-
setFullImageUrl
final Unit setFullImageUrl(URI url)
Sets the URL string to use for the full item image.
- Parameters:
url- the URL containing the full image.
-
setThumbImageUrl
final Unit setThumbImageUrl(URI url)
Sets the URL string to use for the thumb item image.
- Parameters:
url- the URL containing the thumb image.
-
toJSON
final JSONObject toJSON()
Converts PurchaseItem to JSON.
- Returns:
JSON representation of a Purchase Item
-
-
-
-