Happy Business Starts Here

Highlighted
Zuora Support

how to add a bundle to a Quote programatically

Question: We are making customization to our quote flow and want to know how to add a bundle to a Quote.






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Zuora Support

Re: how to add a bundle to a Quote programatically

Answer:

 

Please find below Sample code shows a high level example of adding a bundle to a quote.

//Get an existing quote by Id zqu.Quote currentQuote = zqu.Quote.getInstance('<quoteId>'); //Add products to the Quote List<zqu.Product> productsToAdd = zqu.Product.loadProductsWithChildren(new List<Id>{'product1Id', 'product2Id'}); List<zqu.QuoteProduct> addedProducts = currentQuote.addQuoteProducts(productsToAdd); //Commit the products to the database currentQuote.save();

 

Please find below KC article for more information on Quote class . 
https://knowledgecenter.zuora.com/CA_Commerce/I_Development_Resources/C_Component_Library/C_Global_C...






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post

1 REPLY 1
Highlighted
Zuora Support

Re: how to add a bundle to a Quote programatically

Answer:

 

Please find below Sample code shows a high level example of adding a bundle to a quote.

//Get an existing quote by Id zqu.Quote currentQuote = zqu.Quote.getInstance('<quoteId>'); //Add products to the Quote List<zqu.Product> productsToAdd = zqu.Product.loadProductsWithChildren(new List<Id>{'product1Id', 'product2Id'}); List<zqu.QuoteProduct> addedProducts = currentQuote.addQuoteProducts(productsToAdd); //Commit the products to the database currentQuote.save();

 

Please find below KC article for more information on Quote class . 
https://knowledgecenter.zuora.com/CA_Commerce/I_Development_Resources/C_Component_Library/C_Global_C...






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post