There are two ways in your order capture journey that you can apply/add a promotion when you create or update your cart:
-
Choose a promotion using getOffers and add it to the basket. The product to which the promotion applies is added to the basket by default. The promotion is applied to the product.
-
Add a product and then apply a promotion to it.
-
For a promotion with these configurations, promotion applies to all products in the bundle, not just the root product.
- PromotionItem: RootProduct
- Scope: Update Item Only
Adding a promotion to a basket is a two-step process if Multi Transaction Service (MTS). To enable MTS, see CPQ Configuration Settings Reference.
For example:
Step 1: Create the order Item and apply the promotion:
1POST /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/basket
2
3Request body:
4{"basketAction":"AddWithNoConfig","offer":"iPhone8Offer"}
Step 2: In the response of Step1, under the validateAndPriceAction node in the JSON response, a REST parameter named transactionKey is present. Add that transaction key in the request body to make the request for Step 2.
Create the order Item and apply a promotion:
1POST /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/basket
2Request body:{"basketAction":"AddWithNoConfig","offer":"iPhone8Offer", "transactionKey":"111123mx12223232000"}
During the second step, the engine applies validation and pricing to the basket and returns an updated cartContextKey.