Adding Line Items
You can use this API to add line items to a specified cart. The line items can be for bundles, standalone products, and options.
This API does not create the associated Product Attribute Value record, you must call the createNewAttributes API right after executing this API.
API |
Signature |
---|---|
addLineItems |
webService static Apttus_CPQApi.CPQ.AddMultiProductResponseDO addLineItems(Id cartId, List lineItems, Apttus_CPQApi.CPQ.AddLineItemsRequestDO optionalParams) |
Parameters |
||
---|---|---|
Field |
Type |
Description |
cartId | ID |
The ID of the cart. |
lineItems | List<Apttus_Config2__LineItem__c> |
List of LineItems SObject records to be added to the Cart. |
optionalParams | Apttus_CPQApi.CPQ.AddLineItemsRequestDO |
Additional parameter that must not be used for this API. |
Response Data Object - Apttus_CPQApi.CPQ.AddMultiProductResponseDO |
||
---|---|---|
Field |
Type |
Description |
LineNumbers | List<Decimal> |
Contains List of Line Numbers of the newly added Line Items |
Code Sample
The sample code below enables you to add a bundle and an option line item. You must provide values for the following mandatory fields:
- For bundle
- ConfigurationId__c
- ProductId__c
- For option
- ConfigurationId__c
- OptionId__c
- ParentBundleNumber__c
You can set relevant values on any field when passing the Line Item record in the request. However, you should not set system fields here such as Line Number, Primary Line Number, and Pricing related fields. CPQ manages these fields internally.