---
schema_version: "1"
id: ea706963ccec56026550f9ae3c147e2fb33afca4caf3b1cf920450fb0801d1cf
title: Add Product to 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_add_product_to_cart.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_invocable_action_add_product_to_cart.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d588b1878a3adb1ec16f007c7db92398bf6ff036f3c0c3fe1e2b14ae79015e9a
description: Use this action to add a product as either a quote line item to a quote or an order product to an order in the cart. For example, a sales rep can use this action to add 10 units of fiber broadband to a quote to fulfill a customer's request.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Add Product to Cart Invocable Action

Use this action to add a product as either a quote line item to a quote or an order product to an order in the cart. For example, a sales rep can use this action to add 10 units of fiber broadband to a quote to fulfill a customer's request.

### 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 Add Product to Cart Invocable Action

- postCartsItems

## Input Values

| Parameter | description | data type |
| --- | --- | --- |
| cartId | The ID of the quote or order record that you want to associate line items with. | String |
| itemId | The ID of the price book entry that you want to add to a quote or product. | String |
| noResponseNeeded | Optional. A Boolean value that indicates whether a response is required. The default value is **false**. | Boolean |
| quantity | Optional. The quantity of items to add. The default value is **1**. | Integer |
| validate | Optional. A Boolean value that indicates whether to validate the configuration of the line item before adding the line item. The default value is **true**. | Boolean |
| price | Optional. A Boolean value that indicates whether to update the price of the line item before adding the item. The default value is **true**. | Boolean |

## Output Values

| Parameter | description | data type |
| --- | --- | --- |
| error | An error that's encountered during the execution of the action. | String |
| result | A message indicating whether the product was added to the cart. | String |

## Limitations

Out-of-the-box, you cannot add optional products under a root child in a cart.

## Example

JSON Request

```json
cartId = (801DX000000DctNYAS)
    itemId = (01uDX000000Z5kLYAS)
   
```

JSON Response Body

```json
result (null)
    cartErrorMessage (Required attribute missing for 2 GB 30 Days.)
    error (null)
```