Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Adding Options to a Sub Bundle

This API allows you to add one or more option products to the sub-bundle of an existing cart line item. This is typically used in CPQ scenarios where a configurable product (bundle) has nested configurations (sub-bundles) and additional components or features need to be dynamically added.

API

Signature

addOptionsToSubBundle

webService static Apttus_CPQApi.CPQ.AddOptionsResponseDO addOptionsToSubBundle(Id cartId, Integer primaryLineNumber, List selectedOptions)

Request Parameters

Name

Type

Description

CartIDID

The cart ID

PrimaryLineNumberInteger

Line Number of the Sub Bundle Product

selectedOptionsList<Apttus_CPQApi.CPQ.SelectedOptionDO>

Apttus_CPQApi CPQ.SelectedOptionDO with componentId and componentProductId

Data Object - Apttus_CPQApi.CPQ.SelectedOptionDO

Field

Type

Description

AttributeValuesList

List of attributes values.

AssetIdList

Asset Id

QuantityDecimal

The product quantity

CommentsString

Comments associated with the record.

ComponentIdID

Id of the component.

ComponentProductIdID

Id of the component product.

CustomDataApttus_Config2__LineItem__c

The values to be set for the custom fields in the CustomFields List

CustomFieldsList<String>

List of Custom Field’s API Name

EndDateDate

The end date.

QuantityDecimal

The option quantity.

SellingTermDecimal

The option selling term.

SourceIdID

ID of the source option.

StartDateDate

The start date. You should ensure you use the correct date format.

Response : Apttus_CPQApi.CPQ.CreateCartResponseDO
NameTypeDescription
CartIdIDThe identifier of the cart
RequestIdIDRequest ID

Code Sample

The sample code below creates an option and adds them to the specified bundle in the specified cart.
Id cartId = 'a01XXXXXXXXXXXX'; // Replace with your Cart Id
Integer primaryLineNumber = 1; // Replace with your sub-bundle's primary line number

// Prepare selected options
List<CPQ.SelectedOptionDO> selectedOptions = new List<CPQ.SelectedOptionDO>();

CPQ.SelectedOptionDO option1 = new CPQ.SelectedOptionDO();
option1.ComponentId = 'a0BXXXXXXXXXXXX'; // Replace with a valid Component Id
option1.ComponentProductId = '01tXXXXXXXXXXXX'; // Replace with a valid Product Id
option1.Quantity = 1;
selectedOptions.add(option1);

// Add more options as needed...

// Call the web service method
CPQ.AddOptionsResponseDO response = CPQWebService.addOptionsToSubBundle(
    cartId,
    primaryLineNumber,
    selectedOptions
);

// Debug the response
System.debug('Added Option Line Items: ' + response.addedOptionLineItems);

Integration Details

Use the following information in your integrations with CPQ Web Services API. Refer to Integrating Conga with External Systems for information on how to get started.