PurchaseItem

class PurchaseItem(quantity: Int, title: String, price: Int, ID: String, url: URI)

An item being purchased.

Constructors

Link copied to clipboard
constructor(quantity: Int, title: String, price: Int, ID: String, url: URI)

Properties

Link copied to clipboard
var ID: String

Your unique identifier (for example, SKU) for the item.

Link copied to clipboard

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.

Link copied to clipboard
var price: Int

Price of one item, in cents (e.g. $10.99 is 1099).

Link copied to clipboard

Quantity of the item purchased.

Link copied to clipboard

A list of tags applicable to the product.

Link copied to clipboard

Short user-readable name/title of the item purchased.

Link copied to clipboard
var url: URI

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.

Link copied to clipboard

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.

Functions

Link copied to clipboard
fun addTag(tag: String)

Add a tag to the purchase item.

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

Sets the URL string to use for the full item image.

Link copied to clipboard

Sets the URL string to use for the thumb item image.

Link copied to clipboard

Converts PurchaseItem to JSON.

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