# Add Promotion to Cart

Add a promotion to the specified cart. If an optional child product belongs to a promotion, the promotion is applied to the newly added product when that product is added to the cart.

```nolang
POST /v2/cpq/carts/{cart_ID}/promotions
```

This API supports the guest user enhancements that Salesforce introduced with the Winter ‘21 release. To encrypt and decrypt data for guest users, use the `UserSecurity` class with this API. See Guest User Technical Details.

For additional information, ​see UserSecurity Class and CPQ and Digital Commerce Changes for Guest Users.

## Remote Method

```nolang
postCartsPromoItems
```

## REST Handler

```nolang
APIPromotionsCartsCpqV2
```

## Apex Remote Service

```nolang
CpqAppHandler
```

## Apex Remote Input Map

```nolang
{
  methodName:"postCartsPromoItems",
  cartId:801360000008eNU,
  items:[ { itemId:01t36000000pfcKAAQ }]
}
```

## Package

Communication (vlocity_cmt)

## API Parameters and Response Format

For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary).

## Resource Information

| Response Format | JSON                                                               |
| --------------- | ------------------------------------------------------------------ |
| Resource URL    | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions` |

## Example Request

```nolang
POST
{
  "items": [
    {
      "itemId": "a30460000001vbgAAA"
    }
  ],
  "price": false,
  "validate": false
}

```

## Example Response

```nolang
{
  "messages": [
    {
      "severity": "string",
      "messageId": "string",
      "code": 0,
      "message": "Successfully completed"
    }
  ],
  "records": [
    {
      "messages": [
        {
          "severity": "string",
          "messageId": "string",
          "code": 0,
          "message": "Successfully completed"
        }
      ],
      "displaySequence": -1,
      "Id": "8016A000000bwElQAI",
      "Name": "New customer order",
      "EffectiveDate": "2017-12-25",
      "AccountId": "0016A0000053kHN",
      "Account.Name": "Acme Inc.",
      "EffectiveRecurringTotal__c": 0,
      "EffectiveOneTimeTotal__c": 0,
      "EffectiveOrderTotal__c": 0,
      "OrderNumber": "00000141",
      "Status": "Draft"
    }
  ]
}
```
