Add Items to Cart
Add items to the cart along with any required child products that are specified in the request body. Compatibility and pricing rules are run against the cart.
You must use the fieldsToUpdate parameter to update any default line item value.
Add line items to cart replaces the OmniCPQServiceWrapper
This API supports the guest user enhancements that Salesforce introduced with the Winter ‘21 release. To encrypt and decrypt data for guest users, use the
UserSecurity class with this API. See Guest User Technical Details.
For additional information, see UserSecurity Class and CPQ and Digital Commerce Changes for Guest Users.
When you add child items to the cart:
parentRecordnode in the input request.
parentRecordnode, specify the
If the immediate parent of the child item that you're adding is a virtual parent, then also include these fields:
Idfield in the
parentRecordnode. Ensure that it's the
PricebookEntryIdof the immediate virtual parent.
parentIdfield in the
itemsnode. Ensure that it's the
lineItemIdof the immediate real parent.
In releases prior to CME Spring '20, the postCartsItems method supports the addition of one item at a time. If you must add multiple items, make multiple postCartsItems calls.
With CME Spring '20 and later releases, the itemId parameter supports multiple comma-separated values when adding root and child items via postCartsItems method calls if UOWMode is set to true.
For API parameter names and descriptions, see Cart-Based API Swagger Reference.
For more information about
levelBasedApproach, see Configuring Cart Item Refresh Levels.
To use this API to pass child line items, you must also specify the Price Book Entry ID.
An entire result can be thousands of lines long. This example has been truncated.