The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

Add to Cart

Add a product to the cart.

By default, items deleted from a cart are not evaluated for Vlocity Rules. To enable evaluation of deleted items, set the ShouldConsiderDeletedItems configuration setting to true. CME packages are large.

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.

The postCartsItems method supports the addition of one item at a time. If you must add multiple items, make multiple postCartsItems calls.

The following example illustrates how to call this API from Apex code.

Communication (vlocity_cmt)

For API parameter names and descriptions, see Cart-Based API Swagger Reference.

Response FormatJSON
Resource URL/v2/cpq/carts/*/items Example: /services/apexrest/{namespace}/v2/cpq/carts/801360000000oQ9/items