Get Cart Promotions

Retrieve all promotions for a specified opportunity, quote, or order.

GET /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

getCartsPromotions

Handlers

REST Endpoint: APIPromotionsCartsCpqV2.cls
Implementation: EPCPromotionRuntimeService.cls

Apex remote service

CpqAppHandler

Apex Remote Input Map

methodName:getCartsPromotions
cartId:8011I000000TUaK
query:query
filters:vlocity_cmt__Code__c:Root-Promo
sortBy:Id

Package

Communication (vlocity_cmt)

API Parameters and Response Format

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

Resource Information

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

Example Request

GET /services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000TUaK/promotions?query=iphone&sortBy=Id&filters=vlocity_cmt__Code__c:Root-Promo

Example Response

{
  "totalSize": 1,
  "messages": [],
  "records": [
    {
      "messages": [],
      "actions": {
        "validatecart": {
          "rest": {
            "params": {},
            "method": "POST",
            "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000TUaKQAW/validate"
          },
          "remote": {
            "params": {
              "cartId": "8011I000000TUaKQAW",
              "methodName": "runCartValidation"
            }
          },
          "client": {
            "params": {}
          }
        }
      },
      "displaySequence": 0,
      "Id": "a2j1I000000XzfWQAS",
      "Name": "Root-Promo",
      "vlocity_cmt__Code__c": "Root-Promo",
      "name": "Root-Promo",
      "code": "Root-Promo",
      "id": "a2j1I000000XzfWQAS",
      "category": "Qualified"
    }
  ]
}