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
GET /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' }
note: 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.
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
getCarts
REST Handler
APICartsCpqV2
Apex Remote Service
CpqAppHandler
Apex Remote Input Map
{
"methodName": "getCarts",
"cartId": "{CART_ID}",
"headerFieldSet": "CPQV2",
"validate": true
}
where 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 Format | JSON |
|---|---|
| Resource URL | /services/apexrest/{namespace}/v2/cpq/carts/{CART_ID}?headerFieldSet={field_set_feature}&validate={true/false} |
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/801DX000000FERDYA4
Example Result
{
"totalSize": 1,
"records": [
{
"messages": [
],
"displaySequence": -1,
"details": {
"totalSize": 1,
"messages": [
],
"records": [
{
"messages": [
],
"actions": {
"checkout": {
"remote": {
"params": {
"cartId": "801DX000000FERDYA4",
"methodName": "checkout"
}
},
"rest": {
"method": "null",
"link": "null",
"params": {
}
},
"client": {
"params": {
},
"records": [
]
}
}
},
"displaySequence": -1,
"frameAgreementPresent": false,
"isNotActiveContractDiscountPresent": false,
"PriceListId__r.LoyaltyCode__c": "PTS",
"SupersededOrderId__c": "",
"OrderNumber": "00001281",
"PriceListId__r.CurrencyCode__c": "USD",
"translatedLabels": {
"Status": "Status",
"vlocity_cmt__IsChangesAllowed__c": "Changes Allowed",
"vlocity_cmt__EffectiveRecurringTotal__c": "Recurring Total",
"vlocity_cmt__OriginatingContractId__c": "Originating Contract",
"OrderNumber": "Order Number",
"vlocity_cmt__OrderStatus__c": "Order Status",
"vlocity_cmt__SupersededOrderId__c": "Superseded Order",
"vlocity_cmt__PriceListId__c": "Price List",
"Name": "Order Name",
"vlocity_cmt__EffectiveUsagePriceTotal__c": "Usage Price Total",
"vlocity_cmt__Email__c": "Email",
"ShippingAddress": "Shipping Address",
"vlocity_cmt__SupplementalAction__c": "Supplemental Action",
"Id": "Order ID",
"vlocity_cmt__AsyncOperation__c": "Async Operation",
"vlocity_cmt__Phone__c": "Phone",
"vlocity_cmt__EffectiveOneTimeTotal__c": "One Time Total",
"vlocity_cmt__EffectiveOrderTotal__c": "Order Total"
},
"EffectiveRecurringTotal__c": 358.0,
"canCheckoutDiscounts": true,
"EffectiveUsagePriceTotal__c": 0.0,
"PriceListId__c": "a3sDX00000003lJYAQ",
"accountDiscountsCount": 0,
"ObjectType": "Order",
"Account.Id": "001DX000002K5WlYAK",
"orderStatusValue": "Ready To Submit",
"Account.PhotoUrl": "/services/images/photo/001DX000002K5WlYAK",
"cartAddedDiscounts": 1,
"Status": "Draft",
"EffectiveOneTimeTotal__c": 0.0,
"IsChangesAllowed__c": true,
"contractDiscountsCount": 0,
"OrderStatus__c": "Ready To Submit",
"PriceListId__r.Name": "Cpqnext_PRICELIST",
"discountsForSubmission": false,
"EffectiveOrderTotal__c": 0.0,
"Account.Name": "TestAcct",
"Id": "801DX000000FERDYA4",
"isCartActivated": false
}
]
},
"sites": {
"totalSize": 0,
"messages": [
{
"messageId": null,
"bundleId": null,
"code": "101",
"severity": "ERROR",
"message": "No Results Found.",
"actions": {
}
}
],
"actions": {
"newsite": {
"remote": {
"params": {
"methodName": "newSite",
"type": "Service"
}
},
"rest": {
"method": "POST",
"link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801DX000000FERDYA4/sites",
"params": {
"type": "Service"
}
},
"client": {
"params": {
},
"records": [
]
}
}
}
}
}
],
"messages": [
]
}