Skip to main content

Get Started with CPQ Cart APIs

Learning Objectives

After completing this unit, you’ll be able to:

  • List the fundamental Cart-based APIs and their functions.
  • Explain how CPQ Cart passes data from APIs to FlexCard LWCs.
  • List the fundamental integration procedures and the APIs they use.

What Are Cart-Based APIs?

Industries CPQ's Cart-based APIs enable CPQ application users to browse, configure, manage, and order products and services. The APIs form the core technical layer that powers CPQ client applications and are separate from the configuration of the CPQ business logic in Product Designer. 

Fundamental Cart-Based APIs

While there are many Cart-based APIs, there are some fundamental ones that are commonly used. Here’s a list of the Cart-based APIs and their functions.

API Name Function

Create Cart

Create an opportunity, order, or quote.

Get List of Products 

Return the list of products that match the specified criteria.

Get Cart Items 

Get a representation of the items in a specified cart. 

Add Item(s) to a Cart

Add one or more items to a specified cart.

Update Item Attributes

Update one or more items in a specified cart. 

Remove Item(s) from a Cart 

Remove one or more items from a specified cart.

Checkout Items in the Cart

Checkout items in the Cart.

You can configure each API to meet your business needs. If you want to learn more about these APIs, refer to the Cart-Based APIs for Industries CPQ article in Salesforce Help. 

Power CPQ Cart with Integration Procedures

Integration procedures are declarative, server-side processes that execute multiple actions in a single server call. An integration procedure can be called from and be a data source for a FlexCard.

In some cases, Industries CPQ uses SDKs and integration procedures to abstract the Cart-based APIs to support configurations. The integration procedures execute remote methods corresponding with the API calls using Apex. They then pass the response to various CPQ FlexCards.

How does CPQ Cart receive its data?

A FlexCard Data Source Type record determines how the FlexCard retrieves the data. There are two ways CPQ Cart FlexCards route data between the Shared Catalog, user, and Salesforce objects (for example, Account). The first way is for a CPQ FlexCard to use an integration procedure as a data source. Generally, this is the way data will be handled for all Get API calls and non-Cart API-related calls. 

FlexCard Data Source setup.The second way is for the card to use an event orchestrator. The component code creates events when the user performs certain actions, and the event listeners trigger the event orchestrator to perform data processing with the SDK, which in turn uses Cart-based APIs. The APIs process the data request and return it in a friendly format for the FlexCard to use.

Industries CPQ Cart Setup panel

When you are viewing data sources in FlexCard Designer, it may get confusing if you are trying to track down where data is being routed from. A child FlexCard doesn’t need a specified data source if a parent FlexCard is set up to push data from its source to that child. A parent FlexCard may not need a data source if the child FlexCard has one. When viewing CPQ Cart for an order, you can open your browser’s development tools and see the network calls the API is making. Examine the JSON to get an idea of which fields are being received by the FlexCards.

Explore Fundamental Integration Procedures

Here are the fundamental (commonly used) integration procedures of CPQ Cart and the APIs they use. 

Integration Procedure API Used

CPQ/CreateOrder

Create Cart

CPQ/GetCartsProducts

Get List of Products

CPQ/GetCartItems

Get Cart Items

CPQ/BulkPostCartItems

Add Item(s) to a Cart

CPQ/UpdateItemAttributes

Update Item Attributes 

CPQ/DeleteItemFromCart

Remove Item(s) from a Cart 

CPQ/SubmitOrder

Checkout items in the cart

As you explore CPQ Cart and how it functions, you can refer to this table to see how the integration procedures operate. CPQGetCartItems, for example, has several additional input parameters specified for the getCartsItems API (remote method). These parameters determine how the response is processed and returned.

CPQGetCartItems integration procedure

Before you get started with CPQ Cart configuration, you must review your business requirements and explore how CPQ Cart features can help you meet those requirements. Let’s do that in the next unit.

Resources

Comparta sus comentarios de Trailhead en la Ayuda de Salesforce.

Nos encantaría saber más sobre su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios en cualquier momento en el sitio de Ayuda de Salesforce.

Más información Continuar a Compartir comentarios