Return the pricing information for each line item by invoking pricing rules. If line items are specified, they are priced. If line items are not specified, all of the items in the cart are priced.
POST /v2/cpq/carts/{cart_ID}/price
note: If the value for pagesize parameter is not provided, it defaults to 20. To fetch or price more than 20 items, specify pagesize explicitly.
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
priceCart
REST Handler
APIPriceCartsCpqV2
Apex Remote Service
CpqAppHandler
Apex Remote Input Map
Where items specifies the associated line item IDs.
{
"methodName": "priceCart",
"cartId": "801360000008eNU",
"items": ["80279000000Y5C9AAK", "80279000000Y5CAAA0"]
}
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}/price |
Example Request
POST
/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/price
Example Response
{
"totalSize": 1,
"messages": [],
"records": [{
"messages": [],
"displaySequence": -1,
"details": {
"totalSize": 1,
"messages": [],
"records": [{
"messages": [],
"actions": {
"checkout": {
"rest": {
"params": {},
"method": "POST",
"link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/checkout"
},
"remote": {
"params": {
"cartId": "80141000000Cg8HAAS",
"methodName": "checkout"
}
},
"client": {
"params": {}
}
}
},
"displaySequence": -1,
"Id": "80141000000Cg8HAAS",
"Status": "Draft",
"OrderNumber": "00000965",
"Account.Name": "Telco test",
"EffectiveRecurringTotal__c": 0.00,
"EffectiveOneTimeTotal__c": 5.00,
"EffectiveOrderTotal__c": 5.00,
"ObjectType": "Order"
}]
},
"sites": {
"totalSize": 0,
"messages": [{
"severity": "ERROR",
"messageId": null,
"message": "No Results Found.",
"code": "101",
"actions": {}
}],
"actions": {
"newsite": {
"rest": {
"params": {},
"method": "POST",
"link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/sites"
},
"remote": {
"params": {
"type": "Service",
"methodName": "newSite"
}
},
"client": {
"params": {}
}
}
}
}
}]
}