Use this flow to replace an existing offer in a cart containing a single valid offer
with a corresponding single offer based on specified inputs. The existing offer is disconnected
and a new offer is added to the cart. This flow invokes CpqCartReplaceOfferInvocable (Replace
Offer in Cart) invocable actions to replace offer in a cart. For example, your existing customer
wants to upgrade their limited phone plan to a new plan with unlimited data, text, and talk time.
As a sales rep, you want to ensure that their existing phone service isn't interrupted and that
their phone number remains the same. With this flow, you can move this customer to an unlimited
plan, guaranteeing ‌continuity of service and retaining the same mobile number and email
address.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Unlimited, and Developer
Editions |
Industries CPQ API Used to Invoke Replace Offer in Cart Flow
- getCartsTargetOffers - Identify valid offers to replace for a specified asset.
- replaceOffers - Replaces an existing offer with a new offer in the cart.
Input Values
| Parameter |
description |
data type |
| cartId |
The ID of the quote, order, or opportunity record where the offer must be
replaced. |
String |
| offerId |
The ID of the target product or offer to replace the current product or
offer. |
String |
| validate |
Optional. A Boolean value that indicates whether to validate the configuration of the
line item before replacing the line item. The default value is
true.
|
Boolean |
| price |
Optional. A Boolean value that indicates whether to recalculate the price based on a
new offer. The default value is true. |
Boolean |
Output Values
| Parameter |
description |
data type |
| output |
A JSON string that includes the details of the replace offer action. |
String |
| error |
An error that was encountered during action execution. |
String |
Example
JSON Request
priceBookEntryId = 01uDn000001Af70IAC
cartId = 801Dn000000vRO7IAM
JSON Response Body
cartId = "801Dn000000vRO7IAM"
errorMessage = "null"
replacementOfferResult = "{"actions":{"itempricesupdated":{"client":{"params":{}},"remote":{"params":{"methodName":"getCartLineItemPrices","cartId":"801Dn000000vRO7IAM","price":false}},"rest":{"link":"/services/apexrest/vlocity_arvk/v2/cpq/carts/801Dn000000vRO7IAM/price?price=false","method":"GET","params":{}}}},"messages":[{"message":"Replacement applied successfully","severity":"INFO","code":"830"}],"totalSize":0}"