Line Item Data

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

Fields

Field Name Type Description
attributes object A dictionary of values that you supply.
catalogObjectId string Required. A unique identifier representing the catalog object referenced in the line item.
catalogObjectType string Required. A name representing the catalog object referenced in the line item.
currency string The currency of the price field.
price number The price of the catalog object referenced in the line item.
quantity number Required. 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}