createBillingPlanWithProductConfiguration API is used to create a billing plan for the product configurations. This API is used to create a billing plan without the quote flow, directly from the cart page. It creates a billing plan with billing plan line items. For plan type as Milestone, the API also creates milestones. 

APISignature
createBillingPlanWithProductConfigurationstatic Apttus_Billing.BillingService.BillingPlanAPIResponse createBillingPlanWithProductConfiguration(Id productConfigurationId, Id billingPlanTemplateId, Set lineItemIds)

This API accepts Product Configuration ID, Billing Plan Template ID, and a Set of Line Item IDs as input parameters. It creates a billing plan and billing plan line items for the given proposal ID.  Created billing plan is applied to the list of provided Line Item IDs. If you do not provide any line item IDs as input parameters, the created billing plan is applied to all the line items. 

For a billing plan template with plan type as Milestones, createBillingPlanWithProductConfiguration API also creates milestones. 


Request

Field

Type

Required?

Description

productConfiguraionID

ID

Yes

ID of the Product Configuration

billingPlanTemplateIdIDYesID of the Billing Plan Template
lineItemIdsSet <Id>NoSet of Line Item Ids

Response: BillingPlanAPIResponse

Field

Type

Description

isSuccessBooleanReturns true if the API is executed correctly
errorMessageStringError Message if the API is not executed successfully.

billingPlanId

IDId of the created Billing Plan


Code Sample

Id productconfigurationId = 'a2G1N000002RpRZUA0';
Id billingPlanTemplateId = 'a3D1N000000blZc';
Set<Id> LineItemIds = new Set<Id>('a2E1N000001dHox', 'a2E1N000001eHox');

response = Apttus_Billing.BillingService.createBillingPlanWithProductConfiguration(productconfiguratlId, billingPlanTemplateId);
 
// Call API with line item ids parameter
response = Apttus_Billing.BillingService.createBillingPlanWithProductConfiguration(productconfiguratlId, billingPlanTemplateId, LineItemIds);

CODE



createBillingPlanWithProductConfiguration API is not supported for Evergreen Billing and Usage-based products.