Get List of Products

The getCartsProducts API provides a flexible and efficient way to retrieve a tailored list of products for a specific cart, based on the cart's Price List and business context. It supports advanced filtering, pagination, localization, and the inclusion of product attachments.

Key Parameters:

  • Pagination Controls: pagesize and offsetSize work together to navigate large catalogs efficiently, while lastRecordId enables cursor-based pagination for better performance.
  • Filtering Options: query, attributes, filters, and category allow for precise product selection based on text search, attribute values, field values, and product categories.
  • Response Customization: includeIneligible, includeAttachments, includeAttributes, and fields let you control what data is included in the response.
  • Performance Optimization: maxRecords and eaCacheKey enable efficient caching for faster repeated queries.
  • Business Rules: eaCheck and filterByPriceListOnly apply eligibility rules and price list restrictions to the returned products.

Caching Enhancement:

  • Optimized caching is available using maxRecords (max 1000) and eaCacheKey parameters, improving response times for recurring queries.
  • Both parameters must be present to enable caching.

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.

  • cartId can be an Order, Opportunity, or Quote ID.

Communication (vlocity_cmt)

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

  • Resource URL: /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/products
  • Response Format: JSON