---
schema_version: "1"
id: 758a001aef6c6edf2ab5ec8a34eded16e32c3456204342162f21d9435b371f15
title: Get Applied or Available Promotions for Cart
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-get-applied-or-available-promotions-for-cart.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-get-applied-or-available-promotions-for-cart.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c8b95a10412e6c0a29c87c533a92bb53009c20eef5738450fa3ccae0cfb698c5
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Get Applied or Available Promotions for Cart

Get a list of promotions. The API can return a sorted list of promotions based on the `sortBy` input parameter.

```nolang
GET /v2/cpq/carts/{cart_ID}/promotions
```

The `filters` parameter specifies the filters to use to determine the subset of promotions to return. Each `filters` parameter specifies the field and values to match. The `fields` parameter specifies the Promotion\_\_c fields to return in the API response.

The `filters` parameter input is a comma-separated list of sObject fields and values. If one of the fields does not match any sObject fields, it will be discarded. If the `filters` parameter specifies multiple values separated by underscores, the API matches the field value with OR, for example, `SubClass_c:HD_SD` will match `SubClassc='HD'`OR `SubClass_c='SD'`.

To specify a promotion name using a locale other than the user's locale, set the localeCode parameter to the desired locale and the query parameter to the name of the promotion. For example:

```nolang
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/8011N000002BL2P/promotions?localeCode=fr&query=échantillon
```

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
getPromotionList
```

## REST Handler

```nolang
APIPromotionsCartsCpqV2
```

## Apex Remote Service

```nolang
CpqAppHandler
```


## Apex Remote Input Map

```nolang
{
  "methodName": "getPromotionList",
  "cartId": "801360000008eNU"
}
```

## 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
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000bARD/promotions?filters=vlocity_cmt_Codec:Test1,Name:Promo1_Promo2&fields=Name,vlocity_cmtCodec,vlocity_cmtIsActive_c
```

## Example Result

```nolang
{
 "totalSize" => 2,
 "messages" => [],
 "records" => [{
   "messages" => [],
   "actions" => {
    "addtocart" => {
     "rest" => {
      "params" => {
       "items" => [{
        "itemId" => "a2f6A000000hDwJQAU"
       }]
      }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG3QAI/promotions"
     },
     "remote" => {
      "params" => {
       "items" => [{
        "itemId" => "a2f6A000000hDwJQAU"
       }], "promotionId" => "a2f6A000000hDwJQAU", "cartId" => "8016A000000bwG3QAI", "methodName" => "postCartsPromoItems"
      }
     },
     "client" => {
      "params" => {}
     }
    },
    "validatecart" => {
     "rest" => {
      "params" => {}, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG3QAI/validate"
     },
     "remote" => {
      "params" => {
       "cartId" => "8016A000000bwG3QAI", "methodName" => "runCartValidation"
      }
     },
     "client" => {
      "params" => {}
     }
    }
   },
   "displaySequence" => 0,
   "name" => "PromoOne",
   "code" => "PromoOne",
   "id" => "a2f6A000000hDwJQAU",
   "category" => "Qualified"
  },
  {
   "messages" => [],
   "actions" => {
    "addtocart" => {
     "rest" => {
      "params" => {
       "items" => [{
        "itemId" => "a2f6A000000hpOHQAY"
       }]
      }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG3QAI/promotions"
     },
     "remote" => {
      "params" => {
       "items" => [{
        "itemId" => "a2f6A000000hpOHQAY"
       }], "promotionId" => "a2f6A000000hpOHQAY", "cartId" => "8016A000000bwG3QAI", "methodName" => "postCartsPromoItems"
      }
     },
     "client" => {
      "params" => {}
     }
    },
    "validatecart" => {
     "rest" => {
      "params" => {}, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG3QAI/validate"
     },
     "remote" => {
      "params" => {
       "cartId" => "8016A000000bwG3QAI", "methodName" => "runCartValidation"
      }
     },
     "client" => {
      "params" => {}
     }
    }
   },
   "displaySequence" => 1,
   "name" => "2146PROMO",
   "code" => "2146PROMO",
   "id" => "a2f6A000000hpOHQAY",
   "category" => "Qualified"
  }
 ]
}
```
