Get Line Items by ID
Return the items and configurable attributes based on item IDs.
1 GET /v2/cpq/carts/{cart_ID}/items?id={item_ID},{item_ID}&validate={true|false}
Get Cart Items Trim Mode
Trim Mode is an optimization feature that reduces the payload size of the GetCartItems API response. Instead of returning the full set of cart item fields, Trim Mode restricts the response to only what is explicitly required.
When enabled, the API response includes these:
A fixed set of 22 default fields (identity, hierarchy, and status)
Fields specified via the fields query parameter
Fields defined in the GCITrimFieldsToInclude field set in Salesforce
All other fields are removed from the response. Structural nodes such as PricebookEntry, Product2, and productChildItemDefinition are always preserved.
Trim Mode applies only to:
getCartItemList
getCartItemListById
See, Enabling Trim Mode
Remote Method
REST Handler
Apex Remote Service
Apex Remote Input Map
1 {
2 methodName:getCartsItemsById,
3 cartId:801360000008eNU,
4 id:01t36000000pfcKAAQ,01t36000000pfcKAAQ
5 }
6 cartId = order.Id, opportunity.Id, quote.Id
Package
Communication (vlocity_cmt)
API Parameters and Response Format
For API parameter names and descriptions, see Cart-Based API Swagger Reference .
Resource Information
Response Format JSON Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items?id=802xx000001o0EFAAY,802xx000001o0FrAAI&validate=true
Example Request
1 GET
2 /services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000aSTqAAM/items?id=802xx000001o0EFAAY,802xx000001o0FrAAI&validate=true
Example Result
An entire result can be thousands of lines long. This example has been truncated.
If a child line item Id is passed in the input request, then the whole bundle is returned in the response.
1 {
2 "totalSize":2
3 "messages":[]
4 "actions":{
5 "itempricesupdated":{
6 "rest":{
7 "params":{}
8 "method":"GET"
9 "link":"/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/price?price=false&cartId=801xx000003H0UlAAK"
10 }
11 "remote":{}
12 "client":{}
13 }
14 }
15 "records":[
16 {
17 "messages":[]
18 "actions":{}
19 "displaySequence":-1
20 "productChildItemDefinition":{}
21 "isVirtualItem":false
22 "sequenceNumber":1
23 "groupMinQuantity":0
24 "productId":"01txx0000007CF2AAM"
25 "Product2":{}
26 "maxQuantity":99999
27 "ProductCode":"Internet5G"
28 "IsActive":true
29 "hasChildren":false
30 "defaultQuantity":1
31 "groupMaxQuantity":99999
32 "PricebookEntry":{}
33 "Name":"Internet5G"
34 "UnitPrice":{}
35 "Product2Id":"01txx0000007CF2AAM"
36 "productChildItemId":"a3Pxx0000004nmuEAA"
37 "minQuantity":0
38 "name":"Internet5G"
39 "Pricebook2Id":"01sxx0000005qRhAAI"
40 "action":"Add"
41 "productHierarchyPath":"01txx0000007CF2AAM"
42 "vlocity_cmt__RecurringPrice__c":50
43 "orderActive":false
44 "itemType":"lineItem"
45 "SellingPeriod":"Present"
46 "vlocity_cmt__ProductGroupKey__c":{}
47 "vlocity_cmt__RecurringDiscountPrice__c":{}
48 "vlocity_cmt__ParentItemId__c":{}
49 "vlocity_cmt__ItemName__c":{}
50 "vlocity_cmt__EffectiveOneTimeTotal__c":{}
51 "vlocity_cmt__EffectiveRecurringTotal__c":{}
52 "vlocity_cmt__CatalogItemReferenceDateTime__c":{}
53 "ListPrice":{}
54 "vlocity_cmt__CpqCardinalityMessage__c":{}
55 "vlocity_cmt__RecurringManualDiscount__c":{}
56 "vlocity_cmt__IsChangesAllowed__c":{}
57 "vlocity_cmt__CpqPricingMessage__c":{}
58 "vlocity_cmt__OneTimeTotal__c":{}
59 "vlocity_cmt__FulfilmentStatus__c":{}
60 "vlocity_cmt__LineNumber__c":{}
61 "vlocity_cmt__ServiceAccountId__c":{}
62 "vlocity_cmt__RecurringCharge__c":{}
63 "vlocity_cmt__OneTimeCharge__c":{}
64 "vlocity_cmt__SubAction__c":{}
65 "vlocity_cmt__CurrencyPaymentMode__c":{}
66 "vlocity_cmt__ProductHierarchyGroupKeyPath__c":{}
67 "vlocity_cmt__SupersededOrderItemId__c":{}
68 "vlocity_cmt__RecurringTotal__c":{}
69 "vlocity_cmt__SupplementalAction__c":{}
70 "vlocity_cmt__Product2Id__c":{}
71 "vlocity_cmt__OrderGroupId__c":{}
72 "vlocity_cmt__Action__c":{}
73 "Quantity":{}
74 "vlocity_cmt__OneTimeManualDiscount__c":{}
75 "OrderId":{}
76 "vlocity_cmt__EffectiveQuantity__c":{}
77 "vlocity_cmt__BillingAccountId__c":{}
78 "vlocity_cmt__ProvisioningStatus__c":{}
79 "vlocity_cmt__AssetReferenceId__c":{}
80 "vlocity_cmt__InCartQuantityMap__c":{}
81 "vlocity_cmt__FirstVersionOrderItemId__c":{}
82 "PricebookEntryId":{}
83 "vlocity_cmt__ProductHierarchyPath__c":{}
84 "vlocity_cmt__RootItemId__c":{}
85 "vlocity_cmt__CpqMessageData__c":{}
86 "Id":{}
87 "vlocity_cmt__RecurringCalculatedPrice__c":{}
88 "vlocity_cmt__OneTimeCalculatedPrice__c":{}
89 "productCategories":{}
90 "vlocity_cmt__ServiceAccountId__r":{}
91 "vlocity_cmt__BillingAccountId__r":{}
92 }
93 {
94 "messages":[]
95 "actions":{}
96 "displaySequence":-1
97 "productChildItemDefinition":{}
98 "isVirtualItem":false
99 "sequenceNumber":1
100 "groupMinQuantity":0
101 "productId":"01txx0000007CBoAAM"
102 "Product2":{}
103 "maxQuantity":99999
104 "ProductCode":"Iphone16"
105 "IsActive":true
106 "hasChildren":true
107 "defaultQuantity":1
108 "groupMaxQuantity":99999
109 "PricebookEntry":{}
110 "Name":"Iphone16"
111 "UnitPrice":{}
112 "Product2Id":"01txx0000007CBoAAM"
113 "productChildItemId":"a3Pxx0000004ni4EAA"
114 "minQuantity":0
115 "name":"Iphone16"
116 "Pricebook2Id":"01sxx0000005qRhAAI"
117 "action":"Add"
118 "productHierarchyPath":"01txx0000007CBoAAM"
119 "vlocity_cmt__RecurringPrice__c":50
120 "orderActive":false
121 "itemType":"lineItem"
122 "SellingPeriod":"Present"
123 "vlocity_cmt__ProductGroupKey__c":{}
124 "vlocity_cmt__RecurringDiscountPrice__c":{}
125 "vlocity_cmt__ParentItemId__c":{}
126 "vlocity_cmt__ItemName__c":{}
127 "vlocity_cmt__EffectiveOneTimeTotal__c":{}
128 "vlocity_cmt__EffectiveRecurringTotal__c":{}
129 "vlocity_cmt__CatalogItemReferenceDateTime__c":{}
130 "ListPrice":{}
131 "vlocity_cmt__CpqCardinalityMessage__c":{}
132 "vlocity_cmt__RecurringManualDiscount__c":{}
133 "vlocity_cmt__IsChangesAllowed__c":{}
134 "vlocity_cmt__CpqPricingMessage__c":{}
135 "vlocity_cmt__OneTimeTotal__c":{}
136 "vlocity_cmt__FulfilmentStatus__c":{}
137 "vlocity_cmt__LineNumber__c":{}
138 "vlocity_cmt__ServiceAccountId__c":{}
139 "vlocity_cmt__RecurringCharge__c":{}
140 "vlocity_cmt__OneTimeCharge__c":{}
141 "vlocity_cmt__SubAction__c":{}
142 "vlocity_cmt__CurrencyPaymentMode__c":{}
143 "vlocity_cmt__ProductHierarchyGroupKeyPath__c":{}
144 "vlocity_cmt__SupersededOrderItemId__c":{}
145 "vlocity_cmt__RecurringTotal__c":{}
146 "vlocity_cmt__SupplementalAction__c":{}
147 "vlocity_cmt__Product2Id__c":{}
148 "vlocity_cmt__OrderGroupId__c":{}
149 "vlocity_cmt__Action__c":{}
150 "Quantity":{}
151 "vlocity_cmt__OneTimeManualDiscount__c":{}
152 "OrderId":{}
153 "vlocity_cmt__EffectiveQuantity__c":{}
154 "vlocity_cmt__BillingAccountId__c":{}
155 "vlocity_cmt__ProvisioningStatus__c":{}
156 "vlocity_cmt__AssetReferenceId__c":{}
157 "vlocity_cmt__InCartQuantityMap__c":{}
158 "vlocity_cmt__FirstVersionOrderItemId__c":{}
159 "PricebookEntryId":{}
160 "vlocity_cmt__ProductHierarchyPath__c":{}
161 "vlocity_cmt__RootItemId__c":{}
162 "vlocity_cmt__CpqMessageData__c":{}
163 "Id":{}
164 "vlocity_cmt__RecurringCalculatedPrice__c":{}
165 "vlocity_cmt__OneTimeCalculatedPrice__c":{}
166 "productCategories":{}
167 "vlocity_cmt__ServiceAccountId__r":{}
168 "vlocity_cmt__BillingAccountId__r":{}
169 "lineItems":{}
170 }
171 ]
172 }
To validate or price a bundle, pass the rootItemId instead of the itemId.
Enabling Trim Mode
Option 1: Per-Request (Recommended for Controlled Adoption)
Enable Trim Mode for specific API calls using a query parameter:
/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true
/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt\_\_OneTimeCost\_\_c
Use this approach for:
Targeted integrations
Specific UI components
Testing and gradual rollout
Option 2: Org-Wide Configuration
Enable Trim Mode globally via CPQ configuration:
Set gciTrimMode = true in CPQ Configuration Setup. This applies to all GetCartItems API calls across the organization.
Configure field set:
Product2.Name
UnitPrice
TotalPrice
Description
All responses include default fields, field set fields, and additional fields via fields parameter (if provided).
Trim Mode removes fields from the API response. Any code, UI, or integration that depends on those fields will break unless the fields are explicitly requested.
Precedence Rules
API Parameter Config Setting Result TRUE any Trim ON FALSE any Trim OFF not provided TRUE Trim ON not provided false / unset Trim OFF
The API parameter always takes precedence. Use gciTrimMode = false to override org-wide settings per request.
Default Fields (Always Included)
These 22 fields are always present when trim mode is on, without needing to request them:
Id, RootItemId, ParentItemId, AssetReferenceId, LineNumber, Product2Id, PricebookEntryId, OrderId, QuoteId, OpportunityId, Quantity, Status, Action, IsRootItem,
ProductHierarchyPath, ProductHierarchyGroupKeyPath, BillingAccountId, ServiceAccountId, InCartQuantityMap, CpqMessageData, CpqCardinalityMessage, CpqPricingMessage
Usage Examples
Minimal Cart (Mobile Optimization)
/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=Product2.Name,TotalPrice
Returns a lightweight payload (~24 fields vs 150+).
Cost Analysis Dashboard
/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt__OneTimeCost__c,vlocity_cmt__RecurringCost__c,vlocity_cmt__OneTimeMargin__c
Override Org-Wide Trim Mode
/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=false
Returns full response regardless of org settings.