createBillingPlan API is used to create a billing plan. It creates a billing plan and billing plan line items for the given proposal ID. 

APISignature
createBillingPlanstatic Apttus_Billing.BillingService.BillingPlanAPIResponse createBillingPlan(Id proposalId, Id billingPlanTemplateId, Set proposalLineItemIds)

This API accepts Proposal ID, Billing Plan Template ID, and Proposal 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 proposal IDs. If you do not provide any proposal line item IDs as input parameters, the created billing plan is applied to all the proposal line items. This API skips the proposal line items that are already linked to a billing plan. 

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


Request

Field

Type

Required?

Description

proposalID

ID

Yes

ID of the proposal

billingPlanTemplateIdIDYesIDof the Billing Plan Template
proposalLineItemIdsSet <Id>NoSet of proposal Ids

Response

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 proposalId = 'a2G1N000002RpRZUA0';
Id billingPlanTemplateId = 'a3D1N000000blZc';
Set<Id> proposalLineItemIds = new Set<Id>('a2E1N000001dHox', 'a2E1N000001eHox');
Apttus_Billing.BillingService.BillingPlanAPIResponse response;
// Call API without proposal line item ids parameter
response = Apttus_Billing.BillingService.createBillingPlan(proposalId, billingPlanTemplateId);

// Call API with proposal line item ids parameter
response = Apttus_Billing.BillingService.createBillingPlan(proposalId, billingPlanTemplateId, proposalLineItemIds);
CODE



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