Line Item Data

Line items are intended to describe purchasable items. They’re used in cart, catalog, and wish-list interactions.

Fields 

Field NameTypeDescription
attributesobjectA dictionary of values that you supply.
catalogObjectIdstringRequired. A unique identifier representing the catalog object referenced in the line item.
catalogObjectTypestringRequired. A name representing the catalog object referenced in the line item.
currencystringThe currency of the price field.
pricenumberThe price of the catalog object referenced in the line item.
quantitynumberRequired. The number of catalog objects in this line item.

Example 

Here’s a basic structure of a line item used within an interaction.

1{
2   lineItems: {
3      id: 'line-item-12345',
4      catalogObject: {
5         id: 'catalog-id-12345678',
6         type: 'Product'
7      },
8      attributes: {
9         quantity: 12,
10         price: 2.5,
11         imageUrl: 'https://commerce.salesforce.com/blueshirt.jpg',
12         name: 'blue-shirt'
13      },
14}