SAP CPQ (Configure Price Quote) is a software solution that allows customers to configure products and services, set up pricing and discounts, generate accurate quotes, and create custom proposals. While offering a great deal of functionality out-of-the-box, SAP CPQ can also be easily extended and customized, to support custom, and often unique, business processes and procedures.
One way in which SAP CPQ can be extended is by developing an external extension application that is integrated with SAP CPQ using standard integration mechanisms (REST APIs, events, webhook notifications etc.). This approach, also known as side-by-side extensibility, has several distinctive benefits: increased flexibility in terms of technological choice, possibility of using dedicated resources, better performance due to limited scope and many more.
This series of blog posts will explore several ways for building and deploying side-by-side extensions of SAP CPQ, using the SAP BTP (Business Technology Platform) and various tools offered by that platform.
Overview of the solution
SAP Build Process Automation is a low-code/no-code solution that enables you to automate workflow processes without writing a single line of code, just by using a graphical, drag-and-drop editor. It is an ideal solution for developing both simple extensions, as well as complex business process applications. To learn more about SAP Build Process Automation, please check the official documentation.
Overview of the solution (including Part 1 and Part 2)
In the first blog post, we have described how you can invoke SAP Build Process Automation process from SAP CPQ. In this second post, we will demonstrate how to invoke SAP CPQ API from SAP Build Process Automation project using the concept of SAP Build Actions. Actions encapsulate the details of a call to an external API, including the endpoint location, input and output parameters.
For the Action to be able to call, in our case, SAP CPQ API, it needs the information about the location of the SAP CPQ instance, as well as details about the authentication employed (authentication mechanism, credentials, etc.). This information is defined in an SAP BTP Destination, and used in the runtime by the Action when invoking an API.
Example SAP Build Process Automation process used in this blog post series
As an example extension application that we want to integrate with SAP CPQ, we are going to use a simple business process involving legal check of created quotes. The process triggers manual check based on the market associated with the quote, and allows the responsible persons to decide whether quote should be accepted or rejected from the legal perspective. The decision then triggers invocation of appropriate custom CPQ action, something that is described in this blog process.
Please note that, in this blog post, I assume that you are familiar with the basics of using SAP Build Process Automation. If that is not the case, please check the excellent "Creating Processes and Automations with SAP Build Process Automation" learning journey at SAP Learning.
Defining a CPQ Action project in SAP Build
To define a new Action project for invoking SAP CPQ API, navigate your SAP Build Process Automation instance and select SAP Build Lobby -> Connectors -> Actions -> Create.
The easiest way to consume an SAP CPQ API is to use the SAP Business Accelerator Hub, which contains API definitions for many SAP applications, including the SAP CPQ. Select API Specification -> SAP Business Accelerator Hub.

Enter the keyword identifying the SAP CPQ API that you want to consume (for example, if you are interested in Quotes API, enter the quote keyword). Select the SAP CPQ API that you want to consume.

Next screen contains the list of actions available in the selected SAP CPQ API. Click Next.

Here, you can customize Action project name and description or use the defaults. Click Create.

In the next screen, you are presented with the list of all available actions in the selected SAP CPQ API. Select the desired actions and click Add.

Before being able to use the selected actions in your SAP Build Process Automation project, you need to release and publish the Action project. First, click on Release button, optionally enter the description and click Release again. After that, select Publish -> Publish.


Calling the CPQ API from SAP Build Process Automation project
After publishing the Action project, you can use selected SAP CPQ API actions in your SAP Build Process Automation project, for example, as a new step in the process. To do so, click on the + button (Add Process Step) at the place in the process where you want to invoke an SAP CPQ API.

Then select Action -> Browse All Actions and select the desired action (from previously created and published Action project). Then click Add button.

Next, click on Destination Variable -> Create Destination Variable and specify an Identifier and Description of the variable that will hold a reference to the SAP BTP Destination pointing to your SAP CPQ instance (created and explained later in this blog post). Once you are ready to publish and deploy your SAP Build Process Automaton project, you will associate this variable with the concrete SAP BTP Destination (also explained later). For now, you can specify any value as an Identifier, preferable the one that makes it easy to understand its purpose (for example: CpqDestination). You can reuse the same variable for all the SAP CPQ actions that you use in your project.

Most of the SAP CPQ API actions define a set of input values (required and optional input parameters) and an output value (result of the API call). If the action you are planning to use has the required inputs, you can specify them by selecting the Inputs tab and choosing the input value (for each input) from the list of potential values (for example, an output from one of the previous steps) in the Process Content pane.

You can consume the output of the SAP CPQ API actions in the same way as you would consume output of any other process step in the project: you can display it on the form, use it as input parameter for other actions etc. In our example, a form is the step in the process that needs the information from the output, so we can use action's output fields as the values of the input fields of that form by selecting them in the Process Content pane (under the Process Inputs section). These fields (and the represented structure of the output) correspond to the response of the call to the related SAP CPQ API endpoint.

Before being able to deploy your SAP Build Process Automation project, you first need to define an SAP BTP Destination pointing to the SAP CPQ instance of your choice.
Defining a destination in SAP BTP
To connect SAP Build Process Automation instance with an SAP CPQ instance, it is necessary to define a new Destination in the SAP BTP subaccount where the SAP Build Process Automation instance is located. As a first step, a new Trusted Application (OAuth 2.0 client application) in SAP CPQ should be created. To add a new Trusted Application, in the SAP CPQ setup go to Security -> Trusted Applications, then click on Add New -> Add new Trusted Application:
- Specify a descriptive Name for this trusted application (client)
- Note the Client ID and Client Secret that you will use in the next step
- Enable Client Credentials Grant and
- Specify a (preferably technical) user that will be used when accessing the instance.
It is also possible to use other OAuth 2.0 grant types in this case - for more information, please check SAP CPQ documentation and SAP BTP Connectivity documentation (for example, if you want to use the principle propagation option when accessing the SAP CPQ API, you can use SAML 2.0 assertion grant type, as described in SAP CPQ documentation, SAP BTP Connectivity documentation, and in this blog post). Please note that it is generally recommended to define a separate Trusted Application per client application (application accessing the SAP CPQ API), and to enable only required OAuth grant types.

After configuring Trusted Application in SAP CPQ setup, a new Destination needs to be created in the SAP BTP subaccount where the SAP Build Process Automation instance is located. To do so, go to the subaccount, select Connectivity -> Destinations, and click on Create -> From Scratch -> Create:
- Specify a descriptive Name for this destination
- Specify base URL of your SAP CPQ instance
- Select OAuth2ClientCredentials as an Authentication method (if you enabled Client Credentials Grant in the previous step; if not, please consult the documentation)
- In the Client ID and Client Secret fields, paste the value generated in the previous step (in the configuration of the Trusted Application in your SAP CPQ instance)
- Specify Token Service URL by using the base URL of your SAP CPQ instance and adding the /oauth2/token suffix (or consult the documentation)
- Select Use Basic credentials for Token Service
- For the Token Service User field, use the same value as for the Client ID field
- For the Token Service Password field, use the same value as for the Client Secret field

Importing destination into SAP Build
After creating Destination in SAP BTP subaccount, it needs to be imported into SAP Build environment. Navigate your SAP Build Process Automation instance, and select SAP Build Lobby -> Control Tower -> Backend Configuration -> Destinations -> Add. Select the Destination you have created in the previous step and click Next.

On the next screen, select the SAP Build environment to which you want to associate new Destination and click Add Destination.
Deploying SAP Build Process Automation project
After creating and importing SAP BTP Destination for an SAP CPQ instance, you can deploy your SAP Build Process Automation project on a desired environment (before doing that, please make sure that you have released a version of your project, as described in documentation).
The process of deploying SAP Build Process Automation project is described in detail in official documentation. What is important to note here is that you will be asked to specify a Destination for the Destination Variable you have previously defined and used for the SAP CPQ API actions. When asked to do so, please select the Destination you have imported in the previous step.

That's it!
Conclusion
In this blog post, we have demonstrated how to build side-by-side extensions of SAP CPQ using SAP Build Process Automation, a low-code/no-code platform that seamlessly integrates with SAP CPQ, and the rest of the SAP ecosystem. Side-by-side extensions can help you in customizing SAP CPQ to support your concrete business processes and requirements. In the following blog posts, we will talk about other SAP BTP (Business Technology Platform) tools and services that can help you in developing side-by-side extensions for SAP CPQ.
Resources