Update Items in Cart

Update one or more items in the specified cart with the revised set of items specified in the request body.

This API can update these information:

  • Item quantity

  • Attribute values for the items

  • Any other updatable field on the line item, such as Service Account ID or Billing Account ID

  • Update Line Items in Cart replaces the OmniCPQServiceWrapper updateItem method.
  • From Spring'25, the PutCartsItems API now validates the userValues when updating the following attributes to ensure they match the correct data type. If there is a mismatch, such as attempting to update a numeric attribute with a string value, an exception is raised. Note that this validation does not apply to picklist or multi-picklist attributes, since their userValues are not validated against the defined picklist values.
    • Currency
    • Percent
    • Number
    • Text
    • Date
    • DateTime
    • Checkbox
  • In the Classic API, you can disable the userValues validation by setting the DisableAttributeDataTypeValidation flag to true in the CPQ settings (found under Vlocity CMT Administration → CPQ Configuration Setup). This flag acts as an opt-out for Spring'25 and Summer'25 releases, allowing customers time to adjust to the change.

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.

PUT

ParameterDescription
namespacevlocity_cmt
cart_IDThe unique ID of the cart, which is the ID of the opportunity, quote, or order

For information about query parameters, request formats, response formats, see Industries Configure, Price, Quote Web APIs v2 Documentation.

To call putCartsItems, you must pass the JSONRecord for the attribute to update. The format of the request is:

In the request, itemJSON is the actual JSONRecord that is being updated. This JSONRecord is provided by the response to an Add Items to Cart or Get Cart Items API call. Based on that response, update the record or record attribute.

Example Request Body Format

In the request, itemJSON is the actual JSONRecord that is being updated. This JSONRecord is provided by the response to an Add Items to Cart or Get Cart Items API call. Based on that response, update the record or record attribute.

This API can update only one item in a hierarchical line item. The request payload must contain either a record of the item to be updated or a record of its parent and the item to be updated.

For example, your cart has three line items: Line Item 1, Line Item 2, and Line Item 3. Line Item 1 has two child line items: Child Line Item 1 and Child Line Item 2. In this scenario, the API updates all three line items but only one child item for Line Item 1.

See the hybrid user interface request payload for a better understanding.

These fields store validation messages related to product relationships and configuration rules. The CPQ engine updates these fields based on the configuration rules and product relationships defined for your CPQ journey.

  • CpqCardinalityMessage__c
  • CpqMessageData__c
  • CpqPricingMessage__c

See Also