Run Pricing for Items to Cart

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.

1POST /v2/cpq/carts/{cart_ID}/price

If the value for pagesize parameter is not provided, it defaults to 20. To fetch or price more than 20 items, specify pagesize explicitly.

Note

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 

1priceCart

REST Handler 

1APIPriceCartsCpqV2

Apex Remote Service 

1CpqAppHandler

Apex Remote Input Map 

Where items specifies the associated line item IDs.

1{
2  "methodName": "priceCart",
3  "cartId": "801360000008eNU",
4  "items": ["80279000000Y5C9AAK", "80279000000Y5CAAA0"]
5}

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

Example Request 

1POST
2/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/price

Example Response 

1{
2   "totalSize": 1,
3   "messages": [],
4   "records": [{
5      "messages": [],
6      "displaySequence": -1,
7      "details": {
8         "totalSize": 1,
9         "messages": [],
10         "records": [{
11            "messages": [],
12            "actions": {
13               "checkout": {
14                  "rest": {
15                     "params": {},
16                     "method": "POST",
17                     "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/checkout"
18                  },
19                  "remote": {
20                     "params": {
21                        "cartId": "80141000000Cg8HAAS",
22                        "methodName": "checkout"
23                     }
24                  },
25                  "client": {
26                     "params": {}
27                  }
28               }
29            },
30            "displaySequence": -1,
31            "Id": "80141000000Cg8HAAS",
32            "Status": "Draft",
33            "OrderNumber": "00000965",
34            "Account.Name": "Telco test",
35            "EffectiveRecurringTotal__c": 0.00,
36            "EffectiveOneTimeTotal__c": 5.00,
37            "EffectiveOrderTotal__c": 5.00,
38            "ObjectType": "Order"
39         }]
40      },
41      "sites": {
42         "totalSize": 0,
43         "messages": [{
44         "severity": "ERROR",
45         "messageId": null,
46         "message": "No Results Found.",
47         "code": "101",
48         "actions": {}
49      }],
50      "actions": {
51         "newsite": {
52            "rest": {
53               "params": {},
54               "method": "POST",
55               "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/sites"
56            },
57            "remote": {
58               "params": {
59                  "type": "Service",
60                  "methodName": "newSite"
61               }
62            },
63            "client": {
64               "params": {}
65            }
66         }
67      }
68   }
69   }]
70}