Newer Version Available

This content describes an older version of this product. View Latest

CartItem

Represents an item in a WebCart that’s active in a store built with B2B or D2C Commerce. Cart item can be of type Product or Charge. This object is available in API version 49.0 and later.

Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete(), update(), upsert()

Special Access Rules

The CartItem object is available only if the B2B Commerce or D2C Commerce license is enabled.

Fields

Field Details
AdjustmentAmount
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Non-itemized adjustments for this cart item.
AdjustmentTax​Amount
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
The tax that’s calculated on the AdjustmentAmount.
AssociatedItem​Pricing
Type
picklist
Properties
Create, Filter, Nillable, Sort, Update
Description
Specifies how a child cart item is priced relative to its parent cart item within a product bundle. This field is null for standalone products that aren't part of a bundle. Available in API version 65.0 and later.

Possible values are:

  • IncludedInBundlePrice—Indicates that the parent product’s price includes the aggregated prices of its child components.
  • NotIncludedInBundlePrice—Indicates that the parent product’s price doesn’t include the aggregated prices of its child components.
CartDelivery​GroupId
Type
reference
Properties
Create, Filter, Group, Sort, Update
Description
The ID of the CartDeliveryGroup that’s associated with a cart item.
This field is a relationship field.
Relationship Name
CartDeliveryGroup
Relationship Type
Lookup
Refers To
CartDeliveryGroup
CartId
Type
reference
Properties
Create, Filter, Group, Sort
Description
The ID of the WebCart that’s associated with a cart item.
This field is a relationship field.
Relationship Name
Cart
Relationship Type
Lookup
Refers To
WebCart
ChildProduct​Count
Type
int
Properties
Create, Defaulted on create, Filter, Group, Nillable, Sort, Update
Description
The total number of child products associated with this cart item. If a child product is a bundle, its own ChildProductCount is included in this total. For simple products that don’t have any child products, the ChildProductCount value is zero.
Configure​DuringSale
Type
picklist
Properties
Create, Filter, Nillable, Sort, Update
Description
Specify whether a product bundle is configurable. Available in API version 65.0 and later.

Possible values are:

  • Allowed
  • NotAllowed
CurrencyIsoCode
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
The ISO code for the currency that’s specified on the buyer’s account. Default value is USD. Possible values are:
  • EUR—Euro
  • USD—U.S. Dollar
DistributedAdjustment​Amount
Type
currency
Properties
Defaulted on create, Filter, Nillable, Sort
Description
A calculated field that determines the amount of a cart-wide promotional adjustment when distributed across all items in the cart. This field is for display purposes only and is valid only during checkout. This field is available in API version 52.0 and later.
You receive $10 off, and there are 5 items in the cart. The distributed adjustment is (-$2).
DistributedAdjustment​TaxAmount
Type
currency
Properties
Defaulted on create, Filter, Nillable, Sort
Description
A calculated field that determines the amount of a cart-wide tax adjustment due to promotions when distributed across all items in the cart. This field is available in API version 52.0 and later.
EXAMPLE: Your discount causes a cart-wide tax reduction of (-$10), and there are 5 items in the cart. The distributed tax adjustment is (-$2).
GrossAdjustment​Amount
Type
currency
Properties
Filter, Nillable, Sort
Description
The gross amount of the price adjustment on the cart item (tax inclusive). This is available in API version 55.0 and later.
GrossUnitPrice
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
The gross amount of the unit price for a cart item (tax inclusive). This is available in API version 55.0 and later.
IsShippingChargeNot​Applicable
Type
boolean
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
Indicates whether shipping charges are applicable (true) or not (false) to the cart item. The default value is false.
This field is available in API version 64.0 and later.
ItemizedAdjustment​Amount
Type
currency
Properties
Defaulted on create, Filter, Nillable, Sort
Description
A calculated field that determines the total amount of promotional adjustments that are specific to an item. This field is available in API version 52.0 and later.
EXAMPLE: One cart item has one discount code for $10 off. Your itemized adjustment amount is (-$10) for that item.
ItemizedAdjustment​TaxAmount
Type
currency
Properties
Defaulted on create, Filter, Nillable, Sort
Description
A calculated field that determines the total amount of promotion-related tax adjustments that are specific to an item. This field is available in API version 52.0 and later.
EXAMPLE: One cart item has one discount code for $10 off. This reduces the tax on that item by (-$2). Your itemized adjustment tax amount is (-$2) for that item.
ListPrice
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
The original price of the cart item. Typically shown with a line through it. List price is shown only when it’s higher than the negotiated price. If the list price is the same or lower, it isn’t shown to the buyer. This field is available in API version 52.0 and later.
Name
Type
string
Properties
Create, Filter, Group, idLookup, Sort, Update
Description
The name of this CartItem record. Name can be up to 255 characters.
NetAdjustment​Amount
Type
currency
Properties
Filter, Nillable, Sort
Description
The net amount of the price adjustment made on the cart item (tax exclusive). This is available in API version 55.0 and later.
NetUnitPrice
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
The net amount of the unit price for the cart item (tax exclusive). This is available in API version 55.0 and later.
ParentCart​ItemId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of the cart item's parent CartItem. The value is empty if the item is a top-level cart item.
This field is a relationship field.
Relationship Name
CartItem
Relationship Type
Lookup
Refers To
CartItem
PerUnitWeight
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
Weight per unit of this cart item, in the unit specified by WeightUnit. This field is available in API version 62.0 and later.
Product2Id
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of a product type cart item. Cart items can be of type PRODUCT or CHARGE.
This field is a relationship field.
Relationship Name
Product2
Relationship Type
Lookup
Refers To
Product2
ProductClass
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
The product class of the cart item. Default value is Simple. Possible values are:
  • Bundle
  • Set
  • Simple
  • Variation
  • VariationParent
ProductRelated​ComponentId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of the cart item's ProductRelatedComponent. The ProductRelatedComponent represents a product that is included in a product bundle, a set, or a product and an add-on. The ProductRelatedComponent is empty if the item is a top-level cart item.
This field is a relationship field.
Relationship Name
ProductRelatedComponent
Relationship Type
Lookup
Refers To
ProductRelatedComponent
ProductValidation​Key
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The product validation key of the cart item.
ProductRelationship​TypeId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of the product relationship type that defines the relationship between a product bundle and its child product. Available in API version 65.0 and later.
This field is a relationship field.
Relationship Name
ProductRelationshipType
Relationship Type
Lookup
Refers To
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_productrelationshiptype.htmProductRelationshipType
Quantity
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
The number of a given cart item in a cart.
QtyScaleMethod
Type
picklist
Properties
Create, Filter, Nillable, Sort, Update
Description
Determines how a child product's quantity scales when added to a cart or configured within a product bundle. Available in API version 65.0 and later. Possible values are:
  • Constant—Represents a value that remains fixed relative to the parent bundle.
  • Proportional—Represents a value that varies in proportion to the parent bundle’s price or quantity.
SalesPrice
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
The discounted price of a cart item.
Sku
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The Shelf-Keeping Unit ID of a cart item.
StockCheck​Method
Type
picklist
Properties
Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
Determines how inventory is assessed for a cart item that’s part of a bundle or set. Possible values are:
  • ChildProducts—Inventory is assessed based on the child product or products.
  • ParentProduct—Inventory is assessed based on the parent product.
SubType
Type
picklist
Properties
Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
Specifies the subtype of the product. Possible values are:
  • Bonus—Bonus product.
  • GiftWrap—Gift wrapped product.
This field is available in API version 64.0 and later.
TaxTreatment​Id
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The ID of the related tax treatment for the cart item.

This field is available in API version 63.0 and later. This field is available with Subscription Management.

This field is a relationship field.
Relationship Name
TaxTreatment
Relationship Type
Lookup
Refers To
TaxTreatment
TotalAdjustment​Amount
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
The total amount of all promotional adjustments on the item, both distributed and itemized. This field is available in API version 52.0 and later.
TotalAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
The total cost of this cart item, including taxes and adjustments.
TotalLine​Amount
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Total amount for this cart item, based on sales price and quantity.
TotalLineGross​Amount
Type
currency
Properties
Filter, Nillable, Sort
Description
The total gross amount of the line item (tax inclusive). This is available in API version 55.0 and later.
TotalLineNet​Amount
Type
currency
Properties
Filter, Nillable, Sort
Description
The total net amount of the line item (tax exclusive). This is available in API version 55.0 and later.
TotalLineTax​Amount
Type
currency
Properties
Defaulted on create, Filter, Nillable, Sort
Description
Total tax amount for TotalLineAmount.
TotalListPrice
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Total amount for this cart item, based on ListPrice. We provide this value for comparison. It's not the price that the buyer is paying.
TotalPrice
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Total amount for this cart item, including adjustments but excluding taxes.

Although this field is Nillable, if you want to use Commerce Webstore Cart Promotions, this field is required.

Note

TotalPriceAfterAll​Adjustments
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Total price after all price adjustments are applied. This field is available in API version 52.0 and later.

Although this field is Nillable, if you want to use Commerce Webstore Cart Promotions, this field is required.

Note

TotalPrice​TaxAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Total tax amount for a cart item before promotional adjustments, including quantity-based adjustments. This field is available in API version 56.0 and later.
TotalPromo​AdjustmentAmount
Type
currency
Properties
Create, Defaulted on create, Filter, Nillable, Sort, Update
Description
Total itemized and distributed adjustment amount in cart (only for promotions). This field is available in API version 52.0 and later.
TotalPromoAdjustment​TaxAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Total itemized and distributed adjustment tax amount in cart (only for promotions). This field is available in API version 52.0 and later.
TotalTaxAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Total tax amount for this cart item. This value includes taxes for both TotalLineAmount and AdjustmentAmount.
TotalWeight
Type
double
Properties
Filter, Nillable, Sort
Description
Total weight of this cart item, in the unit specified by WeightUnit. This field is available in API version 62.0 and later.
Type
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
The CartItem type. Possible values are:
  • Product
  • Charge
UnitAdjusted​Price
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Price per quantity unit after a tier discount or surcharge is applied. This field is available in API version 50.0 and later.
UnitAdjustedPrice​WithItemAdj
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Unit price, including both tier and item level discounts, for the item.
UnitAdjustment​Amount
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Tier discount or surcharge to apply to a quantity unit. This amount is added to the SalesPrice to get the UnitAdjustedPrice. This field is available in API version 50.0 and later.
UnitItemAdjustment​Amount
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Item level adjustments made to the unit price for the item.
WeightUnit
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Unit of measurement for the weight of the cart item. This field is available in API version 62.0 and later.
Possible values are:
  • Grams
  • Kilograms
  • Ounces
  • Pounds

Associated Objects

This object has the following associated objects. Unless it’s noted, associated objects are available in the same API version as this object.
CartItemChangeEvent (API version 58.0)
Change events are available for the object.