Get Filterable Attributes

Return the filterable attributes that are applicable for this cart, including the product attributes and the product attribute values that the customer can choose to filter products.

1GET /v2/cpq/carts/{cart_ID}/attributes

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 

1getCartsAttributes

The getCartAttributes performs these:

  • Runs PCP validation if runPCP is true (from input).
  • Validates attributes and adds error messages if includeMessages is true (from input).
  • Does not support attribute overrides; it reads product attributes directly.

REST Handler 

1APICartsAttributesCpqV2

Apex Remote Service 

1CpqAppHandler

Apex Remote Input Map 

1{
2  methodName:getCartsAttributes,
3  cartId:801360000008eNU
4}

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}/attributes

Example Request 

1GET
2/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000siLM/attributes

Example Response 

1"totalSize": 1, "messages": [], "records": [{
2   "messages": [],
3   "displaySequence": -1,
4   "attributeCategories": {
5      "totalSize": 1,
6      "messages": [],
7      "records": [{
8         "messages": [],
9         "displaySequence": 123,
10         "Code__c": "121",
11         "Name": "Test Category",
12         "id": "a0936000003VfDrAAK",
13         "productAttributes": {
14            "totalSize": 1,
15            "messages": [],
16            "records": [{
17            "messages": [],
18            "dataType": "number",
19            "inputType": "number-range",
20            "multiselect": false,
21            "required": false,
22            "readonly": false,
23            "min": 1.00,
24            "max": 51.00,
25            "attributeId": "a0A36000009t7jGEAQ",
26            "label": "Filter Number",
27            "displaySequence": 1,
28            "hasRules": false,
29            "values": [{
30               "value": 1,
31               "defaultValue": 1
32            }, {
33              "value": 51,
34               "defaultValue": 51
35           }],
36            "userValues": null
37            }]
38            }
39         }]
40      }
41   }]
42}