---
schema_version: "1"
id: 4a050fae92821e2f5709e1a7b33479a114aa3e56fec7381af90b7e65fd48c24f
title: Replace Offer in Cart Invocable Action
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_invocable_action_replace_offer_in_cart.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_invocable_action_replace_offer_in_cart.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 02e96a2732e380fce2a580ebdb66d844789cdac6723028dd079817efa5c04f2b
description: Use this action to replace an existing offer in a cart containing a single valid offer with a corresponding single offer. The existing offer is disconnected and a new offer is added to the cart. Offers are modeled as products in Salesforce. For example, your existing customer wants to upgrade their limited phone plan to a new plan with unlimited data, text, and talk. As a sales rep, you want to ensure that their existing phone service isn't interrupted and their phone number remains the same. With this action, you can move this customer to an unlimited plan, guaranteeing the continuity of service and retaining the same mobile number and email address.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Replace Offer in Cart Invocable Action

Use this action to replace an existing offer in a cart containing a single valid offer with a corresponding single offer. The existing offer is disconnected and a new offer is added to the cart. Offers are modeled as products in Salesforce. For example, your existing customer wants to upgrade their limited phone plan to a new plan with unlimited data, text, and talk. As a sales rep, you want to ensure that their existing phone service isn't interrupted and their phone number remains the same. With this action, you can move this customer to an unlimited plan, guaranteeing the continuity of service and retaining the same mobile number and email address.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

## Industries CPQ API Used to Invoke Replace Offer in Cart Invocable Action

- getCartsTargetOffers
- replaceOffers

## Input Values

| Parameter | description | data type |
| --- | --- | --- |
| cartId | The ID of the quote or order record where you want to replace the offer. | String |
| offerId | The ID of the target product that you want to upgrade. | 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's encountered during the execution of the action. | String |

## Example

JSON Request

```json
{
  "CartId":"801Dn000000vRGGIA2",
  "Targetofferid": "01uDn000001AfECIA0"
}
```

JSON Response Body

```json
{
  "messages": [
    {
      "message": "Replacement applied successfully",
      "severity": "INFO",
      "code": "830"
    }
  ]
}
```