Class PurchaseItem
-
- All Implemented Interfaces:
public final class PurchaseItem
An item being purchased.
-
-
Method Summary
Modifier and Type Method Description final Integer
getQuantity()
Quantity of the item purchased. final Integer
getPrice()
Price of one item, in cents (e.g. final String
getID()
Your unique identifier (for example, SKU) for the item. final String
getTitle()
Short user-readable name/title of the item purchased. final URI
getUrl()
The URL of the item. final ArrayList<String>
getTags()
A list of tags applicable to the product. final Unit
setTags(ArrayList<String> tags)
A list of tags applicable to the product. 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. 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. final JSONObject
getImages()
Set a map of image types full and/or thumb to objects specifying the URL for each image. final Unit
setImages(JSONObject images)
Set a map of image types full and/or thumb to objects specifying the URL for each image. final Unit
addTag(String tag)
Add a tag to the purchase item. final Unit
addVar(String key, Object value)
Add a custom key value pair to the purchase item. final Unit
setFullImageUrl(URI url)
Sets the URL string to use for the full item image. final Unit
setThumbImageUrl(URI url)
Sets the URL string to use for the thumb item image. Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final JSONObject
toJSON()
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
-
-
-
-