GetCartItems Trim Mode: Root-Level Fields Configuration

A dedicated field set restores 14 root level fields on each line item in the GetCartItems API response. This implementation gives API integrations the performance benefits of Trim mode without losing the standard field shape.

Required Editions

Available in: Classic and Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions for CME Managed Package

When the GetCartItems API runs in Trim mode (gcitrimmode=true), critical line-item fields such as product name, product code, product ID, recurring price, quantity, min or max cardinality, virtual-item flag, and sequence number are nested inside their Product2, PricebookEntry, and ProductChildItem sObject nodes instead of appearing at the root of each line item. This breaks API integrations that rely on these fields at the root level.

The GCITrimIncludeFieldSet field set resolves by promoting 14 fields back to flat top-level keys, reducing payload size without changing where your app expects to find these fields. This implementation is an API-specific feature and isn’t specific to the Industries CPQ UI.

Field Set Configuration

Create the GCITrimIncludeFieldSet field set on the QuoteLineItem and OrderItem objects returned by GetCartItems.

Add this product and pricebook entry fields to GCITrimIncludeFieldSet:

  • IsActive
  • Name
  • Pricebook2Id
  • ProductCode
  • productId
  • RecurringPrice__c

Product Child Item (PCI) Fields

The pciFields parameter controls these eight PCI fields at the record root. They appear at the root level only when gcitrimmode is true.

  • defaultQuantity
  • minQuantity
  • maxQuantity
  • groupMinQuantity
  • groupMaxQuantity
  • isVirtualItem
  • productChildItemId
  • sequenceNumber
Note
Note Use the pciFields request parameter to opt out of product-child-item fields when your app doesn’t need them.

URL Parameters

Here are the URL parameters that control trim mode behavior on the GetCartItems API call.

parameter value behavior
gcitrimmode true Trim mode on; field set applies.
gcitrimmode false or not present Legacy standard API response; no field set setup required.
pciFields true or not present Returns all 8 PCI fields at root (default).
pciFields false PCI fields excluded from root.

Use Case

A digital commerce integration calls the GetCartItems API with gcitrimmode=true for a fast, lightweight cart payload. Product name, ID, price, quantity, and cardinality land at the root of each Quote and Order line item in the JSON response, eliminating nested lookups.

Clients can configure the following options:

  • Set pciFields to false to skip child-item fields when not needed.
  • Extend GCITrimIncludeFieldSet to include custom fields specific to their integration.

Results

  • API integrations restored: Root-level fields are available without giving up trim mode performance.
  • Fine-grained control: Enable PCI fields via URL parameter and extend the field set for custom fields as needed.