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.

1POST /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 

1postCartsPromoItems

REST Handler 

1APIPromotionsCartsCpqV2

Apex Remote Service 

1CpqAppHandler

Apex Remote Input Map 

1{
2  methodName:"postCartsPromoItems",
3  cartId:801360000008eNU,
4  items:[ { itemId:01t36000000pfcKAAQ }]
5}

Package 

Communication (vlocity_cmt)

API Parameters and Response Format 

For API parameter names and descriptions, see Cart-Based API Swagger Reference.

Resource Information 

Response FormatJSON
Resource URL/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions

Example Request 

1POST
2{
3  "items": [
4    {
5      "itemId": "a30460000001vbgAAA"
6    }
7  ],
8  "price": false,
9  "validate": false
10}

Example Response 

1{
2  "messages": [
3    {
4      "severity": "string",
5      "messageId": "string",
6      "code": 0,
7      "message": "Successfully completed"
8    }
9  ],
10  "records": [
11    {
12      "messages": [
13        {
14          "severity": "string",
15          "messageId": "string",
16          "code": 0,
17          "message": "Successfully completed"
18        }
19      ],
20      "displaySequence": -1,
21      "Id": "8016A000000bwElQAI",
22      "Name": "New customer order",
23      "EffectiveDate": "2017-12-25",
24      "AccountId": "0016A0000053kHN",
25      "Account.Name": "Acme Inc.",
26      "EffectiveRecurringTotal__c": 0,
27      "EffectiveOneTimeTotal__c": 0,
28      "EffectiveOrderTotal__c": 0,
29      "OrderNumber": "00000141",
30      "Status": "Draft"
31    }
32  ]
33}