Return the cart details, including, account, multi-site, and additional action information.
-
Account information associated with this cart
-
If this cart includes a multi-site order, available sites
-
Links to further actions, such as check out
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' }
-
Order
{ '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: 801360000008 eNU,
"headerFieldSet": "CPQV2"
}
cartId = 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/80141000000Cg8H
Example Result
{
"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": {}
}
}
}
}
}]
}