Get Cart Summary

Overview 

Returns a comprehensive summary of the cart, including:

  • Account details and associated information
  • Multi-site order information and available sites
  • Action links for further operations (e.g., checkout)

What You Get 

  • A quick overview of your cart’s status
  • Total costs broken down by type
  • Account information
  • Shipping details
  • Available actions like checkout
  • Multi-site order information

Key Benefits 

1. Lightning-Fast Updates 

  • Instant access to cart information
  • Perfect for real-time displays like shopping cart icons
  • Reliable performance even during high-traffic periods

2. Smart Resource Usage 

  • Faster than full cart details
  • Ideal for mobile apps and websites
  • Efficient bandwidth usage

3. Complete Accuracy 

  • Real-time pricing and discounts
  • Checkout readiness status
  • Consistent information across all channels

Who Should Use This 

For Store Owners 

  • Monitor cart activity in real-time
  • Track sales performance
  • View customer shopping patterns

For Customers 

  • Quick view of cart totals
  • Instant status updates
  • Fast checkout verification

For Business Analysts 

  • Track average cart values
  • Monitor discount usage
  • Analyze shopping trends

Core Features 

Enterprise-Grade Security 

  • Role-based access controls
  • Secure data transmission
  • Protected customer information
  • Authenticated transactions
  • Comprehensive audit trails

Global Support 

  • Multi-language support
  • Currency conversion
1GET /v2/cpq/carts/{cart_Id}?headerFieldSet={field_set_feature}&validate={true|false}

Get Cart Details excludes these fields from the Opportunity, Order, and Quote.

  • IsDeleted

  • CreatedDate

  • CreatedById

  • LastModifiedDate

  • LastModifiedById

  • SystemModstamp

  • LastActivityDate

  • CleanStatus

Get Cart Details returns these fields from the Opportunity, Order, and Quote.

  • Opportunity

    { ‘Name’, ‘Account.Id’, ‘Account.Name’, ‘Account.PhotoUrl’, ‘Email__c’, ‘Phone__c’, ‘EffectiveRecurringTotal__c’, ‘EffectiveOneTimeTotal__c’, ‘EffectiveOpportunityTotal__c’, ‘PriceListId__c’,‘PriceListId__r.Name’,‘PriceListId__r.CurrencyCode__c’,‘PriceListId__r.LoyaltyCode__c’, ‘OriginatingContractId__c’ }

  • Order

    { ‘Name’, ‘Status’, ‘OrderNumber’, ‘Account.Id’, ‘Account.Name’, ‘Account.PhotoUrl’, ‘ShippingAddress’, ‘ShipToContact.Name’, ‘Email__c’, ‘Phone__c’, ‘EffectiveRecurringTotal__c’, ‘EffectiveOneTimeTotal__c’, ‘EffectiveOrderTotal__c’,‘PriceListId__c’,‘PriceListId__r.Name’,‘PriceListId__r.CurrencyCode__c’,‘PriceListId__r.LoyaltyCode__c’, ‘OrderStatus__c’, ‘IsChangesAllowed__c’, ‘SupersededOrderId__c’, ‘OriginatingContractId__c’,‘SupplementalAction__c’, ‘RecordType.Name’, ‘AsyncOperation__c’ }

  • Quote

    { ‘Name’, ‘QuoteNumber’, ‘Account.Id’, ‘Account.Name’, ‘Account.PhotoUrl’, ‘ShippingAddress’, ‘ShippingName’, ‘Email’, ‘Phone’, ‘EffectiveRecurringTotal__c’, ‘EffectiveOneTimeTotal__c’, ‘EffectiveQuoteTotal__c’, ‘PriceListId__c’,‘PriceListId__r.Name’,‘PriceListId__r.CurrencyCode__c’,‘PriceListId__r.LoyaltyCode__c’, ‘RenewalSourceContractId__c’, ‘RecordType.Name’, ‘AsyncOperation__c’ }

By default, items deleted from a cart are not evaluated for Vlocity Rules. To enable evaluation of deleted items, set the ‘ShouldConsiderDeletedItems’ custom setting to true.

Note

In ​Salesforce Industries Communications, Media, and Energy Winter ‘21 and later releases, the getCarts validate parameter has a default value of _True*, so the API will return validation messages. If validate=false is not specified, validation messages are returned by default. Specify validate=false in the UI if you do not want to receive validation messages.

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 

1getCarts

REST Handler 

1APICartsCpqV2

Apex Remote Service 

1CpqAppHandler

Apex Remote Input Map 

1{
2  "methodName": "getCarts",
3  "cartId": "{CART_ID}",
4  "headerFieldSet": "CPQV2",
5  "validate": true
6}
7
8where CART_ID = Order.Id, Opportunity.Id or Quote.Id

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}?headerFieldSet={field_set_feature}&validate={true/false}

Example Request 

1GET
2/services/apexrest/vlocity_cmt/v2/cpq/carts/801DX000000FERDYA4

Example Result 

1{
2  "totalSize": 1,
3  "records": [
4    {
5      "messages": [
6
7      ],
8      "displaySequence": -1,
9      "details": {
10        "totalSize": 1,
11        "messages": [
12
13        ],
14        "records": [
15          {
16            "messages": [
17
18            ],
19            "actions": {
20              "checkout": {
21                "remote": {
22                  "params": {
23                    "cartId": "801DX000000FERDYA4",
24                    "methodName": "checkout"
25                  }
26                },
27                "rest": {
28                  "method": "null",
29                  "link": "null",
30                  "params": {
31
32                  }
33                },
34                "client": {
35                  "params": {
36
37                  },
38                  "records": [
39
40                  ]
41                }
42              }
43            },
44            "displaySequence": -1,
45            "frameAgreementPresent": false,
46            "isNotActiveContractDiscountPresent": false,
47            "PriceListId__r.LoyaltyCode__c": "PTS",
48            "SupersededOrderId__c": "",
49            "OrderNumber": "00001281",
50            "PriceListId__r.CurrencyCode__c": "USD",
51            "translatedLabels": {
52              "Status": "Status",
53              "vlocity_cmt__IsChangesAllowed__c": "Changes Allowed",
54              "vlocity_cmt__EffectiveRecurringTotal__c": "Recurring Total",
55              "vlocity_cmt__OriginatingContractId__c": "Originating Contract",
56              "OrderNumber": "Order Number",
57              "vlocity_cmt__OrderStatus__c": "Order Status",
58              "vlocity_cmt__SupersededOrderId__c": "Superseded Order",
59              "vlocity_cmt__PriceListId__c": "Price List",
60              "Name": "Order Name",
61              "vlocity_cmt__EffectiveUsagePriceTotal__c": "Usage Price Total",
62              "vlocity_cmt__Email__c": "Email",
63              "ShippingAddress": "Shipping Address",
64              "vlocity_cmt__SupplementalAction__c": "Supplemental Action",
65              "Id": "Order ID",
66              "vlocity_cmt__AsyncOperation__c": "Async Operation",
67              "vlocity_cmt__Phone__c": "Phone",
68              "vlocity_cmt__EffectiveOneTimeTotal__c": "One Time Total",
69              "vlocity_cmt__EffectiveOrderTotal__c": "Order Total"
70            },
71            "EffectiveRecurringTotal__c": 358.0,
72            "canCheckoutDiscounts": true,
73            "EffectiveUsagePriceTotal__c": 0.0,
74            "PriceListId__c": "a3sDX00000003lJYAQ",
75            "accountDiscountsCount": 0,
76            "ObjectType": "Order",
77            "Account.Id": "001DX000002K5WlYAK",
78            "orderStatusValue": "Ready To Submit",
79            "Account.PhotoUrl": "/services/images/photo/001DX000002K5WlYAK",
80            "cartAddedDiscounts": 1,
81            "Status": "Draft",
82            "EffectiveOneTimeTotal__c": 0.0,
83            "IsChangesAllowed__c": true,
84            "contractDiscountsCount": 0,
85            "OrderStatus__c": "Ready To Submit",
86            "PriceListId__r.Name": "Cpqnext_PRICELIST",
87            "discountsForSubmission": false,
88            "EffectiveOrderTotal__c": 0.0,
89            "Account.Name": "TestAcct",
90            "Id": "801DX000000FERDYA4",
91            "isCartActivated": false
92          }
93        ]
94      },
95      "sites": {
96        "totalSize": 0,
97        "messages": [
98          {
99            "messageId": null,
100            "bundleId": null,
101            "code": "101",
102            "severity": "ERROR",
103            "message": "No Results Found.",
104            "actions": {
105
106            }
107          }
108        ],
109        "actions": {
110          "newsite": {
111            "remote": {
112              "params": {
113                "methodName": "newSite",
114                "type": "Service"
115              }
116            },
117            "rest": {
118              "method": "POST",
119              "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801DX000000FERDYA4/sites",
120              "params": {
121                "type": "Service"
122              }
123            },
124            "client": {
125              "params": {
126
127              },
128              "records": [
129
130              ]
131            }
132          }
133        }
134      }
135    }
136  ],
137  "messages": [
138
139  ]
140}