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 the following 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.

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.

See Also