---
schema_version: "1"
id: e895e714245cf48304091ad8522396cb1d209d3e2c20f00734fe37051bc088ff
title: ConnectApi.CartItemInput
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_input_cart_item.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_cart_item.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7ca948104f8a3c7c751ffeca8441c506b2f1744bb55603c5741600f854b93bb4
description: An item in a cart.
---
# ConnectApi.CartItemInput

An item in a cart.

<table class="featureTable sort_table" summary="">




          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader vertical-align-top " id="d582407e47">Property</th>

              <th class="featureTableHeader vertical-align-top " id="d582407e50">Type</th>

              <th class="featureTableHeader vertical-align-top " id="d582407e53">Description</th>

              <th class="featureTableHeader vertical-align-top " id="d582407e56">Required or Optional</th>

              <th class="featureTableHeader vertical-align-top " id="d582407e59">Available Version</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d582407e47 d582407e59" data-title="Property"><samp class="codeph apex_code">cartDeliveryGroupId</samp></td>

              <td class="entry" headers="d582407e50" data-title="Type">String</td>

              <td class="entry" headers="d582407e53" data-title="Description">ID of the cart delivery group.</td>

              <td class="entry" headers="d582407e56" data-title="Required or Optional">Optional</td>

              <td class="entry" headers="d582407e47 d582407e59" data-title="Property">59.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d582407e47 d582407e59" data-title="Property"><samp class="codeph apex_code">customFields</samp></td>

              <td class="entry" headers="d582407e50" data-title="Type">
                <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list" title="Contains methods for the List collection type.">List</a>&lt;<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_sobject.htm#apex_methods_system_sobject" title="Contains methods for the sObject data type."><samp class="codeph apex_code">SObject</samp></a>&gt;
              </td>

              <td class="entry" headers="d582407e53" data-title="Description">Array of sObjects and custom fields for the sObjects. Standard fields are ignored. The custom fields must already be defined for the sObject. Currently, only the CartItem sObject is supported. Field-level security rules from the <a class="xref" href="https://help.salesforce.com/s/articleView?id=commerce.comm_create_shopper_profile.htm&amp;type=5&amp;language=en_US" target="_blank">shopper profile</a> are applied to the custom fields. The rules are applied for registered shoppers and for the guest shopper profile. The custom fields can be of type Checkbox, Currency, Date, Email, LongTextArea, Number, Percent, Phone, Text, TextArea, Url, Address, or Location. The <samp class="codeph nolang">customFields</samp> property isn't supported in stores built on an Aura template. See <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/connectapi_examples_commerce_cart_custom.htm" target="_blank">Create a Cart
                  and Cart Item with Custom Fields in a Commerce Store</a>.</td>

              <td class="entry" headers="d582407e56" data-title="Required or Optional">Optional</td>

              <td class="entry" headers="d582407e47 d582407e59" data-title="Property">61.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d582407e47 d582407e59" data-title="Property"><samp class="codeph apex_code">productId</samp></td>

              <td class="entry" headers="d582407e50" data-title="Type">String</td>

              <td class="entry" headers="d582407e53" data-title="Description">ID of the product.</td>

              <td class="entry" headers="d582407e56" data-title="Required or Optional">Required when adding an item to a cart<p class="p">Not supported when updating a cart
                  item</p>
              </td>

              <td class="entry" headers="d582407e47 d582407e59" data-title="Property">49.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d582407e47 d582407e59" data-title="Property"><samp class="codeph apex_code">productSellingModelId</samp></td>

              <td class="entry" headers="d582407e50" data-title="Type">String</td>

              <td class="entry" headers="d582407e53" data-title="Description">The ID of the product selling model associated with Product2.</td>

              <td class="entry" headers="d582407e56" data-title="Required or Optional">Optional</td>

              <td class="entry" headers="d582407e47 d582407e59" data-title="Property">59.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d582407e47 d582407e59" data-title="Property"><samp class="codeph apex_code">quantity</samp></td>

              <td class="entry" headers="d582407e50" data-title="Type">String</td>

              <td class="entry" headers="d582407e53" data-title="Description">Quantity of the cart item.
                Use a value that can be converted to BigDecimal.</td>

              <td class="entry" headers="d582407e56" data-title="Required or Optional">Required</td>

              <td class="entry" headers="d582407e47 d582407e59" data-title="Property">49.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d582407e47 d582407e59" data-title="Property"><samp class="codeph apex_code">subscriptionTerm</samp></td>

              <td class="entry" headers="d582407e50" data-title="Type">Integer</td>

              <td class="entry" headers="d582407e53" data-title="Description">The total number of terms in the subscription period.</td>

              <td class="entry" headers="d582407e56" data-title="Required or Optional">Optional</td>

              <td class="entry" headers="d582407e47 d582407e59" data-title="Property">59.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d582407e47 d582407e59" data-title="Property"><samp class="codeph nolang">subType</samp></td>

              <td class="entry" headers="d582407e50" data-title="Type"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/connectAPI_enums.htm#cartItemSubTypeEnum"><samp class="codeph apex_code">ConnectApi.​CartItemSubType</samp></a></td>

              <td class="entry" headers="d582407e53" data-title="Description">Subtype of item in a cart.Possible values are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph apex_code">Bonus</samp>—A bonus product.
                  </li>
                  <li class="li">
                    <samp class="codeph apex_code">Gift</samp>—A gift product.
                  </li>
                </ul>
              </td>

              <td class="entry" headers="d582407e56" data-title="Required or Optional">Optional</td>

              <td class="entry" headers="d582407e47 d582407e59" data-title="Property">64.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d582407e47 d582407e59" data-title="Property"><samp class="codeph apex_code">type</samp></td>

              <td class="entry" headers="d582407e50" data-title="Type"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/connectAPI_enums.htm#cartItemTypeEnum"><samp class="codeph apex_code">ConnectApi.​CartItemType</samp></a></td>

              <td class="entry" headers="d582407e53" data-title="Description">Type of item in a cart.
                Value is <samp class="codeph nolang">Product</samp>.<ul class="ul bulletList">
                  <li class="li"><samp class="codeph apex_code">DeliveryCharge</samp></li>
                  <li class="li"><samp class="codeph apex_code">Product</samp></li>
                </ul>
              </td>

              <td class="entry" headers="d582407e56" data-title="Required or Optional">Required when adding an item to a cart<p class="p">Not supported when updating a cart
                  item</p>
              </td>

              <td class="entry" headers="d582407e47 d582407e59" data-title="Property">49.0</td>

            </tr>

          </tbody>

        </table>