Line Item

Line Item model schema that applies to the cart data and order data.

Attributes

Attribute

Type

Example

Description

name

*required

String

"Product 123 - With Variation 1"

Line item name as it appears in the shopping cart.

total

*required

Float

100.0

The row total for this line item. This should usually add up to quantity x price.

quantity

optional

Integer

3

The total quantity for this line item.

price

optional

Float

10.0

The price of the products in this line item.

total_usd

optional

Float

100.0

If a currency other than USD was used to place the purchase, then the USD total should be specified here.

variant_id

optional

String or Integer

"variation-1"

If a variation was selected for this line item, the ID of the variation should be specified here.

product_id

optional

String or Integer

"product-123"

The ID of the product for this line item.

Either this attribute or the product attribute are required.

product

optional

Product

See Product schema

The product data represented by this line item.

Either this attribute or the product attribute are required.

id

optional

String or Integer

"item-123"

A unique identifier for the line item for platforms that differentiate between line item rows.

Sample Payload

{
name: "Subscription to Product 123", // Required - String
id: "line-1", // Optional - String
quantity: 1, // Optional - Integer: Assumes 1 if not provided
total: 10.0, // Required - Float
total_usd: 10.0, // Optional - Float: If not USD main currency
variant_id: "variation1", // (Optional) String: If a variation was particularly selected, then specify it here
product_id: "123", // Optional - String: Either this field or the "product" field most be specified.
product: Product // See Product model schema
}