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.
GET /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
getCartsAttributes
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
APICartsAttributesCpqV2
Apex Remote Service
CpqAppHandler
Apex Remote Input Map
{
methodName:getCartsAttributes,
cartId:801360000008eNU
}
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}/attributes |
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000siLM/attributes
Example Response
"totalSize": 1, "messages": [], "records": [{
"messages": [],
"displaySequence": -1,
"attributeCategories": {
"totalSize": 1,
"messages": [],
"records": [{
"messages": [],
"displaySequence": 123,
"Code__c": "121",
"Name": "Test Category",
"id": "a0936000003VfDrAAK",
"productAttributes": {
"totalSize": 1,
"messages": [],
"records": [{
"messages": [],
"dataType": "number",
"inputType": "number-range",
"multiselect": false,
"required": false,
"readonly": false,
"min": 1.00,
"max": 51.00,
"attributeId": "a0A36000009t7jGEAQ",
"label": "Filter Number",
"displaySequence": 1,
"hasRules": false,
"values": [{
"value": 1,
"defaultValue": 1
}, {
"value": 51,
"defaultValue": 51
}],
"userValues": null
}]
}
}]
}
}]
}