You can use this Batch Apex Job to price the Line Items in a given Cart asynchronously. This Batch Apex creates one batch for each primary line item in the cart.

APISignature of the Constructor
RepriceCartJob

global RepriceCartJob(ID cartId, String cartTitle);

Request Parameter
NameTypeRequired?Description
cartIdIDYesThe ID of cart you want to reprice.
cartTitleStringYesThe title of the cart.


Code Sample

The below code sample returns job ID and reprices the line item one by one based on the batch size. The cart used in the sample code has products that added both manually and through an API. After the job is completed, CPQ sends you the email confirming the completion of the repricing action. If the Apex class encounters any run-time errors, the repricing is aborted.

public Id rePriceCartJob(Id cartId, String cartTitle) {
// create the reprice cart batch job
ID jobId = Database.executeBatch(new Apttus_Config2.RepriceCartJob(cartId, cartTitle), 1);    
   	return jobId;
}
CODE