Line Item Attribute

Line items describe purchasable items and are used in cart and order-related interactions.

Field NameField TypeDescription
attributesobjectA dictionary of user-supplied key-value pairs that to add more detail, such as {"color": "blue"}
catalogObjectTypestringRequired. A type name representing the catalog object referenced in the line item. For example, Product, and SKU.
catalogObjectIdstringRequired. A unique ID representing the catalog object referenced in the line item.
currencystringThe currency for the price field. For example, USD, and GBP.
pricenumberThe price of the catalog object referenced in the line item.
quantitynumberRequired. The number of catalog objects in this line item.

Line Item Attribute Example for iOS 

Here’s an example of a LineItem for iOS.

1LineItem(
2    catalogObjectType: "Product",
3    catalogObjectId: "product-11",
4    quantity: 1,
5    price: 20.0,
6    currency: "USD",
7    attributes: [
8      "gift_wrap: true
9    ]
10)

Line Item Attribute Example for Android 

Here’s an example of a LineItem for Android.

1LineItem(
2    catalogObjectId = "product-1",
3    catalogObjectType = "Product",
4    quantity = 1,
5    price = 20.0,
6    currency = "USD",
7    attributes = mapOf(
8      "gift_wrap" to true
9    )
10    )